[STATEMENT]
lemma separation_t1: "x \<noteq> y \<longleftrightarrow> (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> y) = (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)
[PROOF STEP]
using t1_space[of x y]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> y \<Longrightarrow> \<exists>U. open U \<and> x \<in> U \<and> y \<notin> U

goal (1 subgoal):
 1. (x \<noteq> y) = (\<exists>U. open U \<and> x \<in> U \<and> y \<notin> U)
[PROOF STEP]
by blast


[STATEMENT]
lemma totatives_prime: "prime p \<Longrightarrow> totatives p = {0<..<p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> totatives p = {0<..<p}
[PROOF STEP]
using totatives_prime_power_Suc [of p 0]
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> totatives (p ^ Suc 0) = {0<..p ^ Suc 0} - (*) p ` {0<..p ^ 0}

goal (1 subgoal):
 1. prime p \<Longrightarrow> totatives p = {0<..<p}
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_eq: "exp w = exp z \<longleftrightarrow> (\<exists>n::int. w = z + (of_int (2 * n) * pi) * \<i>)"
                (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
have "exp w = exp z \<longleftrightarrow> exp (w-z) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp w = exp z) = (exp (w - z) = 1)
[PROOF STEP]
by (simp add: exp_diff)
[PROOF STATE]
proof (state)
this:
(exp w = exp z) = (exp (w - z) = 1)

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(exp w = exp z) = (exp (w - z) = 1)

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (Re w = Re z \<and> (\<exists>n::int. Im w - Im z = of_int (2 * n) * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp (w - z) = 1) = (Re w = Re z \<and> (\<exists>n. Im w - Im z = real_of_int (2 * n) * pi))
[PROOF STEP]
by (simp add: exp_eq_1)
[PROOF STATE]
proof (state)
this:
(exp (w - z) = 1) = (Re w = Re z \<and> (\<exists>n. Im w - Im z = real_of_int (2 * n) * pi))

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(exp (w - z) = 1) = (Re w = Re z \<and> (\<exists>n. Im w - Im z = real_of_int (2 * n) * pi))

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re w = Re z \<and> (\<exists>n. Im w - Im z = real_of_int (2 * n) * pi)) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
by (auto simp: algebra_simps intro!: complex_eqI)
[PROOF STATE]
proof (state)
this:
(Re w = Re z \<and> (\<exists>n. Im w - Im z = real_of_int (2 * n) * pi)) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)

goal (1 subgoal):
 1. (exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(exp w = exp z) = (\<exists>n. w = z + complex_of_real (real_of_int (2 * n) * pi) * \<i>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma distrib_subset2:
  "Rep_preal (w * x + w * y) \<subseteq> Rep_preal (w * (x + y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_preal (w * x + w * y) \<subseteq> Rep_preal (w * (x + y))
[PROOF STEP]
apply (clarsimp simp: mem_Rep_preal_add_iff mem_Rep_preal_mult_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa xb ya yb. \<lbrakk>xa \<in> Rep_preal w; xb \<in> Rep_preal w; ya \<in> Rep_preal x; yb \<in> Rep_preal y\<rbrakk> \<Longrightarrow> \<exists>xc\<in>Rep_preal w. \<exists>y\<in>Rep_preal (x + y). xa * ya + xb * yb = xc * y
[PROOF STEP]
using mem_Rep_preal_add_iff preal_add_mult_distrib_mean
[PROOF STATE]
proof (prove)
using this:
(?z \<in> Rep_preal (?r + ?s)) = (\<exists>x\<in>Rep_preal ?r. \<exists>y\<in>Rep_preal ?s. ?z = x + y)
\<lbrakk>?a \<in> Rep_preal ?w; ?b \<in> Rep_preal ?w; ?d \<in> Rep_preal ?x; ?e \<in> Rep_preal ?y\<rbrakk> \<Longrightarrow> \<exists>c\<in>Rep_preal ?w. ?a * ?d + ?b * ?e = c * (?d + ?e)

goal (1 subgoal):
 1. \<And>xa xb ya yb. \<lbrakk>xa \<in> Rep_preal w; xb \<in> Rep_preal w; ya \<in> Rep_preal x; yb \<in> Rep_preal y\<rbrakk> \<Longrightarrow> \<exists>xc\<in>Rep_preal w. \<exists>y\<in>Rep_preal (x + y). xa * ya + xb * yb = xc * y
[PROOF STEP]
by blast


[STATEMENT]
lemma ex_toCard_pred:
  "\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists> f. toCard_pred A r f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. toCard_pred A r f
[PROOF STEP]
unfolding toCard_pred_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r \<and> Card_order r
[PROOF STEP]
using card_of_ordLeq[of A "Field r"]
    ordLeq_ordIso_trans[OF _ card_of_unique[of "Field r" r], of "|A|"]
[PROOF STATE]
proof (prove)
using this:
(\<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r) = (|A| \<le>o |Field r|)
\<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> |A| \<le>o |Field r|

goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r\<rbrakk> \<Longrightarrow> \<exists>f. inj_on f A \<and> f ` A \<subseteq> Field r \<and> Card_order r
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Corps) n_val_t2p:"\<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K\<rbrakk> \<Longrightarrow>
                   n_val K v (x \<cdot>\<^sub>r y) = n_val K v x + (n_val K v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K\<rbrakk> \<Longrightarrow> n_val K v (x \<cdot>\<^sub>r y) = n_val K v x + n_val K v y
[PROOF STEP]
apply (cut_tac field_is_ring,
       frule Ring.ring_tOp_closed[of K x y], assumption+,
       frule n_val[of v "x \<cdot>\<^sub>r y"], assumption+,
       frule Lv_pos[of "v"],
       simp add:val_t2p,
       frule n_val[THEN sym, of v x], assumption+,
       frule n_val[THEN sym, of v y], assumption+, simp,
       frule Lv_z[of v], erule exE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K; Ring K; x \<cdot>\<^sub>r y \<in> carrier K; n_val K v (x \<cdot>\<^sub>r y) * ant z = n_val K v x * ant z + n_val K v y * ant z; 0 < z; v x = n_val K v x * ant z; v y = n_val K v y * ant z; Lv K v = ant z\<rbrakk> \<Longrightarrow> n_val K v (x \<cdot>\<^sub>r y) = n_val K v x + n_val K v y
[PROOF STEP]
apply (subgoal_tac "ant z \<noteq> 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>z. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K; Ring K; x \<cdot>\<^sub>r y \<in> carrier K; n_val K v (x \<cdot>\<^sub>r y) * ant z = n_val K v x * ant z + n_val K v y * ant z; 0 < z; v x = n_val K v x * ant z; v y = n_val K v y * ant z; Lv K v = ant z; ant z \<noteq> 0\<rbrakk> \<Longrightarrow> n_val K v (x \<cdot>\<^sub>r y) = n_val K v x + n_val K v y
 2. \<And>z. \<lbrakk>valuation K v; x \<in> carrier K; y \<in> carrier K; Ring K; x \<cdot>\<^sub>r y \<in> carrier K; n_val K v (x \<cdot>\<^sub>r y) * ant z = n_val K v x * ant z + n_val K v y * ant z; 0 < z; v x = n_val K v x * ant z; v y = n_val K v y * ant z; Lv K v = ant z\<rbrakk> \<Longrightarrow> ant z \<noteq> 0
[PROOF STEP]
apply (frule_tac z1 = z in amult_distrib1[THEN sym, of _ "n_val K v x"
       "n_val K v y"], simp,
       thin_tac "n_val K v x * ant z + n_val K v y * ant z =
           (n_val K v x + n_val K v y) * ant z",
       rule_tac z = z and a = "n_val K v (x \<cdot>\<^sub>r y)" and
        b = "n_val K v x + n_val K v y" in adiv_eq, simp, assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inter_add_right1: "\<not> x \<in># N \<Longrightarrow> N \<inter># (add_mset x M) = N \<inter># M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin># N \<Longrightarrow> N \<inter># add_mset x M = N \<inter># M
[PROOF STEP]
by (simp add: multiset_eq_iff not_in_iff)


[STATEMENT]
lemma list_of_oalist_OAlist: "list_of_oalist (OAlist xs) = sort_oalist_ko xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_oalist (OAlist xs) = sort_oalist_ko xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. list_of_oalist (OAlist xs) = sort_oalist_ko xs
[PROOF STEP]
obtain xs' ox where xs: "xs = (xs', ox)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>xs' ox. xs = (xs', ox) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
xs = (xs', ox)

goal (1 subgoal):
 1. list_of_oalist (OAlist xs) = sort_oalist_ko xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_oalist (OAlist xs) = sort_oalist_ko xs
[PROOF STEP]
by (simp add: xs OAlist_def Abs_oalist_inverse ko.oalist_inv_raw_sort_oalist ko.oalist_inv_alt)
[PROOF STATE]
proof (state)
this:
list_of_oalist (OAlist xs) = sort_oalist_ko xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_of_add_cong:
  "set_of (A + B) = set_of (A' + B')"
  if "set_of A = set_of A'" "set_of B = set_of B'"
  for A :: "'a::linordered_ab_group_add interval"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of (A + B) = set_of (A' + B')
[PROOF STEP]
unfolding set_of_plus that
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_of A' + set_of B' = set_of A' + set_of B'
[PROOF STEP]
..


[STATEMENT]
lemma Diagonalize_Tensor_Tensor:
    assumes "Arr t" and "Arr u" and "Arr v"
    shows "\<^bold>\<lfloor>(t \<^bold>\<otimes> u) \<^bold>\<otimes> v\<^bold>\<rfloor> = \<^bold>\<lfloor>\<^bold>\<lfloor>t\<^bold>\<rfloor> \<^bold>\<otimes> (\<^bold>\<lfloor>u\<^bold>\<rfloor> \<^bold>\<otimes> \<^bold>\<lfloor>v\<^bold>\<rfloor>)\<^bold>\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>\<lfloor>(t \<^bold>\<otimes> u) \<^bold>\<otimes> v\<^bold>\<rfloor> = \<^bold>\<lfloor>\<^bold>\<lfloor>t\<^bold>\<rfloor> \<^bold>\<otimes> \<^bold>\<lfloor>u\<^bold>\<rfloor> \<^bold>\<otimes> \<^bold>\<lfloor>v\<^bold>\<rfloor>\<^bold>\<rfloor>
[PROOF STEP]
using assms Diag_Diagonalize Diagonalize_Diagonalize
[PROOF STATE]
proof (prove)
using this:
Arr t
Arr u
Arr v
Arr ?t \<Longrightarrow> Diag \<^bold>\<lfloor>?t\<^bold>\<rfloor>
Arr ?t \<Longrightarrow> Dom \<^bold>\<lfloor>?t\<^bold>\<rfloor> = \<^bold>\<lfloor>Dom ?t\<^bold>\<rfloor>
Arr ?t \<Longrightarrow> Cod \<^bold>\<lfloor>?t\<^bold>\<rfloor> = \<^bold>\<lfloor>Cod ?t\<^bold>\<rfloor>
Arr ?t \<Longrightarrow> \<^bold>\<lfloor>\<^bold>\<lfloor>?t\<^bold>\<rfloor>\<^bold>\<rfloor> = \<^bold>\<lfloor>?t\<^bold>\<rfloor>

goal (1 subgoal):
 1. \<^bold>\<lfloor>(t \<^bold>\<otimes> u) \<^bold>\<otimes> v\<^bold>\<rfloor> = \<^bold>\<lfloor>\<^bold>\<lfloor>t\<^bold>\<rfloor> \<^bold>\<otimes> \<^bold>\<lfloor>u\<^bold>\<rfloor> \<^bold>\<otimes> \<^bold>\<lfloor>v\<^bold>\<rfloor>\<^bold>\<rfloor>
[PROOF STEP]
by (simp add: TensorDiag_assoc)


[STATEMENT]
lemma encrypt_decrypt_correct:
  "\<lbrakk> length key = len; length plain = len \<rbrakk>
  \<Longrightarrow> encrypt key plain \<bind> (\<lambda>cipher. return_spmf (decrypt key cipher)) = return_spmf (Some plain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length key = len; length plain = len\<rbrakk> \<Longrightarrow> encrypt key plain \<bind> (\<lambda>cipher. return_spmf (decrypt key cipher)) = return_spmf (Some plain)
[PROOF STEP]
by(simp add: encrypt_def zip_map2 o_def split_def bind_eq_return_spmf length_f in_nlists_UNIV xor_list_left_commute)


[STATEMENT]
lemma fun_merge_part: assumes
      part: "is_partition as"
  and i: "i < length as"
  and a: "a \<in> as ! i"
  shows "fun_merge fs as a = (fs ! i) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_merge fs as a = (fs ! i) a
[PROOF STEP]
proof(rule fun_merge[OF i a])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j a. \<lbrakk>i < length as; j < length as; a \<in> as ! i; a \<in> as ! j\<rbrakk> \<Longrightarrow> (fs ! i) a = (fs ! j) a
[PROOF STEP]
fix i j a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j a. \<lbrakk>i < length as; j < length as; a \<in> as ! i; a \<in> as ! j\<rbrakk> \<Longrightarrow> (fs ! i) a = (fs ! j) a
[PROOF STEP]
assume "i < length as" and "j < length as" and "a \<in> as ! i" and "a \<in> as ! j"
[PROOF STATE]
proof (state)
this:
i < length as
j < length as
a \<in> as ! i
a \<in> as ! j

goal (1 subgoal):
 1. \<And>i j a. \<lbrakk>i < length as; j < length as; a \<in> as ! i; a \<in> as ! j\<rbrakk> \<Longrightarrow> (fs ! i) a = (fs ! j) a
[PROOF STEP]
hence "i = j"
[PROOF STATE]
proof (prove)
using this:
i < length as
j < length as
a \<in> as ! i
a \<in> as ! j

goal (1 subgoal):
 1. i = j
[PROOF STEP]
using part[unfolded is_partition_alt is_partition_alt_def]
[PROOF STATE]
proof (prove)
using this:
i < length as
j < length as
a \<in> as ! i
a \<in> as ! j
\<forall>i j. i < length as \<and> j < length as \<and> i \<noteq> j \<longrightarrow> as ! i \<inter> as ! j = {}

goal (1 subgoal):
 1. i = j
[PROOF STEP]
by (cases "i = j", auto)
[PROOF STATE]
proof (state)
this:
i = j

goal (1 subgoal):
 1. \<And>i j a. \<lbrakk>i < length as; j < length as; a \<in> as ! i; a \<in> as ! j\<rbrakk> \<Longrightarrow> (fs ! i) a = (fs ! j) a
[PROOF STEP]
thus "(fs ! i) a = (fs ! j) a"
[PROOF STATE]
proof (prove)
using this:
i = j

goal (1 subgoal):
 1. (fs ! i) a = (fs ! j) a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(fs ! i) a = (fs ! j) a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inext_less_mono_infin_fin: "
  \<lbrakk> a < b; a \<in> I; b \<in> I; b \<noteq> Max I \<or> infinite I \<rbrakk> \<Longrightarrow> inext a I < inext b I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a \<in> I; b \<in> I; b \<noteq> Max I \<or> infinite I\<rbrakk> \<Longrightarrow> inext a I < inext b I
[PROOF STEP]
by (blast intro: inext_less_mono_infin inext_less_mono_fin)


[STATEMENT]
lemma f_Exec_Stream_nth_gr0_calc: "
  \<lbrakk> n < length xs; 0 < n \<rbrakk> \<Longrightarrow>
  f_Exec_Comp_Stream trans_fun xs c ! n =
  trans_fun (xs ! n) (f_Exec_Comp_Stream trans_fun xs c ! (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < length xs; 0 < n\<rbrakk> \<Longrightarrow> f_Exec_Comp_Stream trans_fun xs c ! n = trans_fun (xs ! n) (f_Exec_Comp_Stream trans_fun xs c ! (n - 1))
[PROOF STEP]
by (simp add: f_Exec_Stream_nth take_Suc_conv_app_nth f_Exec_append)


[STATEMENT]
lemma pos_wtn_meas_ge:
  assumes "E \<in> sets M"
    and "\<bar>\<mu> E\<bar> < \<infinity>"
    and "C\<in> sets M"
    and "\<And>n. C\<subseteq> pos_wtn E n"
    and "\<And>n. 0 < num_wtn E n"
  shows "\<exists>N. \<forall>n\<ge> N. - 1/ (num_wtn E n - 1) \<le> \<mu> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
have "\<exists>N. \<forall>n\<ge> N. 1/(num_wtn E n) < 1/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2
[PROOF STEP]
using num_wtn_conv[of E]
      conv_0_half[of "\<lambda>n. 1 / real (num_wtn E n)"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>E \<in> sets M; \<bar>\<mu> E\<bar> < \<infinity>\<rbrakk> \<Longrightarrow> (\<lambda>n. 1 / real (num_wtn E n)) \<longlonglongrightarrow> 0
\<lbrakk>(\<lambda>n. 1 / real (num_wtn E n)) \<longlonglongrightarrow> 0; \<And>n. 0 \<le> 1 / real (num_wtn E n)\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2
E \<in> sets M
\<bar>\<mu> E\<bar> < \<infinity>
C \<in> sets M
C \<subseteq> pos_wtn E ?n
0 < num_wtn E ?n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2
[PROOF STEP]
obtain N where "\<forall>n\<ge> N. 1/(num_wtn E n) < 1/2"
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. (\<And>N. \<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
assume "N \<le> n"
[PROOF STATE]
proof (state)
this:
N \<le> n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
hence "1/(num_wtn E n) < 1/2"
[PROOF STATE]
proof (prove)
using this:
N \<le> n

goal (1 subgoal):
 1. 1 / real (num_wtn E n) < 1 / 2
[PROOF STEP]
using \<open>\<forall>n\<ge> N. 1/(num_wtn E n) < 1/2\<close>
[PROOF STATE]
proof (prove)
using this:
N \<le> n
\<forall>n\<ge>N. 1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. 1 / real (num_wtn E n) < 1 / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
have "1/(1/2) < 1/(1/(num_wtn E n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (1 / 2) < 1 / (1 / real (num_wtn E n))
[PROOF STEP]
proof (rule frac_less2, auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < num_wtn E n
 2. 2 / real (num_wtn E n) < 1
[PROOF STEP]
show "2 / real (num_wtn E n) < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 / real (num_wtn E n) < 1
[PROOF STEP]
using \<open>1/(num_wtn E n) < 1/2\<close>
[PROOF STATE]
proof (prove)
using this:
1 / real (num_wtn E n) < 1 / 2

goal (1 subgoal):
 1. 2 / real (num_wtn E n) < 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
2 / real (num_wtn E n) < 1

goal (1 subgoal):
 1. 0 < num_wtn E n
[PROOF STEP]
show "0 < num_wtn E n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < num_wtn E n
[PROOF STEP]
unfolding num_wtn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inf_neg (pos_wtn E n)
[PROOF STEP]
using inf_neg_ge_1 assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> sets M; \<not> pos_meas_set ?A\<rbrakk> \<Longrightarrow> 1 \<le> inf_neg ?A
E \<in> sets M
\<bar>\<mu> E\<bar> < \<infinity>
C \<in> sets M
C \<subseteq> pos_wtn E ?n
0 < num_wtn E ?n

goal (1 subgoal):
 1. 0 < inf_neg (pos_wtn E n)
[PROOF STEP]
by (simp add: num_wtn_def)
[PROOF STATE]
proof (state)
this:
0 < num_wtn E n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
1 / (1 / 2) < 1 / (1 / real (num_wtn E n))

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
hence "2 < (num_wtn E n)"
[PROOF STATE]
proof (prove)
using this:
1 / (1 / 2) < 1 / (1 / real (num_wtn E n))

goal (1 subgoal):
 1. 2 < num_wtn E n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 < num_wtn E n

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
hence "Suc 0 < num_wtn E n - 1"
[PROOF STATE]
proof (prove)
using this:
2 < num_wtn E n

goal (1 subgoal):
 1. Suc 0 < num_wtn E n - 1
[PROOF STEP]
unfolding num_wtn_def
[PROOF STATE]
proof (prove)
using this:
2 < inf_neg (pos_wtn E n)

goal (1 subgoal):
 1. Suc 0 < inf_neg (pos_wtn E n) - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc 0 < num_wtn E n - 1

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
hence "- 1/ (num_wtn E n - 1) \<le> \<mu> C"
[PROOF STATE]
proof (prove)
using this:
Suc 0 < num_wtn E n - 1

goal (1 subgoal):
 1. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
using assms prec_inf_neg_pos
[PROOF STATE]
proof (prove)
using this:
Suc 0 < num_wtn E n - 1
E \<in> sets M
\<bar>\<mu> E\<bar> < \<infinity>
C \<in> sets M
C \<subseteq> pos_wtn E ?n
0 < num_wtn E ?n
\<lbrakk>0 < inf_neg ?E - 1; ?B \<in> sets M; ?B \<subseteq> ?E\<rbrakk> \<Longrightarrow> ereal (- 1 / real (inf_neg ?E - 1)) \<le> \<mu> ?B

goal (1 subgoal):
 1. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
unfolding num_wtn_def
[PROOF STATE]
proof (prove)
using this:
Suc 0 < inf_neg (pos_wtn E n) - 1
E \<in> sets M
\<bar>\<mu> E\<bar> < \<infinity>
C \<in> sets M
C \<subseteq> pos_wtn E ?n
0 < inf_neg (pos_wtn E ?n)
\<lbrakk>0 < inf_neg ?E - 1; ?B \<in> sets M; ?B \<subseteq> ?E\<rbrakk> \<Longrightarrow> ereal (- 1 / real (inf_neg ?E - 1)) \<le> \<mu> ?B

goal (1 subgoal):
 1. ereal (- 1 / real (inf_neg (pos_wtn E n) - 1)) \<le> \<mu> C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
N \<le> ?n2 \<Longrightarrow> ereal (- 1 / real (num_wtn E ?n2 - 1)) \<le> \<mu> C

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n2 \<Longrightarrow> ereal (- 1 / real (num_wtn E ?n2 - 1)) \<le> \<mu> C

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. ereal (- 1 / real (num_wtn E n - 1)) \<le> \<mu> C

goal:
No subgoals!
[PROOF STEP]
qed


[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 signed_real_of_word_sum_less_neg_numeral_iff:
  \<open>signed_real_of_word v + signed_real_of_word w < - numeral n
    \<longleftrightarrow> sint v + sint w < - 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 < - numeral n) = (sint v + sint w < - numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w < - numeral n) = (sint v + sint w < - numeral n)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (sint v + sint w) < real_of_int (- numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sint v + sint w < - numeral n) = (real_of_int (sint v + sint w) < real_of_int (- numeral n))
[PROOF STEP]
by (simp only: of_int_less_iff)
[PROOF STATE]
proof (state)
this:
(sint v + sint w < - numeral n) = (real_of_int (sint v + sint w) < real_of_int (- numeral n))

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

goal (1 subgoal):
 1. (signed_real_of_word v + signed_real_of_word w < - numeral n) = (sint v + sint w < - 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) < real_of_int (- numeral n)) = (signed_real_of_word v + signed_real_of_word w < - numeral n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (sint v + sint w) < real_of_int (- numeral n)) = (signed_real_of_word v + signed_real_of_word w < - numeral n)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_matrix_vector_multl:
  assumes "matrix_continuous_on T A"
  shows "continuous_on T (\<lambda>t. A t *v s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on T (\<lambda>t. A t *v s)
[PROOF STEP]
proof(rule continuous_onI, simp add: dist_norm)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
fix e t::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
assume "0 < e" and "t \<in> T"
[PROOF STATE]
proof (state)
this:
0 < e
t \<in> T

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
let ?\<epsilon> = "e/(\<parallel>(if s = 0 then 1 else s)\<parallel>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
have "?\<epsilon> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < e / \<parallel>if s = 0 then 1 else s\<parallel>
[PROOF STEP]
using \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < e / \<parallel>if s = 0 then 1 else s\<parallel>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < e / \<parallel>if s = 0 then 1 else s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e / \<parallel>if s = 0 then 1 else s\<parallel>
[PROOF STEP]
obtain \<delta> where dHyp: "\<delta> > 0 \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> ?\<epsilon>)"
[PROOF STATE]
proof (prove)
using this:
0 < e / \<parallel>if s = 0 then 1 else s\<parallel>

goal (1 subgoal):
 1. (\<And>\<delta>. 0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms \<open>t \<in> T\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e / \<parallel>if s = 0 then 1 else s\<parallel>
matrix_continuous_on T A
t \<in> T

goal (1 subgoal):
 1. (\<And>\<delta>. 0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dist_norm matrix_continuous_on_def
[PROOF STATE]
proof (prove)
using this:
0 < e / \<parallel>if s = 0 then 1 else s\<parallel>
\<forall>t\<in>T. \<forall>\<epsilon>>0. \<exists>\<delta>>0. \<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> \<epsilon>
t \<in> T

goal (1 subgoal):
 1. (\<And>\<delta>. 0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>)

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>)

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
fix \<tau>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
assume "\<tau> \<in> T" and "\<bar>\<tau> - t\<bar> < \<delta>"
[PROOF STATE]
proof (state)
this:
\<tau> \<in> T
\<bar>\<tau> - t\<bar> < \<delta>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
have obs: "?\<epsilon> * (\<parallel>s\<parallel>) = (if s = 0 then 0 else e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel> = (if s = 0 then 0 else e)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel> = (if s = 0 then 0 else e)

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
have "\<parallel>A \<tau> *v s - A t *v s\<parallel> = \<parallel>(A \<tau> - A t) *v s\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A \<tau> *v s - A t *v s\<parallel> = \<parallel>(A \<tau> - A t) *v s\<parallel>
[PROOF STEP]
by (simp add: matrix_vector_mult_diff_rdistrib)
[PROOF STATE]
proof (state)
this:
\<parallel>A \<tau> *v s - A t *v s\<parallel> = \<parallel>(A \<tau> - A t) *v s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>A \<tau> *v s - A t *v s\<parallel> = \<parallel>(A \<tau> - A t) *v s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
have "... \<le> (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * (\<parallel>s\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>(A \<tau> - A t) *v s\<parallel> \<le> (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel>
[PROOF STEP]
using norm_matrix_le_mult_op_norm
[PROOF STATE]
proof (prove)
using this:
\<parallel>?A *v ?x\<parallel> \<le> (\<parallel>?A\<parallel>\<^sub>o\<^sub>p) * \<parallel>?x\<parallel>

goal (1 subgoal):
 1. \<parallel>(A \<tau> - A t) *v s\<parallel> \<le> (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>(A \<tau> - A t) *v s\<parallel> \<le> (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>(A \<tau> - A t) *v s\<parallel> \<le> (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
have "... \<le> ?\<epsilon> * (\<parallel>s\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel> \<le> e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel>
[PROOF STEP]
using dHyp \<open>\<tau> \<in> T\<close> \<open>\<bar>\<tau> - t\<bar> < \<delta>\<close> mult_right_mono norm_ge_zero
[PROOF STATE]
proof (prove)
using this:
0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>)
\<tau> \<in> T
\<bar>\<tau> - t\<bar> < \<delta>
\<lbrakk>?a \<le> ?b; (0::?'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?b * ?c
0 \<le> \<parallel>?x\<parallel>

goal (1 subgoal):
 1. (\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel> \<le> e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>s\<parallel> \<le> e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel>

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel>
[PROOF STEP]
have "\<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e"
[PROOF STATE]
proof (prove)
using this:
\<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e / \<parallel>if s = 0 then 1 else s\<parallel> * \<parallel>s\<parallel>

goal (1 subgoal):
 1. \<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e
[PROOF STEP]
by (subst (asm) obs) (metis (mono_tags) \<open>0 < e\<close> less_eq_real_def order_trans)
[PROOF STATE]
proof (state)
this:
\<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?\<tau>2 \<in> T; \<bar>?\<tau>2 - t\<bar> < \<delta>\<rbrakk> \<Longrightarrow> \<parallel>A ?\<tau>2 *v s - A t *v s\<parallel> \<le> e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>0 < e; x \<in> T\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. \<bar>x' - x\<bar> < d \<longrightarrow> \<parallel>A x' *v s - A x *v s\<parallel> \<le> e
[PROOF STEP]
thus "\<exists>d>0. \<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < d \<longrightarrow> \<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<tau>2 \<in> T; \<bar>?\<tau>2 - t\<bar> < \<delta>\<rbrakk> \<Longrightarrow> \<parallel>A ?\<tau>2 *v s - A t *v s\<parallel> \<le> e

goal (1 subgoal):
 1. \<exists>d>0. \<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < d \<longrightarrow> \<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e
[PROOF STEP]
using dHyp
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?\<tau>2 \<in> T; \<bar>?\<tau>2 - t\<bar> < \<delta>\<rbrakk> \<Longrightarrow> \<parallel>A ?\<tau>2 *v s - A t *v s\<parallel> \<le> e
0 < \<delta> \<and> (\<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < \<delta> \<longrightarrow> \<parallel>A \<tau> - A t\<parallel>\<^sub>o\<^sub>p \<le> e / \<parallel>if s = 0 then 1 else s\<parallel>)

goal (1 subgoal):
 1. \<exists>d>0. \<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < d \<longrightarrow> \<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>\<tau>\<in>T. \<bar>\<tau> - t\<bar> < d \<longrightarrow> \<parallel>A \<tau> *v s - A t *v s\<parallel> \<le> e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_lt_1_iff_in_hyp2:
  shows "norm v < 1 \<longleftrightarrow> proj2_pt v \<in> hyp2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
let ?v' = "vector2_append1 v"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
have "?v' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector2_append1 v \<noteq> 0
[PROOF STEP]
by (rule vector2_append1_non_zero)
[PROOF STATE]
proof (state)
this:
vector2_append1 v \<noteq> 0

goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
from real_less_rsqrt [of "norm v" 1]
    and abs_square_less_1 [of "norm v"]
[PROOF STATE]
proof (chain)
picking this:
(norm v)\<^sup>2 < 1 \<Longrightarrow> norm v < sqrt 1
((norm v)\<^sup>2 < 1) = (\<bar>norm v\<bar> < 1)
[PROOF STEP]
have "norm v < 1 \<longleftrightarrow> (norm v)\<^sup>2 < 1"
[PROOF STATE]
proof (prove)
using this:
(norm v)\<^sup>2 < 1 \<Longrightarrow> norm v < sqrt 1
((norm v)\<^sup>2 < 1) = (\<bar>norm v\<bar> < 1)

goal (1 subgoal):
 1. (norm v < 1) = ((norm v)\<^sup>2 < 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(norm v < 1) = ((norm v)\<^sup>2 < 1)

goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
hence "norm v < 1 \<longleftrightarrow> ?v' \<bullet> (M *v ?v') < 0"
[PROOF STATE]
proof (prove)
using this:
(norm v < 1) = ((norm v)\<^sup>2 < 1)

goal (1 subgoal):
 1. (norm v < 1) = (vector2_append1 v \<bullet> (M *v vector2_append1 v) < 0)
[PROOF STEP]
by (simp add: norm_M)
[PROOF STATE]
proof (state)
this:
(norm v < 1) = (vector2_append1 v \<bullet> (M *v vector2_append1 v) < 0)

goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
with \<open>?v' \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
vector2_append1 v \<noteq> 0
(norm v < 1) = (vector2_append1 v \<bullet> (M *v vector2_append1 v) < 0)
[PROOF STEP]
have "norm v < 1 \<longleftrightarrow> proj2_abs ?v' \<in> K2"
[PROOF STATE]
proof (prove)
using this:
vector2_append1 v \<noteq> 0
(norm v < 1) = (vector2_append1 v \<bullet> (M *v vector2_append1 v) < 0)

goal (1 subgoal):
 1. (norm v < 1) = (proj2_abs (vector2_append1 v) \<in> hyp2)
[PROOF STEP]
by (subst K2_abs)
[PROOF STATE]
proof (state)
this:
(norm v < 1) = (proj2_abs (vector2_append1 v) \<in> hyp2)

goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
thus "norm v < 1 \<longleftrightarrow> proj2_pt v \<in> hyp2"
[PROOF STATE]
proof (prove)
using this:
(norm v < 1) = (proj2_abs (vector2_append1 v) \<in> hyp2)

goal (1 subgoal):
 1. (norm v < 1) = (proj2_pt v \<in> hyp2)
[PROOF STEP]
by (unfold proj2_pt_def)
[PROOF STATE]
proof (state)
this:
(norm v < 1) = (proj2_pt v \<in> hyp2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stationary_distribution_iterate:
  assumes N: "stationary_distribution N"
  shows "ennreal (pmf N y) = (\<integral>\<^sup>+x. p x y n \<partial>N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N
[PROOF STEP]
proof (induct n arbitrary: y)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y 0) \<partial>measure_pmf N
 2. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
have [simp]: "\<And>x y. ennreal (if x = y then 1 else 0) = indicator {y} x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. ennreal (if x = y then 1 else 0) = indicator {y} x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ennreal (if ?x4 = ?y4 then 1 else 0) = indicator {?y4} ?x4

goal (2 subgoals):
 1. \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y 0) \<partial>measure_pmf N
 2. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y 0) \<partial>measure_pmf N
 2. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y 0) \<partial>measure_pmf N
[PROOF STEP]
by (simp add: p_0 pmf.rep_eq measure_pmf.emeasure_eq_measure)
[PROOF STATE]
proof (state)
this:
ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y 0) \<partial>measure_pmf N

goal (1 subgoal):
 1. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
ennreal (pmf N ?y4) = \<integral>\<^sup>+ x. ennreal (p x ?y4 n) \<partial>measure_pmf N

goal (1 subgoal):
 1. \<And>n y. (\<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N) \<Longrightarrow> ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
with N
[PROOF STATE]
proof (chain)
picking this:
stationary_distribution N
ennreal (pmf N ?y4) = \<integral>\<^sup>+ x. ennreal (p x ?y4 n) \<partial>measure_pmf N
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
stationary_distribution N
ennreal (pmf N ?y4) = \<integral>\<^sup>+ x. ennreal (p x ?y4 n) \<partial>measure_pmf N

goal (1 subgoal):
 1. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N
[PROOF STEP]
apply (simp add: nn_integral_eq_integral[symmetric] p_le_1 p_Suc'
                     measure_pmf.integrable_const_bound[where B=1])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>stationary_distribution N; \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N = \<integral>\<^sup>+ x. \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf (K x) \<partial>measure_pmf N
[PROOF STEP]
apply (subst nn_integral_bind[symmetric, where B="count_space UNIV"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>stationary_distribution N; \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N\<rbrakk> \<Longrightarrow> (\<lambda>x. ennreal (p x y n)) \<in> borel_measurable (count_space UNIV)
 2. \<lbrakk>stationary_distribution N; \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N\<rbrakk> \<Longrightarrow> measure_pmf.random_variable N (subprob_algebra (count_space UNIV)) (\<lambda>x. measure_pmf (K x))
 3. \<lbrakk>stationary_distribution N; \<And>y. ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N = \<integral>\<^sup>+ x. ennreal (p x y n) \<partial>measure_pmf N \<bind> (\<lambda>x. measure_pmf (K x))
[PROOF STEP]
apply (auto simp: stationary_distribution_def measure_pmf_bind[symmetric]
                simp del: measurable_pmf_measure1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ennreal (pmf N y) = \<integral>\<^sup>+ x. ennreal (p x y (Suc n)) \<partial>measure_pmf N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fv_App[simp]: "fv (App e x) = insert x (fv e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv (App e x) = insert x (fv e)
[PROOF STEP]
unfolding fv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v. atom v \<in> supp (App e x)} = insert x {v. atom v \<in> supp e}
[PROOF STEP]
by (auto simp add: exp_assn.supp supp_at_base)


[STATEMENT]
lemma continuous_map_componentwise_Euclidean_space:
  "continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) \<longleftrightarrow>
   (\<forall>i < n. continuous_map X euclideanreal (\<lambda>x. f x i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))
[PROOF STEP]
have *: "continuous_map X euclideanreal (\<lambda>x. if k < n then f x k else 0)"
    if "\<And>i. i<n \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x i)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X euclideanreal (\<lambda>x. if k < n then f x k else 0)
[PROOF STEP]
by (intro continuous_intros that)
[PROOF STATE]
proof (state)
this:
(\<And>i. i < n \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x i)) \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. if ?k < n then f x ?k else 0)

goal (1 subgoal):
 1. continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))
[PROOF STEP]
unfolding Euclidean_space_def continuous_map_in_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (continuous_map X (powertop_real UNIV) (\<lambda>x i. if i < n then f x i else 0) \<and> (\<lambda>x i. if i < n then f x i else 0) ` topspace X \<subseteq> {x. \<forall>i\<ge>n. x i = 0}) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))
[PROOF STEP]
by (fastforce simp: continuous_map_componentwise_UNIV * elim: continuous_map_eq)
[PROOF STATE]
proof (state)
this:
continuous_map X (Euclidean_space n) (\<lambda>x i. if i < n then f x i else 0) = (\<forall>i<n. continuous_map X euclideanreal (\<lambda>x. f x i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_root_set_subseteq:
  assumes "(\<Prod>(a::'a::field)\<leftarrow>L. [:- a, 1:]) = (\<Prod>a\<leftarrow>M. [:- a, 1:])"
  shows "set L \<subseteq> set M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set L \<subseteq> set M
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set L \<Longrightarrow> x \<in> set M
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set L \<Longrightarrow> x \<in> set M
[PROOF STEP]
assume "x\<in> set L"
[PROOF STATE]
proof (state)
this:
x \<in> set L

goal (1 subgoal):
 1. \<And>x. x \<in> set L \<Longrightarrow> x \<in> set M
[PROOF STEP]
hence "poly (\<Prod>(a::'a::field)\<leftarrow>L. [:- a, 1:]) x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> set L

goal (1 subgoal):
 1. poly (\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) x = (0::'a)
[PROOF STEP]
using linear_poly_root[of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> set L
x \<in> set ?as \<Longrightarrow> poly (\<Prod>a\<leftarrow>?as. [:- a, 1::'a:]) x = (0::'a)

goal (1 subgoal):
 1. poly (\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) x = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) x = (0::'a)

goal (1 subgoal):
 1. \<And>x. x \<in> set L \<Longrightarrow> x \<in> set M
[PROOF STEP]
hence "poly (\<Prod>(a::'a::field)\<leftarrow>M. [:- a, 1:]) x = 0"
[PROOF STATE]
proof (prove)
using this:
poly (\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) x = (0::'a)

goal (1 subgoal):
 1. poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) x = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly (\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) x = (0::'a)
(\<Prod>a\<leftarrow>L. [:- a, 1::'a:]) = (\<Prod>a\<leftarrow>M. [:- a, 1::'a:])

goal (1 subgoal):
 1. poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) x = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) x = (0::'a)

goal (1 subgoal):
 1. \<And>x. x \<in> set L \<Longrightarrow> x \<in> set M
[PROOF STEP]
thus "x\<in> set M"
[PROOF STATE]
proof (prove)
using this:
poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) x = (0::'a)

goal (1 subgoal):
 1. x \<in> set M
[PROOF STEP]
using root_poly_linear[of M]
[PROOF STATE]
proof (prove)
using this:
poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) x = (0::'a)
poly (\<Prod>a\<leftarrow>M. [:- a, 1::'a:]) ?c = (0::'a) \<Longrightarrow> ?c \<in> set M

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bitwise_add_take:
  shows "take n (bitwise_add x c) = bitwise_add (take n x) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n (bitwise_add x c) = bitwise_add (take n x) c
[PROOF STEP]
unfolding bitwise_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n (foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) x (\<lambda>_. []) c) = foldr (\<lambda>(x, y) res car. xor3 x y car # res (carry x y car)) (take n x) (\<lambda>_. []) c
[PROOF STEP]
by (induct n arbitrary: x c,auto)
     (metis append_take_drop_id bitwise_add_def bitwise_add_take_append diff_is_0_eq' length_foldr_bitwise_add length_take nat_le_linear rev_min_pm1 take_all)


[STATEMENT]
lemma sumset_iterated_r: "r > 0 \<Longrightarrow> sumset_iterated A r = sumset A (sumset_iterated A (r-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r \<Longrightarrow> sumset_iterated A r = sumset A (sumset_iterated A (r - 1))
[PROOF STEP]
using gr0_conv_Suc
[PROOF STATE]
proof (prove)
using this:
(0 < ?n) = (\<exists>m. ?n = Suc m)

goal (1 subgoal):
 1. 0 < r \<Longrightarrow> sumset_iterated A r = sumset A (sumset_iterated A (r - 1))
[PROOF STEP]
by force


[STATEMENT]
lemma (in infinite_coin_toss_space) nat_filtration_null_set:
  assumes "A\<in> sets (nat_filtration n)"
and "0 < p"
and "p  < 1"
and "emeasure M A = 0"
shows "A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = {}
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
assume "A\<noteq> {}"
[PROOF STATE]
proof (state)
this:
A \<noteq> {}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
hence "\<exists>w. w\<in> A"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}

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

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>w. w \<in> A
[PROOF STEP]
obtain w where "w \<in> A"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. w \<in> A

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

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
hence inc: "pseudo_proj_True n -` {pseudo_proj_True n w} \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
w \<in> A

goal (1 subgoal):
 1. pseudo_proj_True n -` {pseudo_proj_True n w} \<subseteq> A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w \<in> A
A \<in> sets (nat_filtration n)
0 < p
p < 1
emeasure M A = 0

goal (1 subgoal):
 1. pseudo_proj_True n -` {pseudo_proj_True n w} \<subseteq> A
[PROOF STEP]
by (simp add: set_filt_contain)
[PROOF STATE]
proof (state)
this:
pseudo_proj_True n -` {pseudo_proj_True n w} \<subseteq> A

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
have "0 < emeasure M {x\<in> space M. (stake n x = stake n (pseudo_proj_True n w))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (nat_filtration n)
0 < p
p < 1
emeasure M A = 0

goal (1 subgoal):
 1. 0 < emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)}
[PROOF STEP]
by (simp add: bernoulli_stream_pref_prob_pos)
[PROOF STATE]
proof (state)
this:
0 < emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)}

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
have "... = emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)} = emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w})
[PROOF STEP]
using pseudo_proj_True_preimage_stake
    pseudo_proj_True_proj bernoulli bernoulli_stream_space
[PROOF STATE]
proof (prove)
using this:
?w = pseudo_proj_True ?n ?w \<Longrightarrow> pseudo_proj_True ?n -` {?w} = {x. stake ?n x = stake ?n ?w}
pseudo_proj_True ?n (pseudo_proj_True ?n ?w) = pseudo_proj_True ?n ?w
M = bernoulli_stream p
?N = bernoulli_stream ?p \<Longrightarrow> space ?N = streams UNIV

goal (1 subgoal):
 1. emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)} = emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)} = emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w})

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure M {x \<in> space M. stake n x = stake n (pseudo_proj_True n w)} = emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w})

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
have "... \<le> emeasure M A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w}) \<le> emeasure M A
[PROOF STEP]
proof (rule emeasure_mono, (simp add: inc))
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> events
[PROOF STEP]
show "A \<in> events"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> events
[PROOF STEP]
using assms nat_discrete_filtration
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (nat_filtration n)
0 < p
p < 1
emeasure M A = 0
Filtration.filtration M nat_filtration

goal (1 subgoal):
 1. A \<in> events
[PROOF STEP]
unfolding filtration_def subalgebra_def
[PROOF STATE]
proof (prove)
using this:
A \<in> sets (nat_filtration n)
0 < p
p < 1
emeasure M A = 0
(\<forall>t. space (nat_filtration t) = space M \<and> sets (nat_filtration t) \<subseteq> events) \<and> (\<forall>s t. s \<le> t \<longrightarrow> space (nat_filtration s) = space (nat_filtration t) \<and> sets (nat_filtration s) \<subseteq> sets (nat_filtration t))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
emeasure M (pseudo_proj_True n -` {pseudo_proj_True n w}) \<le> emeasure M A

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < emeasure M A
[PROOF STEP]
have "0 < emeasure M A"
[PROOF STATE]
proof (prove)
using this:
0 < emeasure M A

goal (1 subgoal):
 1. 0 < emeasure M A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < emeasure M A

goal (1 subgoal):
 1. A \<noteq> {} \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
0 < emeasure M A

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < emeasure M A
A \<in> sets (nat_filtration n)
0 < p
p < 1
emeasure M A = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unit_vecs_basis: "basis (set (unit_vecs n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis (set (unit_vecs n))
[PROOF STEP]
unfolding basis_def span_unit_vecs_is_carrier
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt (set (unit_vecs n)) \<and> carrier_vec n = carrier_vec n \<and> set (unit_vecs n) \<subseteq> carrier_vec n
[PROOF STEP]
proof (intro conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. lin_indpt (set (unit_vecs n))
 2. carrier_vec n = carrier_vec n
 3. set (unit_vecs n) \<subseteq> carrier_vec n
[PROOF STEP]
show "\<not> lin_dep (set (unit_vecs n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt (set (unit_vecs n))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
assume "lin_dep (set (unit_vecs n))"
[PROOF STATE]
proof (state)
this:
lin_dep (set (unit_vecs n))

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
from this[unfolded lin_dep_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>A a v. finite A \<and> A \<subseteq> set (unit_vecs n) \<and> True \<and> lincomb a A = 0\<^sub>v n \<and> v \<in> A \<and> a v \<noteq> (0::'a)
[PROOF STEP]
obtain A a v where
      fin: "finite A" and A: "A \<subseteq> set (unit_vecs n)"
      and lc: "lincomb a A = 0\<^sub>v n" and v: "v \<in> A" and av: "a v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>A a v. finite A \<and> A \<subseteq> set (unit_vecs n) \<and> True \<and> lincomb a A = 0\<^sub>v n \<and> v \<in> A \<and> a v \<noteq> (0::'a)

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

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
from v A
[PROOF STATE]
proof (chain)
picking this:
v \<in> A
A \<subseteq> set (unit_vecs n)
[PROOF STEP]
obtain i where i: "i < n" and vu: "v = unit_vec n i"
[PROOF STATE]
proof (prove)
using this:
v \<in> A
A \<subseteq> set (unit_vecs n)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < n; v = unit_vec n i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding unit_vecs_def
[PROOF STATE]
proof (prove)
using this:
v \<in> A
A \<subseteq> set (map (unit_vec n) [0..<n])

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < n; v = unit_vec n i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < n
v = unit_vec n i

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
define b where "b = (\<lambda> x. if x \<in> A then a x else 0)"
[PROOF STATE]
proof (state)
this:
b = (\<lambda>x. if x \<in> A then a x else (0::'a))

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have id: "A \<union> (set (unit_vecs n) - A) = set (unit_vecs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> (set (unit_vecs n) - A) = set (unit_vecs n)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> set (unit_vecs n)

goal (1 subgoal):
 1. A \<union> (set (unit_vecs n) - A) = set (unit_vecs n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> (set (unit_vecs n) - A) = set (unit_vecs n)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
from lincomb_index[OF i unit_vecs_carrier]
[PROOF STATE]
proof (chain)
picking this:
lincomb ?a (set (unit_vecs n)) $ i = (\<Sum>x\<in>set (unit_vecs n). ?a x * x $ i)
[PROOF STEP]
have "lincomb b (set (unit_vecs n)) $ i = (\<Sum>x\<in> (A \<union> (set (unit_vecs n) - A)). b x * x $ i)"
[PROOF STATE]
proof (prove)
using this:
lincomb ?a (set (unit_vecs n)) $ i = (\<Sum>x\<in>set (unit_vecs n). ?a x * x $ i)

goal (1 subgoal):
 1. lincomb b (set (unit_vecs n)) $ i = (\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i)
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
lincomb ?a (set (unit_vecs n)) $ i = (\<Sum>x\<in>set (unit_vecs n). ?a x * x $ i)

goal (1 subgoal):
 1. lincomb b (set (unit_vecs n)) $ i = (\<Sum>x\<in>set (unit_vecs n). b x * x $ i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
lincomb b (set (unit_vecs n)) $ i = (\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb b (set (unit_vecs n)) $ i = (\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in> A. b x * x $ i) + (\<Sum>x\<in> set (unit_vecs n) - A. b x * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i) = (\<Sum>x\<in>A. b x * x $ i) + (\<Sum>x\<in>set (unit_vecs n) - A. b x * x $ i)
[PROOF STEP]
by (rule sum.union_disjoint, insert fin, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i) = (\<Sum>x\<in>A. b x * x $ i) + (\<Sum>x\<in>set (unit_vecs n) - A. b x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A \<union> (set (unit_vecs n) - A). b x * x $ i) = (\<Sum>x\<in>A. b x * x $ i) + (\<Sum>x\<in>set (unit_vecs n) - A. b x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>x\<in> A. b x * x $ i) = (\<Sum>x\<in> A. a x * x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. b x * x $ i) = (\<Sum>x\<in>A. a x * x $ i)
[PROOF STEP]
by (rule sum.cong, auto simp: b_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. b x * x $ i) = (\<Sum>x\<in>A. a x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. b x * x $ i) = (\<Sum>x\<in>A. a x * x $ i)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = lincomb a A $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. a x * x $ i) = lincomb a A $ i
[PROOF STEP]
by (subst lincomb_index[OF i], insert A unit_vecs_carrier, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. a x * x $ i) = lincomb a A $ i

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. a x * x $ i) = lincomb a A $ i

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb a A $ i = (0::'a)
[PROOF STEP]
unfolding lc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v n $ i = (0::'a)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < n

goal (1 subgoal):
 1. 0\<^sub>v n $ i = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb a A $ i = (0::'a)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb a A $ i = (0::'a)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>x\<in> set (unit_vecs n) - A. b x * x $ i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set (unit_vecs n) - A. b x * x $ i) = (0::'a)
[PROOF STEP]
by (rule sum.neutral, auto simp: b_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>set (unit_vecs n) - A. b x * x $ i) = (0::'a)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb b (set (unit_vecs n)) $ i = (0::'a) + (0::'a)
[PROOF STEP]
have "lincomb b (set (unit_vecs n)) $ i = 0"
[PROOF STATE]
proof (prove)
using this:
lincomb b (set (unit_vecs n)) $ i = (0::'a) + (0::'a)

goal (1 subgoal):
 1. lincomb b (set (unit_vecs n)) $ i = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb b (set (unit_vecs n)) $ i = (0::'a)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
from lincomb_units[OF i, of b, unfolded this]
[PROOF STATE]
proof (chain)
picking this:
(0::'a) = b (unit_vec n i)
[PROOF STEP]
have "b v = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) = b (unit_vec n i)

goal (1 subgoal):
 1. b v = (0::'a)
[PROOF STEP]
unfolding vu
[PROOF STATE]
proof (prove)
using this:
(0::'a) = b (unit_vec n i)

goal (1 subgoal):
 1. b (unit_vec n i) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b v = (0::'a)

goal (1 subgoal):
 1. lin_dep (set (unit_vecs n)) \<Longrightarrow> False
[PROOF STEP]
with v av
[PROOF STATE]
proof (chain)
picking this:
v \<in> A
a v \<noteq> (0::'a)
b v = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
v \<in> A
a v \<noteq> (0::'a)
b v = (0::'a)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding b_def
[PROOF STATE]
proof (prove)
using this:
v \<in> A
a v \<noteq> (0::'a)
(if v \<in> A then a v else (0::'a)) = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lin_indpt (set (unit_vecs n))

goal (2 subgoals):
 1. carrier_vec n = carrier_vec n
 2. set (unit_vecs n) \<subseteq> carrier_vec n
[PROOF STEP]
qed (insert unit_vecs_carrier, auto)


[STATEMENT]
lemma supp_removeAll:
  fixes x::"atom"
  shows "supp (removeAll x xs) = supp xs - {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (removeAll x xs) = supp xs - {x}
[PROOF STEP]
by (induct xs)
     (auto simp: supp_Nil supp_Cons supp_atom)


[STATEMENT]
lemma permutes_orbit_subset:
  assumes "f permutes S" "x \<in> S" shows "orbit f x \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit f x \<subseteq> S
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> orbit f x \<Longrightarrow> xa \<in> S
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> orbit f x \<Longrightarrow> xa \<in> S
[PROOF STEP]
assume "y \<in> orbit f x"
[PROOF STATE]
proof (state)
this:
y \<in> orbit f x

goal (1 subgoal):
 1. \<And>xa. xa \<in> orbit f x \<Longrightarrow> xa \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> orbit f x
[PROOF STEP]
show "y \<in> S"
[PROOF STATE]
proof (prove)
using this:
y \<in> orbit f x

goal (1 subgoal):
 1. y \<in> S
[PROOF STEP]
by induct (auto simp: permutes_in_image assms)
[PROOF STATE]
proof (state)
this:
y \<in> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_finfun_default_aux:
  fixes f :: "'a \<Rightarrow> 'b"
  assumes fin: "f \<in> finfun"
  shows "finite {a. f a \<noteq> finfun_default_aux f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
proof(cases "finite (UNIV :: 'a set)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
 2. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (2 subgoals):
 1. finite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
 2. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite UNIV

goal (1 subgoal):
 1. finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
finite UNIV
f \<in> finfun

goal (1 subgoal):
 1. finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
by(auto simp add: finfun_def finfun_default_aux_def intro: finite_subset)
[PROOF STATE]
proof (state)
this:
finite {a. f a \<noteq> finfun_default_aux f}

goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite UNIV

goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
f \<in> finfun
[PROOF STEP]
obtain b where b: "finite {a. f a \<noteq> b}" (is "finite ?B")
[PROOF STATE]
proof (prove)
using this:
f \<in> finfun

goal (1 subgoal):
 1. (\<And>b. finite {a. f a \<noteq> b} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding finfun_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f. \<exists>b. finite {a. f a \<noteq> b}}

goal (1 subgoal):
 1. (\<And>b. finite {a. f a \<noteq> b} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite {a. f a \<noteq> b}

goal (1 subgoal):
 1. infinite UNIV \<Longrightarrow> finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
infinite UNIV
finite {a. f a \<noteq> b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite UNIV
finite {a. f a \<noteq> b}

goal (1 subgoal):
 1. finite {a. f a \<noteq> finfun_default_aux f}
[PROOF STEP]
by(simp add: finfun_default_aux_infinite)
[PROOF STATE]
proof (state)
this:
finite {a. f a \<noteq> finfun_default_aux f}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_nn_integral_mono:
  assumes "\<And>x. x \<in> space M \<inter> A \<Longrightarrow> f x \<le> g x"
  shows   "set_nn_integral M A f \<le> set_nn_integral M A g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M A f \<le> set_nn_integral M A g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> space M \<inter> A \<Longrightarrow> f ?x \<le> g ?x

goal (1 subgoal):
 1. set_nn_integral M A f \<le> set_nn_integral M A g
[PROOF STEP]
by (intro nn_integral_mono) (auto simp: indicator_def)


[STATEMENT]
lemma chop_replicate_dvd [simp]:
  assumes "d dvd n"
  shows   "chop d (replicate n x) = replicate (n div d) (replicate d x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
proof (cases "d = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d = 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
 2. d \<noteq> 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
d \<noteq> 0

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
 2. d \<noteq> 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
d dvd n
[PROOF STEP]
obtain k where k: "n = d * k"
[PROOF STATE]
proof (prove)
using this:
d dvd n

goal (1 subgoal):
 1. (\<And>k. n = d * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n = d * k

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
 2. d \<noteq> 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
have "chop d (replicate (d * k) x) = replicate k (replicate d x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chop d (replicate (d * k) x) = replicate k (replicate d x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
d \<noteq> 0

goal (1 subgoal):
 1. chop d (replicate (d * k) x) = replicate k (replicate d x)
[PROOF STEP]
by (induction k) (auto simp: replicate_add chop_append)
[PROOF STATE]
proof (state)
this:
chop d (replicate (d * k) x) = replicate k (replicate d x)

goal (2 subgoals):
 1. d = 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
 2. d \<noteq> 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
chop d (replicate (d * k) x) = replicate k (replicate d x)

goal (1 subgoal):
 1. chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
chop d (replicate (d * k) x) = replicate k (replicate d x)
d \<noteq> 0

goal (1 subgoal):
 1. chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
by (simp add: k)
[PROOF STATE]
proof (state)
this:
chop d (replicate n x) = replicate (n div d) (replicate d x)

goal (1 subgoal):
 1. d = 0 \<Longrightarrow> chop d (replicate n x) = replicate (n div d) (replicate d x)
[PROOF STEP]
qed auto


[STATEMENT]
lemma matrix_right_invertible_span_columns:
  "(\<exists>(B::'a::field ^'n^'m). (A::'a ^'m^'n) ** B = mat 1) \<longleftrightarrow>
    vec.span (columns A) = UNIV" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
let ?U = "UNIV :: 'm set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
have fU: "finite ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
have lhseq: "?lhs \<longleftrightarrow> (\<forall>y. \<exists>(x::'a^'m). sum (\<lambda>i. (x$i) *s column i A) ?U = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (\<forall>y. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y)
[PROOF STEP]
unfolding matrix_right_invertible_surjective matrix_mult_sum surj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. \<exists>x. y = (\<Sum>i\<in>UNIV. x $ i *s column i A)) = (\<forall>y. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y)
[PROOF STEP]
by (simp add: eq_commute)
[PROOF STATE]
proof (state)
this:
(\<exists>B. A ** B = mat (1::'a)) = (\<forall>y. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
have rhseq: "?rhs \<longleftrightarrow> (\<forall>x. x \<in> vec.span (columns A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec.span (columns A) = UNIV) = (\<forall>x. x \<in> vec.span (columns A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(vec.span (columns A) = UNIV) = (\<forall>x. x \<in> vec.span (columns A))

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(vec.span (columns A) = UNIV) = (\<forall>x. x \<in> vec.span (columns A))

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
assume h: ?lhs
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
fix x:: "'a ^'n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
from h[unfolded lhseq, rule_format, of x]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = x
[PROOF STEP]
obtain y :: "'a ^'m"
        where y: "sum (\<lambda>i. (y$i) *s column i A) ?U = x"
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = x

goal (1 subgoal):
 1. (\<And>y. (\<Sum>i\<in>UNIV. y $ i *s column i A) = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. y $ i *s column i A) = x

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
have "x \<in> vec.span (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> vec.span (columns A)
[PROOF STEP]
unfolding y[symmetric] scalar_mult_eq_scaleR
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. y $ i *s column i A) \<in> vec.span (columns A)
[PROOF STEP]
proof (rule vec.span_sum [OF vec.span_scale])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> column i A \<in> vec.span (columns A)
[PROOF STEP]
show "column i A \<in> vec.span (columns A)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column i A \<in> vec.span (columns A)
[PROOF STEP]
using columns_def vec.span_superset
[PROOF STATE]
proof (prove)
using this:
columns ?A = {column i ?A |i. i \<in> UNIV}
?S \<subseteq> vec.span ?S

goal (1 subgoal):
 1. column i A \<in> vec.span (columns A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
column ?i A \<in> vec.span (columns A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> vec.span (columns A)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> vec.span (columns A)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> vec.span (columns A)
[PROOF STEP]
have ?rhs
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> vec.span (columns A)

goal (1 subgoal):
 1. vec.span (columns A) = UNIV
[PROOF STEP]
unfolding rhseq
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> vec.span (columns A)

goal (1 subgoal):
 1. \<forall>x. x \<in> vec.span (columns A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vec.span (columns A) = UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a) \<Longrightarrow> vec.span (columns A) = UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a) \<Longrightarrow> vec.span (columns A) = UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a) \<Longrightarrow> vec.span (columns A) = UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
assume h:?rhs
[PROOF STATE]
proof (state)
this:
vec.span (columns A) = UNIV

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
let ?P = "\<lambda>(y::'a ^'n). \<exists>(x::'a^'m). sum (\<lambda>i. (x$i) *s column i A) ?U = y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
have "y \<in> vec.span (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> vec.span (columns A)
[PROOF STEP]
unfolding h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<in> vec.span (columns A)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> vec.span (columns A)
[PROOF STEP]
have "?P y"
[PROOF STATE]
proof (prove)
using this:
y \<in> vec.span (columns A)

goal (1 subgoal):
 1. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y
[PROOF STEP]
proof (induction rule: vec.span_induct_alt)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = 0
 2. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
case base
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = 0
 2. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = 0
[PROOF STEP]
by (metis (full_types) matrix_mult_sum matrix_vector_mult_0_right)
[PROOF STATE]
proof (state)
this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = 0

goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
case (step c y1 y2)
[PROOF STATE]
proof (state)
this:
y1 \<in> columns A
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2

goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
from step
[PROOF STATE]
proof (chain)
picking this:
y1 \<in> columns A
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2
[PROOF STEP]
obtain i where i: "i \<in> ?U" "y1 = column i A"
[PROOF STATE]
proof (prove)
using this:
y1 \<in> columns A
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> UNIV; y1 = column i A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
using this:
y1 \<in> {column i A |i. i \<in> UNIV}
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i \<in> UNIV; y1 = column i A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i \<in> UNIV
y1 = column i A

goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
obtain x:: "'a ^'m" where x: "sum (\<lambda>i. (x$i) *s column i A) ?U = y2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using step
[PROOF STATE]
proof (prove)
using this:
y1 \<in> columns A
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2

goal (1 subgoal):
 1. (\<And>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. x $ i *s column i A) = y2

goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
let ?x = "(\<chi> j. if j = i then c + (x$i) else (x$j))::'a^'m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c x y. \<lbrakk>x \<in> columns A; \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y\<rbrakk> \<Longrightarrow> \<exists>xa. (\<Sum>i\<in>UNIV. xa $ i *s column i A) = c *s x + y
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = c *s y1 + y2
[PROOF STEP]
proof (rule exI[where x= "?x"], vector, auto simp add: i x[symmetric] if_distrib distrib_left if_distribR cong del: if_weak_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
have th: "\<forall>xa \<in> ?U. (if xa = i then (c + (x$i)) * ((column xa A)$j)
              else (x$xa) * ((column xa A$j))) = (if xa = i then c * ((column i A)$j) else 0) + ((x$xa) * ((column xa A)$j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xa\<in>UNIV. (if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j
[PROOF STEP]
using i(1)
[PROOF STATE]
proof (prove)
using this:
i \<in> UNIV

goal (1 subgoal):
 1. \<forall>xa\<in>UNIV. (if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>xa\<in>UNIV. (if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
have "sum (\<lambda>xa. if xa = i then (c + (x$i)) * ((column xa A)$j)
              else (x$xa) * ((column xa A$j))) ?U = sum (\<lambda>xa. (if xa = i then c * ((column i A)$j) else 0) + ((x$xa) * ((column xa A)$j))) ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j)
[PROOF STEP]
by (rule sum.cong[OF refl]) (use th in blast)
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j)

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j)

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
have "\<dots> = sum (\<lambda>xa. if xa = i then c * ((column i A)$j) else 0) ?U + sum (\<lambda>xa. ((x$xa) * ((column xa A)$j))) ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. if xa = i then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
by (simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. if xa = i then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. (if xa = i then c * column i A $ j else (0::'a)) + x $ xa * column xa A $ j) = (\<Sum>xa\<in>UNIV. if xa = i then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
have "\<dots> = c * ((column i A)$j) + sum (\<lambda>xa. ((x$xa) * ((column xa A)$j))) ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>xa\<in>UNIV. if xa = i then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
unfolding sum.delta[OF fU]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i \<in> UNIV then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
using i(1)
[PROOF STATE]
proof (prove)
using this:
i \<in> UNIV

goal (1 subgoal):
 1. (if i \<in> UNIV then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. if xa = i then c * column i A $ j else (0::'a)) + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)

goal (1 subgoal):
 1. \<And>ia. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ ia else x $ xa * column xa A $ ia) = c * column i A $ ia + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ ia)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
show "sum (\<lambda>xa. if xa = i then (c + (x$i)) * ((column xa A)$j)
            else (x$xa) * ((column xa A$j))) ?U = c * ((column i A)$j) + sum (\<lambda>xa. ((x$xa) * ((column xa A)$j))) ?U"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)

goal (1 subgoal):
 1. (\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>xa\<in>UNIV. if xa = i then (c + x $ i) * column xa A $ j else x $ xa * column xa A $ j) = c * column i A $ j + (\<Sum>xa\<in>UNIV. x $ xa * column xa A $ j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = c *s y1 + y2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = ?y2

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = ?y2
[PROOF STEP]
have ?lhs
[PROOF STATE]
proof (prove)
using this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = ?y2

goal (1 subgoal):
 1. \<exists>B. A ** B = mat (1::'a)
[PROOF STEP]
unfolding lhseq
[PROOF STATE]
proof (prove)
using this:
\<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = ?y2

goal (1 subgoal):
 1. \<forall>y. \<exists>x. (\<Sum>i\<in>UNIV. x $ i *s column i A) = y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>B. A ** B = mat (1::'a)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
vec.span (columns A) = UNIV \<Longrightarrow> \<exists>B. A ** B = mat (1::'a)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. A ** B = mat (1::'a) \<Longrightarrow> vec.span (columns A) = UNIV
vec.span (columns A) = UNIV \<Longrightarrow> \<exists>B. A ** B = mat (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>B. A ** B = mat (1::'a) \<Longrightarrow> vec.span (columns A) = UNIV
vec.span (columns A) = UNIV \<Longrightarrow> \<exists>B. A ** B = mat (1::'a)

goal (1 subgoal):
 1. (\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<exists>B. A ** B = mat (1::'a)) = (vec.span (columns A) = UNIV)

goal:
No subgoals!
[PROOF STEP]
qed