[STATEMENT]
lemma mult_map_poly_imp_map_poly:
  assumes "map_poly complex_of_real q = r * map_poly complex_of_real p"
          "p \<noteq> 0"
  shows "r = map_poly complex_of_real (map_poly Re r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
have h: "Im \<circ> (*) \<i> \<circ> complex_of_real = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im \<circ> (*) \<i> \<circ> complex_of_real = id
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Im \<circ> (*) \<i> \<circ> complex_of_real = id

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
have "map_poly complex_of_real q = r * map_poly complex_of_real p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real q = r * map_poly complex_of_real p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = r * map_poly complex_of_real p
p \<noteq> 0

goal (1 subgoal):
 1. map_poly complex_of_real q = r * map_poly complex_of_real p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real q = r * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real q = r * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
have "... = (map_poly of_real (map_poly Re r) +
                    smult \<i> (map_poly of_real (map_poly Im r))) *
                   map_poly complex_of_real p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r * map_poly complex_of_real p = (map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p
[PROOF STEP]
using complex_poly_eq
[PROOF STATE]
proof (prove)
using this:
?r = map_poly complex_of_real (map_poly Re ?r) + smult \<i> (map_poly complex_of_real (map_poly Im ?r))

goal (1 subgoal):
 1. r * map_poly complex_of_real p = (map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
r * map_poly complex_of_real p = (map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
r * map_poly complex_of_real p = (map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
have "... = map_poly of_real (map_poly Re r * p) +
                   smult \<i> (map_poly of_real (map_poly Im r * p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))
[PROOF STEP]
by (simp add: mult_poly_add_left)
[PROOF STATE]
proof (state)
this:
(map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r))) * map_poly complex_of_real p = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
map_poly complex_of_real q = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))
[PROOF STEP]
have "map_poly complex_of_real q =
                map_poly of_real (map_poly Re r * p) +
                smult \<i> (map_poly of_real (map_poly Im r * p))"
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))

goal (1 subgoal):
 1. map_poly complex_of_real q = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real q = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
hence "0 = map_poly Im (map_poly of_real (map_poly Re r * p) +
             smult \<i> (map_poly of_real (map_poly Im r * p)))"
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))

goal (1 subgoal):
 1. 0 = map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p)))
[PROOF STEP]
by (auto simp: complex_poly_cong[symmetric] map_poly_Im_of_real)
[PROOF STATE]
proof (state)
this:
0 = map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p)))

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p)))

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
have "... = map_poly of_real (map_poly Im r * p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))) = map_poly of_real (map_poly Im r * p)
[PROOF STEP]
apply (rule poly_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. coeff (map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p)))) n = coeff (map_poly of_real (map_poly Im r * p)) n
[PROOF STEP]
by (auto simp: coeff_map_poly coeff_mult)
[PROOF STATE]
proof (state)
this:
map_poly Im (map_poly complex_of_real (map_poly Re r * p) + smult \<i> (map_poly complex_of_real (map_poly Im r * p))) = map_poly of_real (map_poly Im r * p)

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 = map_poly of_real (map_poly Im r * p)
[PROOF STEP]
have "0 = map_poly complex_of_real (map_poly Im r) *
                    map_poly complex_of_real p"
[PROOF STATE]
proof (prove)
using this:
0 = map_poly of_real (map_poly Im r * p)

goal (1 subgoal):
 1. 0 = map_poly complex_of_real (map_poly Im r) * map_poly complex_of_real p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 = map_poly complex_of_real (map_poly Im r) * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
hence "map_poly complex_of_real (map_poly Im r) = 0"
[PROOF STATE]
proof (prove)
using this:
0 = map_poly complex_of_real (map_poly Im r) * map_poly complex_of_real p

goal (1 subgoal):
 1. map_poly complex_of_real (map_poly Im r) = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 = map_poly complex_of_real (map_poly Im r) * map_poly complex_of_real p
map_poly complex_of_real q = r * map_poly complex_of_real p
p \<noteq> 0

goal (1 subgoal):
 1. map_poly complex_of_real (map_poly Im r) = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real (map_poly Im r) = 0

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real (map_poly Im r) = 0

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
apply (subst complex_poly_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly complex_of_real (map_poly Im r) = 0 \<Longrightarrow> map_poly complex_of_real (map_poly Re r) + smult \<i> (map_poly complex_of_real (map_poly Im r)) = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r = map_poly complex_of_real (map_poly Re r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma spans_image: "V \<subseteq> m1.span B \<Longrightarrow> f ` V \<subseteq> m2.span (f ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> m1.span B \<Longrightarrow> f ` V \<subseteq> m2.span (f ` B)
[PROOF STEP]
by (metis image_mono span_image)


[STATEMENT]
lemma pnPlus_pnorm: "pnPlus (pnorm r) (pnorm s) = pnorm (Plus r s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pnPlus (pnorm r) (pnorm s) = pnorm (Plus r s)
[PROOF STEP]
by (cases "pset r = {} \<or> pset s = {}")
    (auto simp: pnorm_def pset_pnPlus pset_pnorm_alt intro: pnPlus_flatten_PLUS)


[STATEMENT]
lemma solution_len_im_sing_less:
  assumes sol: "g s = h s" and set: "a \<in> set s" and less: "\<^bold>|g [a]\<^bold>| < \<^bold>|h [a]\<^bold>|"
  shows "\<^bold>|h [1-a]\<^bold>| < \<^bold>|g [1-a]\<^bold>|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>|h [1 - a]\<^bold>| < \<^bold>|g [1 - a]\<^bold>|
[PROOF STEP]
proof (intro not_le_imp_less notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>| \<Longrightarrow> False
[PROOF STEP]
assume "\<^bold>|g [1-a]\<^bold>| \<le> \<^bold>|h [1-a]\<^bold>|"
[PROOF STATE]
proof (state)
this:
\<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>|

goal (1 subgoal):
 1. \<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>| \<Longrightarrow> False
[PROOF STEP]
with less_imp_le[OF less]
[PROOF STATE]
proof (chain)
picking this:
\<^bold>|g [a]\<^bold>| \<le> \<^bold>|h [a]\<^bold>|
\<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>|
[PROOF STEP]
have "\<^bold>|g [b]\<^bold>| \<le> \<^bold>|h [b]\<^bold>|" for b
[PROOF STATE]
proof (prove)
using this:
\<^bold>|g [a]\<^bold>| \<le> \<^bold>|h [a]\<^bold>|
\<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>|

goal (1 subgoal):
 1. \<^bold>|g [b]\<^bold>| \<le> \<^bold>|h [b]\<^bold>|
[PROOF STEP]
by (fact bin_swap_induct)
[PROOF STATE]
proof (state)
this:
\<^bold>|g [?b]\<^bold>| \<le> \<^bold>|h [?b]\<^bold>|

goal (1 subgoal):
 1. \<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>| \<Longrightarrow> False
[PROOF STEP]
from this set less
[PROOF STATE]
proof (chain)
picking this:
\<^bold>|g [?b]\<^bold>| \<le> \<^bold>|h [?b]\<^bold>|
a \<in> set s
\<^bold>|g [a]\<^bold>| < \<^bold>|h [a]\<^bold>|
[PROOF STEP]
have "\<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|"
[PROOF STATE]
proof (prove)
using this:
\<^bold>|g [?b]\<^bold>| \<le> \<^bold>|h [?b]\<^bold>|
a \<in> set s
\<^bold>|g [a]\<^bold>| < \<^bold>|h [a]\<^bold>|

goal (1 subgoal):
 1. \<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|
[PROOF STEP]
by (rule len_im_less[of s])
[PROOF STATE]
proof (state)
this:
\<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|

goal (1 subgoal):
 1. \<^bold>|g [1 - a]\<^bold>| \<le> \<^bold>|h [1 - a]\<^bold>| \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|

goal (1 subgoal):
 1. False
[PROOF STEP]
using lenarg[OF sol]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|g s\<^bold>| < \<^bold>|h s\<^bold>|
\<^bold>|g s\<^bold>| = \<^bold>|h s\<^bold>|

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_mset_replicate_mset_subset[simp]: "set_mset (replicate_mset n x) = (if n = 0 then {} else {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (replicate_mset n x) = (if n = 0 then {} else {x})
[PROOF STEP]
by (auto split: if_splits)


[STATEMENT]
lemma (in algebra) lambda_system_Compl:
  fixes f:: "'a set \<Rightarrow> ennreal"
  assumes x: "x \<in> lambda_system \<Omega> M f"
  shows "\<Omega> - x \<in> lambda_system \<Omega> M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Omega> - x \<in> lambda_system \<Omega> M f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Omega> - x \<in> lambda_system \<Omega> M f
[PROOF STEP]
have "x \<subseteq> \<Omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<subseteq> \<Omega>
[PROOF STEP]
by (metis sets_into_space lambda_system_sets x)
[PROOF STATE]
proof (state)
this:
x \<subseteq> \<Omega>

goal (1 subgoal):
 1. \<Omega> - x \<in> lambda_system \<Omega> M f
[PROOF STEP]
hence "\<Omega> - (\<Omega> - x) = x"
[PROOF STATE]
proof (prove)
using this:
x \<subseteq> \<Omega>

goal (1 subgoal):
 1. \<Omega> - (\<Omega> - x) = x
[PROOF STEP]
by (metis double_diff equalityE)
[PROOF STATE]
proof (state)
this:
\<Omega> - (\<Omega> - x) = x

goal (1 subgoal):
 1. \<Omega> - x \<in> lambda_system \<Omega> M f
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> lambda_system \<Omega> M f
\<Omega> - (\<Omega> - x) = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> lambda_system \<Omega> M f
\<Omega> - (\<Omega> - x) = x

goal (1 subgoal):
 1. \<Omega> - x \<in> lambda_system \<Omega> M f
[PROOF STEP]
by (force simp add: lambda_system_def ac_simps)
[PROOF STATE]
proof (state)
this:
\<Omega> - x \<in> lambda_system \<Omega> M f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma BRANCH_UN: "BRANCH b (\<lambda>d. \<Union>x. f d x) = (\<Union>x. BRANCH b (\<lambda>d. f d x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BRANCH b (\<lambda>d. \<Union> (range (f d))) = (\<Union>x. BRANCH b (\<lambda>d. f d x))
[PROOF STEP]
by (simp add: BRANCH_def Lim_UN1 In1_UN1 In0_UN1 Scons_UN1_y)


[STATEMENT]
lemma diamond_left_dist_sup:
  "|x \<squnion> y>z = |x>z \<squnion> |y>z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. | x \<squnion> y > z = | x > z \<squnion> | y > z
[PROOF STEP]
by (simp add: d_dist_sup diamond_def mult_right_dist_sup)


[STATEMENT]
lemma mult_carrier_mat[simp]:
  "A \<in> carrier_mat nr n \<Longrightarrow> B \<in> carrier_mat n nc \<Longrightarrow> A * B \<in> carrier_mat nr nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr n; B \<in> carrier_mat n nc\<rbrakk> \<Longrightarrow> A * B \<in> carrier_mat nr nc
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> {m. dim_row m = nr \<and> dim_col m = n}; B \<in> {m. dim_row m = n \<and> dim_col m = nc}\<rbrakk> \<Longrightarrow> A * B \<in> {m. dim_row m = nr \<and> dim_col m = nc}
[PROOF STEP]
by auto


[STATEMENT]
lemma sshiftr_numeral:
  \<open>(numeral k >>> numeral n :: 'a::len word) =
    word_of_int (signed_take_bit (LENGTH('a) - 1) (numeral k) >> numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral k >>> numeral n = word_of_int (signed_take_bit (LENGTH('a) - 1) (numeral k) >> numeral n)
[PROOF STEP]
using signed_drop_bit_word_numeral [of n k]
[PROOF STATE]
proof (prove)
using this:
signed_drop_bit (numeral n) (numeral k) = word_of_int (drop_bit (numeral n) (signed_take_bit (LENGTH(?'a) - 1) (numeral k)))

goal (1 subgoal):
 1. numeral k >>> numeral n = word_of_int (signed_take_bit (LENGTH('a) - 1) (numeral k) >> numeral n)
[PROOF STEP]
by (simp add: sshiftr_def shiftr_def)


[STATEMENT]
lemma [simp]:
      assumes "invar_vebt t n" "\<forall>x\<in>set xs. x<2^n"
      shows "invar_vebt (foldl vebt_insert t xs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar_vebt (foldl vebt_insert t xs) n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n
\<forall>x\<in>set xs. x < 2 ^ n

goal (1 subgoal):
 1. invar_vebt (foldl vebt_insert t xs) n
[PROOF STEP]
apply (induction xs arbitrary: t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. \<lbrakk>invar_vebt t n; \<forall>x\<in>set []. x < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (foldl vebt_insert t []) n
 2. \<And>a xs t. \<lbrakk>\<And>t. \<lbrakk>invar_vebt t n; \<forall>x\<in>set xs. x < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (foldl vebt_insert t xs) n; invar_vebt t n; \<forall>x\<in>set (a # xs). x < 2 ^ n\<rbrakk> \<Longrightarrow> invar_vebt (foldl vebt_insert t (a # xs)) n
[PROOF STEP]
by auto


[STATEMENT]
lemma diagonal_dvd_Gcd_minors:
  fixes A::"'a::{semiring_Gcd,comm_ring_1} mat"
  assumes A: "A \<in> carrier_mat n m"
    and SNF_A: "Smith_normal_form_mat A"
shows "(\<Prod>i=0..<k. A $$ (i,i)) dvd Gcd (minors A k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
proof (cases "k=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
 2. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
 2. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
k \<noteq> 0

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
hence k: "0<k"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0

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

goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)
[PROOF STEP]
proof (rule Gcd_greatest)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> minors A k \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
have diag_A: "diagonal_mat A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_mat A
[PROOF STEP]
using SNF_A
[PROOF STATE]
proof (prove)
using this:
Smith_normal_form_mat A

goal (1 subgoal):
 1. diagonal_mat A
[PROOF STEP]
unfolding Smith_normal_form_mat_def isDiagonal_mat_def diagonal_mat_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. a + 1 < min (dim_row A) (dim_col A) \<longrightarrow> A $$ (a, a) dvd A $$ (a + 1, a + 1)) \<and> (\<forall>i j. i \<noteq> j \<and> i < dim_row A \<and> j < dim_col A \<longrightarrow> A $$ (i, j) = (0::'a))

goal (1 subgoal):
 1. \<forall>i<dim_row A. \<forall>j<dim_col A. i \<noteq> j \<longrightarrow> A $$ (i, j) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
diagonal_mat A

goal (1 subgoal):
 1. \<And>b. b \<in> minors A k \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>b. b \<in> minors A k \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
assume b_in_minors: "b \<in> minors A k"
[PROOF STATE]
proof (state)
this:
b \<in> minors A k

goal (1 subgoal):
 1. \<And>b. b \<in> minors A k \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
show "(\<Prod>i = 0..<k. A $$ (i, i)) dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
proof (cases "b=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b = (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
 2. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b = (0::'a)

goal (2 subgoals):
 1. b = (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
 2. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b = (0::'a)

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd b

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
b \<noteq> (0::'a)

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
obtain I J where b: "b = det (submatrix A I J)" and I: "I \<subseteq> {0..<dim_row A} "
    and J: "J \<subseteq> {0..<dim_col A}" and Ik: "card I = k" and Jk: "card J = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>b = Determinant.det (submatrix A I J); I \<subseteq> {0..<dim_row A}; J \<subseteq> {0..<dim_col A}; card I = k; card J = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using b_in_minors
[PROOF STATE]
proof (prove)
using this:
b \<in> minors A k

goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>b = Determinant.det (submatrix A I J); I \<subseteq> {0..<dim_row A}; J \<subseteq> {0..<dim_col A}; card I = k; card J = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding minors_def
[PROOF STATE]
proof (prove)
using this:
b \<in> {Determinant.det (submatrix A I J) |I J. I \<subseteq> {0..<dim_row A} \<and> J \<subseteq> {0..<dim_col A} \<and> card I = k \<and> card J = k}

goal (1 subgoal):
 1. (\<And>I J. \<lbrakk>b = Determinant.det (submatrix A I J); I \<subseteq> {0..<dim_row A}; J \<subseteq> {0..<dim_col A}; card I = k; card J = k\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b = Determinant.det (submatrix A I J)
I \<subseteq> {0..<dim_row A}
J \<subseteq> {0..<dim_col A}
card I = k
card J = k

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
obtain S where S: "S \<subseteq> {0..<min n m}" and Sk: "card S = k"
      and det_subS: "det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i,i))
        \<or> det (submatrix A I J) = -(\<Prod>i\<in>S. A $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<subseteq> {0..<min n m}; card S = k; Determinant.det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i, i)) \<or> Determinant.det (submatrix A I J) = - (\<Prod>i\<in>S. A $$ (i, i))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using det_minors_diagonal2[OF diag_A A Ik Jk _ _ k] I J A False b
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>I \<subseteq> {0..<n}; J \<subseteq> {0..<m}\<rbrakk> \<Longrightarrow> Determinant.det (submatrix A I J) = (0::'a) \<or> (\<exists>S\<subseteq>{0..<min n m}. card S = k \<and> S = I \<and> (Determinant.det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i, i)) \<or> Determinant.det (submatrix A I J) = - (\<Prod>i\<in>S. A $$ (i, i))))
I \<subseteq> {0..<dim_row A}
J \<subseteq> {0..<dim_col A}
A \<in> carrier_mat n m
b \<noteq> (0::'a)
b = Determinant.det (submatrix A I J)

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>S \<subseteq> {0..<min n m}; card S = k; Determinant.det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i, i)) \<or> Determinant.det (submatrix A I J) = - (\<Prod>i\<in>S. A $$ (i, i))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> {0..<min n m}
card S = k
Determinant.det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i, i)) \<or> Determinant.det (submatrix A I J) = - (\<Prod>i\<in>S. A $$ (i, i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
obtain f where inj_f: "inj_on f {0..<k}" and fk_S: "f`{0..<k} = S"
      and i_fi: " (\<forall>i\<in>{0..<k}. i \<le> f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>inj_on f {0..<k}; f ` {0..<k} = S; \<forall>i\<in>{0..<k}. i \<le> f i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using exists_inj_ge_index[OF S Sk]
[PROOF STATE]
proof (prove)
using this:
\<exists>f. inj_on f {0..<k} \<and> f ` {0..<k} = S \<and> (\<forall>i\<in>{0..<k}. i \<le> f i)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>inj_on f {0..<k}; f ` {0..<k} = S; \<forall>i\<in>{0..<k}. i \<le> f i\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inj_on f {0..<k}
f ` {0..<k} = S
\<forall>i\<in>{0..<k}. i \<le> f i

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
have "(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>{0..<k}. A $$ (f i,f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i = 0..<k. A $$ (f i, f i))
[PROOF STEP]
by (rule prod_dvd_prod, rule SNF_divides_diagonal[OF A SNF_A], insert fk_S S i_fi, force+)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i = 0..<k. A $$ (f i, f i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i = 0..<k. A $$ (f i, f i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
have "... = (\<Prod>i\<in>f`{0..<k}. A $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (f i, f i)) = (\<Prod>i\<in>f ` {0..<k}. A $$ (i, i))
[PROOF STEP]
by (rule prod.reindex[symmetric, unfolded o_def, OF inj_f])
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (f i, f i)) = (\<Prod>i\<in>f ` {0..<k}. A $$ (i, i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (f i, f i)) = (\<Prod>i\<in>f ` {0..<k}. A $$ (i, i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
have "... = (\<Prod>i\<in>S. A $$ (i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i\<in>f ` {0..<k}. A $$ (i, i)) = (\<Prod>i\<in>S. A $$ (i, i))
[PROOF STEP]
using fk_S
[PROOF STATE]
proof (prove)
using this:
f ` {0..<k} = S

goal (1 subgoal):
 1. (\<Prod>i\<in>f ` {0..<k}. A $$ (i, i)) = (\<Prod>i\<in>S. A $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i\<in>f ` {0..<k}. A $$ (i, i)) = (\<Prod>i\<in>S. A $$ (i, i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))
[PROOF STEP]
have *: "(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))"
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))

goal (1 subgoal):
 1. b \<noteq> (0::'a) \<Longrightarrow> (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
show "(\<Prod>i = 0..<k. A $$ (i, i)) dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
using det_subS b *
[PROOF STATE]
proof (prove)
using this:
Determinant.det (submatrix A I J) = (\<Prod>i\<in>S. A $$ (i, i)) \<or> Determinant.det (submatrix A I J) = - (\<Prod>i\<in>S. A $$ (i, i))
b = Determinant.det (submatrix A I J)
(\<Prod>i = 0..<k. A $$ (i, i)) dvd (\<Prod>i\<in>S. A $$ (i, i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<k. A $$ (i, i)) dvd b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<k. A $$ (i, i)) dvd Gcd (minors A k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma power_suc_below_plus:
  "x \<up> Suc n \<le> x\<^sup>+"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. power.power 1' (;) x (Suc n) \<le> x\<^sup>+
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. power.power 1' (;) x (Suc zero_class.zero) \<le> x\<^sup>+
 2. \<And>n. power.power 1' (;) x (Suc n) \<le> x\<^sup>+ \<Longrightarrow> power.power 1' (;) x (Suc (Suc n)) \<le> x\<^sup>+
[PROOF STEP]
using mult_isol star_ref
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?z ; ?x \<le> ?z ; ?y
reflexive (?x\<^sup>\<star>)

goal (2 subgoals):
 1. power.power 1' (;) x (Suc zero_class.zero) \<le> x\<^sup>+
 2. \<And>n. power.power 1' (;) x (Suc n) \<le> x\<^sup>+ \<Longrightarrow> power.power 1' (;) x (Suc (Suc n)) \<le> x\<^sup>+
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. power.power 1' (;) x (Suc n) \<le> x\<^sup>+ \<Longrightarrow> power.power 1' (;) x (Suc (Suc n)) \<le> x\<^sup>+
[PROOF STEP]
by (simp add: mult_isol_var order_trans)


[STATEMENT]
lemma connected_simple_path_image: "simple_path g \<Longrightarrow> connected(path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_path g \<Longrightarrow> connected (path_image g)
[PROOF STEP]
by (metis connected_path_image simple_path_imp_path)


[STATEMENT]
lemma ttf_3: assumes dx: "dim_vec x = 3"
  and be: "x $ 0 = True \<and> x $ 1 = True \<and> x $ 2 = False"
  shows "ceros_of_boolean_input x = {2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input x = {2}
[PROOF STEP]
using dx be
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = True \<and> x $ 2 = False

goal (1 subgoal):
 1. ceros_of_boolean_input x = {2}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = True \<and> x $ 2 = False

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {2}
[PROOF STEP]
using less_3_cases
[PROOF STATE]
proof (prove)
using this:
dim_vec x = 3
x $ 0 = True \<and> x $ 1 = True \<and> x $ 2 = False
?n < 3 \<Longrightarrow> ?n = 0 \<or> ?n = 1 \<or> ?n = 2

goal (1 subgoal):
 1. {xa. xa < dim_vec x \<and> x $ xa = False} = {2}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma conj_assoc: "(x \<^bold>\<sqinter> y) \<^bold>\<sqinter> z = x \<^bold>\<sqinter> (y \<^bold>\<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<^bold>\<sqinter> y) \<^bold>\<sqinter> z = x \<^bold>\<sqinter> y \<^bold>\<sqinter> z
[PROOF STEP]
by (fact conj.assoc)


[STATEMENT]
lemma fds_deriv_of_real [simp]: "fds_deriv (of_real n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv (of_real n) = 0
[PROOF STEP]
by (simp only: fds_const_of_real [symmetric] fds_deriv_const)


[STATEMENT]
lemma emeasure_subadditive:
  "A \<in> sets M \<Longrightarrow> B \<in> sets M \<Longrightarrow> emeasure M (A \<union> B) \<le> emeasure M A + emeasure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; B \<in> sets M\<rbrakk> \<Longrightarrow> emeasure M (A \<union> B) \<le> emeasure M A + emeasure M B
[PROOF STEP]
using emeasure_subadditive_finite[of "{True, False}" "\<lambda>True \<Rightarrow> A | False \<Rightarrow> B" M]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {True, False}; (\<lambda>x. case x of True \<Rightarrow> A | False \<Rightarrow> B) ` {True, False} \<subseteq> sets M\<rbrakk> \<Longrightarrow> emeasure M (\<Union>i\<in>{True, False}. case i of True \<Rightarrow> A | False \<Rightarrow> B) \<le> (\<Sum>i\<in>{True, False}. emeasure M (case i of True \<Rightarrow> A | False \<Rightarrow> B))

goal (1 subgoal):
 1. \<lbrakk>A \<in> sets M; B \<in> sets M\<rbrakk> \<Longrightarrow> emeasure M (A \<union> B) \<le> emeasure M A + emeasure M B
[PROOF STEP]
by simp


[STATEMENT]
lemma differentiable_on_open_Un:
  "f differentiable_on S \<union> T"
  if "f differentiable_on S"
    "f differentiable_on T"
    "open S" "open T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable_on S \<union> T
[PROOF STEP]
using that differentiable_on_open_Union[of "{S, T}" f]
[PROOF STATE]
proof (prove)
using this:
f differentiable_on S
f differentiable_on T
open S
open T
\<lbrakk>\<And>s. s \<in> {S, T} \<Longrightarrow> f differentiable_on s; \<And>s. s \<in> {S, T} \<Longrightarrow> open s\<rbrakk> \<Longrightarrow> f differentiable_on \<Union> {S, T}

goal (1 subgoal):
 1. f differentiable_on S \<union> T
[PROOF STEP]
by auto


[STATEMENT]
lemma vfinite_vcard_vfinite: "vfinite (vcard A) = vfinite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfinite (vcard A) = vfinite A
[PROOF STEP]
by (simp add: cardinal_eqpoll eqpoll_finite_iff)


[STATEMENT]
lemma P2_closeda: "P2 x \<longrightarrow> (\<forall>y. (P1 (s(x)) y \<longrightarrow> P1 (s(x)) (s(y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P2 x \<longrightarrow> (\<forall>y. P1 (s x) y \<longrightarrow> P1 (s x) (s y))
[PROOF STEP]
using A3 P1_def P2_def
[PROOF STATE]
proof (prove)
using this:
F (s ?x, s ?y) = F (?x, F (s ?x, ?y))
P1 ?x ?y \<equiv> F (?x, ?y) \<in> N
P2 ?x \<equiv> N \<subseteq> {y. P1 ?x y}

goal (1 subgoal):
 1. P2 x \<longrightarrow> (\<forall>y. P1 (s x) y \<longrightarrow> P1 (s x) (s y))
[PROOF STEP]
by auto


[STATEMENT]
lemma mult_commute_abs: "(\<lambda>x. x * c) = (*) c"
  for c :: "'a::ab_semigroup_mult"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x * c) = (*) c
[PROOF STEP]
by (simp add: fun_eq_iff mult.commute)


[STATEMENT]
lemma count_vec_sum_ones:
  fixes v :: "'a :: {ring_1} vec"
  assumes "\<And> i. i < dim_vec v \<Longrightarrow> v $ i = 1 \<or> v $ i = 0"
  shows "of_nat (count_vec v 1) = sum_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
proof (induct v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i < dim_vec vNil \<Longrightarrow> vNil $ i = (1::'a) \<or> vNil $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec vNil (1::'a)) = sum_vec vNil
 2. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
case vNil
[PROOF STATE]
proof (state)
this:
?i < dim_vec vNil \<Longrightarrow> vNil $ ?i = (1::'a) \<or> vNil $ ?i = (0::'a)

goal (2 subgoals):
 1. (\<And>i. i < dim_vec vNil \<Longrightarrow> vNil $ i = (1::'a) \<or> vNil $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec vNil (1::'a)) = sum_vec vNil
 2. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < dim_vec vNil \<Longrightarrow> vNil $ ?i = (1::'a) \<or> vNil $ ?i = (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec vNil \<Longrightarrow> vNil $ ?i = (1::'a) \<or> vNil $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec vNil (1::'a)) = sum_vec vNil
[PROOF STEP]
by (simp add: vec_mset_vNil)
[PROOF STATE]
proof (state)
this:
of_nat (count_vec vNil (1::'a)) = sum_vec vNil

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
case (vCons a v)
[PROOF STATE]
proof (state)
this:
(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v
?i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ ?i = (1::'a) \<or> vCons a v $ ?i = (0::'a)

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v
?i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ ?i = (1::'a) \<or> vCons a v $ ?i = (0::'a)
[PROOF STEP]
have lim: "dim_vec (vCons a v) \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v
?i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ ?i = (1::'a) \<or> vCons a v $ ?i = (0::'a)

goal (1 subgoal):
 1. 1 \<le> dim_vec (vCons a v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> dim_vec (vCons a v)

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
have "(\<And> i. i < dim_vec v \<Longrightarrow> v $ i = 1 \<or> v$ i = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)
[PROOF STEP]
using vCons.prems
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ ?i = (1::'a) \<or> vCons a v $ ?i = (0::'a)

goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)
[PROOF STEP]
have hyp: "of_nat (count_vec v 1) = sum_vec v"
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
using vCons.hyps
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)
(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
of_nat (count_vec v (1::'a)) = sum_vec v

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
have "sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (vCons a v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (vCons a v)
[PROOF STEP]
by (simp add: sum_vec_def)
[PROOF STATE]
proof (state)
this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (vCons a v)

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (vCons a v)
[PROOF STEP]
have sv: "sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (v) + a"
[PROOF STATE]
proof (prove)
using this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec (vCons a v)

goal (1 subgoal):
 1. sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec v + a
[PROOF STEP]
by (simp add: sum_vec_vCons)
[PROOF STATE]
proof (state)
this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec v + a

goal (1 subgoal):
 1. \<And>a v. \<lbrakk>(\<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)) \<Longrightarrow> of_nat (count_vec v (1::'a)) = sum_vec v; \<And>i. i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ i = (1::'a) \<or> vCons a v $ i = (0::'a)\<rbrakk> \<Longrightarrow> of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec v + a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec v + a

goal (1 subgoal):
 1. of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
using count_vec_vCons dim_vec_vCons_ne_0 sum_vec_vCons vCons.prems
[PROOF STATE]
proof (prove)
using this:
sum (($) (vCons a v)) {0..<dim_vec (vCons a v)} = sum_vec v + a
count_vec (vCons ?aa ?v) ?a = (if ?aa = ?a then count_vec ?v ?a + 1 else count_vec ?v ?a)
0 < dim_vec (vCons ?a ?v)
sum_vec (vCons ?a ?v) = ?a + sum_vec ?v
?i < dim_vec (vCons a v) \<Longrightarrow> vCons a v $ ?i = (1::'a) \<or> vCons a v $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)
[PROOF STEP]
by (metis add.commute add_0 hyp of_nat_1 of_nat_add vec_index_vCons_0)
[PROOF STATE]
proof (state)
this:
of_nat (count_vec (vCons a v) (1::'a)) = sum_vec (vCons a v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Init_PLam [simp]: "Init (PLam I F) = (\<Inter>i \<in> I. lift_set i (Init (F i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Init (PLam I F) = (\<Inter>i\<in>I. lift_set i (Init (F i)))
[PROOF STEP]
by (simp add: PLam_def lift_def lift_set_def)


[STATEMENT]
lemma plus_\<I>_mono: "plus_\<I> \<I>1 \<I>2 \<le> plus_\<I> \<I>1' \<I>2'" if "\<I>1 \<le> \<I>1'" "\<I>2 \<le> \<I>2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<I>1 \<oplus>\<^sub>\<I> \<I>2 \<le> \<I>1' \<oplus>\<^sub>\<I> \<I>2'
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<I>1 \<le> \<I>1'
\<I>2 \<le> \<I>2'

goal (1 subgoal):
 1. \<I>1 \<oplus>\<^sub>\<I> \<I>2 \<le> \<I>1' \<oplus>\<^sub>\<I> \<I>2'
[PROOF STEP]
by(fastforce simp add: le_\<I>_def)


[STATEMENT]
lemma hrelation_hunion [simp]: "hrelation (f \<squnion> g) \<longleftrightarrow> hrelation f \<and> hrelation g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hrelation (f \<squnion> g) = (hrelation f \<and> hrelation g)
[PROOF STEP]
by (auto simp: hrelation_def)


[STATEMENT]
lemma smooth_on_norm: "k-smooth_on S (\<lambda>x. norm (f x))"
  if "k-smooth_on S f" "0 \<notin> f ` S" "open S"
  for f::"_ \<Rightarrow>_::real_inner"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on S (\<lambda>x. norm (f x))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
k-smooth_on S f
(0::'d) \<notin> f ` S
open S

goal (1 subgoal):
 1. k-smooth_on S (\<lambda>x. norm (f x))
[PROOF STEP]
by (auto simp: smooth_on_def intro!: higher_differentiable_on_norm)


[STATEMENT]
lemma filter_bool_list_set_nth:
  "set (filter_bool_list bs xs) = {xs ! n |n. bs ! n \<and> n < length bs \<and> n < length xs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (filter_bool_list bs xs) = {xs ! n |n. bs ! n \<and> n < length bs \<and> n < length xs}
[PROOF STEP]
by (auto simp: filter_bool_list_in filter_bool_list_elem_nth)


[STATEMENT]
lemma esqrt_square [simp]:
  assumes "x \<ge> 0"
  shows "(esqrt x) * (esqrt x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esqrt x * esqrt x = x
[PROOF STEP]
unfolding esqrt_def times_ennreal.rep_eq[symmetric] ennsqrt_square[of "e2ennreal x"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2ereal (e2ennreal x) = x
[PROOF STEP]
using assms enn2ereal_e2ennreal
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
0 \<le> ?x \<Longrightarrow> enn2ereal (e2ennreal ?x) = ?x

goal (1 subgoal):
 1. enn2ereal (e2ennreal x) = x
[PROOF STEP]
by auto


[STATEMENT]
lemma pos_deriv_imp_strict_mono:
  assumes "\<And>x. (f has_real_derivative f' x) (at x)"
  assumes "\<And>x. f' x > 0"
  shows   "strict_mono f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono f
[PROOF STEP]
proof (rule strict_monoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
fix x y :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
assume xy: "x < y"
[PROOF STATE]
proof (state)
this:
x < y

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
from assms and xy
[PROOF STATE]
proof (chain)
picking this:
(f has_real_derivative f' ?x) (at ?x)
0 < f' ?x
x < y
[PROOF STEP]
have "\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z"
[PROOF STATE]
proof (prove)
using this:
(f has_real_derivative f' ?x) (at ?x)
0 < f' ?x
x < y

goal (1 subgoal):
 1. \<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z
[PROOF STEP]
by (intro MVT2) (auto dest: connectedD_interval)
[PROOF STATE]
proof (state)
this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z
[PROOF STEP]
obtain z where z: "z > x" "z < y" "f y - f x = (y - x) * f' z"
[PROOF STATE]
proof (prove)
using this:
\<exists>z>x. z < y \<and> f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. (\<And>z. \<lbrakk>x < z; z < y; f y - f x = (y - x) * f' z\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x < z
z < y
f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
note \<open>f y - f x = (y - x) * f' z\<close>
[PROOF STATE]
proof (state)
this:
f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f y - f x = (y - x) * f' z

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
have "(y - x) * f' z > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (y - x) * f' z
[PROOF STEP]
using xy assms
[PROOF STATE]
proof (prove)
using this:
x < y
(f has_real_derivative f' ?x) (at ?x)
0 < f' ?x

goal (1 subgoal):
 1. 0 < (y - x) * f' z
[PROOF STEP]
by (intro mult_pos_pos) auto
[PROOF STATE]
proof (state)
this:
0 < (y - x) * f' z

goal (1 subgoal):
 1. \<And>x y. x < y \<Longrightarrow> f x < f y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < f y - f x
[PROOF STEP]
show "f x < f y"
[PROOF STATE]
proof (prove)
using this:
0 < f y - f x

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

goal:
No subgoals!
[PROOF STEP]
qed


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


[STATEMENT]
lemma append_cols_mult_right_id:
  assumes A: "(A::'a::semiring_1 mat) \<in> carrier_mat n 1"
  and B: "B \<in> carrier_mat n (m-1)"
  and C: "C = four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D"
  and D: "D \<in> carrier_mat (m-1) (m-1)"
shows "(A @\<^sub>c B) * C = A @\<^sub>c (B * D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
let ?C = "four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
have "(A @\<^sub>c B) * C = (A @\<^sub>c B) * ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D
[PROOF STEP]
unfolding C
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
have "... = four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * ?C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
have "... = four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D)
    (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1)
    (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D)
[PROOF STEP]
by (rule mult_four_block_mat, insert assms, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) * four_block_mat (1\<^sub>m 1) (0\<^sub>m 1 (m - 1)) (0\<^sub>m (m - 1) 1) D = four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D)

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
have "... = four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B*D)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D) = four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D)))
[PROOF STEP]
by (rule cong_four_block_mat, insert assms, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D) = four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D)))

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat (A * 1\<^sub>m 1 + B * 0\<^sub>m (m - 1) 1) (A * 0\<^sub>m 1 (m - 1) + B * D) (0\<^sub>m 0 (dim_col A) * 1\<^sub>m 1 + 0\<^sub>m 0 (dim_col B) * 0\<^sub>m (m - 1) 1) (0\<^sub>m 0 (dim_col A) * 0\<^sub>m 1 (m - 1) + 0\<^sub>m 0 (dim_col B) * D) = four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D)))

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
have "... = A @\<^sub>c (B * D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D))) = A @\<^sub>c B * D
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D))) = four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
four_block_mat A (B * D) (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col (B * D))) = A @\<^sub>c B * D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(A @\<^sub>c B) * C = A @\<^sub>c B * D

goal (1 subgoal):
 1. (A @\<^sub>c B) * C = A @\<^sub>c B * D
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A @\<^sub>c B) * C = A @\<^sub>c B * D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma untime_not_empty_conv: "(untime s \<noteq> []) = (\<exists>n<length s. s ! n \<noteq> \<NoMsg>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (untime s \<noteq> []) = (\<exists>n<length s. s ! n \<noteq> NoMsg)
[PROOF STEP]
by (simp add: untime_empty_conv)


[STATEMENT]
lemma row_mat_mult_index :
  assumes wf1: "mat nr n m1"
  and wf2: "mat n nc m2"
  and i: "i < nr"
  shows "row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda> j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0 ..< nc]" (is "row ?l i = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
have wf12: "mat nr nc ?l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat nr nc (mat_multI ze pl ti nr m1 m2)
[PROOF STEP]
by (rule mat_mult[OF wf1 wf2])
[PROOF STATE]
proof (state)
this:
mat nr nc (mat_multI ze pl ti nr m1 m2)

goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
hence lenL: "length ?l = nc"
[PROOF STATE]
proof (prove)
using this:
mat nr nc (mat_multI ze pl ti nr m1 m2)

goal (1 subgoal):
 1. length (mat_multI ze pl ti nr m1 m2) = nc
[PROOF STEP]
unfolding mat_def
[PROOF STATE]
proof (prove)
using this:
length (mat_multI ze pl ti nr m1 m2) = nc \<and> Ball (set (mat_multI ze pl ti nr m1 m2)) (vec nr)

goal (1 subgoal):
 1. length (mat_multI ze pl ti nr m1 m2) = nc
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (mat_multI ze pl ti nr m1 m2) = nc

goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
have len: "length (row ?l i) = length ?r" and nc: "length (row ?l i) = nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (row (mat_multI ze pl ti nr m1 m2) i) = length (map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]) &&& length (row (mat_multI ze pl ti nr m1 m2) i) = nc
[PROOF STEP]
using wf1 wf2 wf12 i
[PROOF STATE]
proof (prove)
using this:
mat nr n m1
mat n nc m2
mat nr nc (mat_multI ze pl ti nr m1 m2)
i < nr

goal (1 subgoal):
 1. length (row (mat_multI ze pl ti nr m1 m2) i) = length (map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]) &&& length (row (mat_multI ze pl ti nr m1 m2) i) = nc
[PROOF STEP]
unfolding mat_def row_def
[PROOF STATE]
proof (prove)
using this:
length m1 = n \<and> Ball (set m1) (vec nr)
length m2 = nc \<and> Ball (set m2) (vec n)
length (mat_multI ze pl ti nr m1 m2) = nc \<and> Ball (set (mat_multI ze pl ti nr m1 m2)) (vec nr)
i < nr

goal (1 subgoal):
 1. length (map (\<lambda>w. w ! i) (mat_multI ze pl ti nr m1 m2)) = length (map (\<lambda>j. scalar_prodI ze pl ti (map (\<lambda>w. w ! i) m1) (col m2 j)) [0..<nc]) &&& length (map (\<lambda>w. w ! i) (mat_multI ze pl ti nr m1 m2)) = nc
[PROOF STEP]
by (auto simp: vec_def)
[PROOF STATE]
proof (state)
this:
length (row (mat_multI ze pl ti nr m1 m2) i) = length (map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc])
length (row (mat_multI ze pl ti nr m1 m2) i) = nc

goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]
[PROOF STEP]
by (rule nth_equalityI[OF len], simp add: i nc, unfold row_def, simp add: lenL, simp only:
    mat_mult_index[OF wf1 wf2 i], simp add: row_def)
[PROOF STATE]
proof (state)
this:
row (mat_multI ze pl ti nr m1 m2) i = map (\<lambda>j. scalar_prodI ze pl ti (row m1 i) (col m2 j)) [0..<nc]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_mv_nonzero:
  assumes "v \<noteq> vec_zero" and "mat_det A \<noteq> 0"
  shows "A *\<^sub>m\<^sub>v v \<noteq> vec_zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>m\<^sub>v v \<noteq> vec_zero
[PROOF STEP]
apply (rule ccontr)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> A *\<^sub>m\<^sub>v v \<noteq> vec_zero \<Longrightarrow> False
[PROOF STEP]
using assms mult_mv_inv[of vec_zero A v] mat_inv_l vec_zero_l
[PROOF STATE]
proof (prove)
using this:
v \<noteq> vec_zero
mat_det A \<noteq> 0
\<lbrakk>vec_zero = A *\<^sub>m\<^sub>v v; mat_det A \<noteq> 0\<rbrakk> \<Longrightarrow> v = mat_inv A *\<^sub>m\<^sub>v vec_zero
mat_det ?A \<noteq> 0 \<Longrightarrow> mat_inv ?A *\<^sub>m\<^sub>m ?A = eye
?A *\<^sub>m\<^sub>v vec_zero = vec_zero

goal (1 subgoal):
 1. \<not> A *\<^sub>m\<^sub>v v \<noteq> vec_zero \<Longrightarrow> False
[PROOF STEP]
by auto


[STATEMENT]
lemma all_prefered_are_more_expensive:
  assumes i_agt: "i \<in> agents"
  assumes equil: "competitive_equilibrium P \<X> \<Y>"
  assumes "z \<in> consumption_set"
  assumes "(U i) z > (U i) (\<X> i)"
  shows "z \<bullet> P > P \<bullet> (\<X> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> \<X> i < z \<bullet> P
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
assume neg_as :  "\<not>(z \<bullet> P > P \<bullet> (\<X> i))"
[PROOF STATE]
proof (state)
this:
\<not> P \<bullet> \<X> i < z \<bullet> P

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
have xp_leq : "z \<bullet> P \<le> P \<bullet>  (\<X> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<bullet> P \<le> P \<bullet> \<X> i
[PROOF STEP]
using \<open>\<not>z \<bullet> P > P \<bullet> (\<X> i)\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> P \<bullet> \<X> i < z \<bullet> P

goal (1 subgoal):
 1. z \<bullet> P \<le> P \<bullet> \<X> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<bullet> P \<le> P \<bullet> \<X> i

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
have x_in_argmax: "(\<X> i) \<in> arg_max_set U[i] (budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))
[PROOF STEP]
using equil i_agt
[PROOF STATE]
proof (prove)
using this:
competitive_equilibrium P \<X> \<Y>
i \<in> agents

goal (1 subgoal):
 1. \<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence x_in: "\<X> i \<in> (budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>))"
[PROOF STATE]
proof (prove)
using this:
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))

goal (1 subgoal):
 1. \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
using argmax_sol_in_s [of "(\<X> i)" "U[i]" "budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>)"]
[PROOF STATE]
proof (prove)
using this:
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)) \<Longrightarrow> \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal (1 subgoal):
 1. \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
hence z_in_budget: "z \<in> (budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>))"
[PROOF STATE]
proof (prove)
using this:
\<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<Longrightarrow> z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
have z_leq_endow: "P \<bullet> z \<le> P \<bullet> (\<X> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> z \<le> P \<bullet> \<X> i
[PROOF STEP]
by (metis xp_leq inner_commute)
[PROOF STATE]
proof (state)
this:
P \<bullet> z \<le> P \<bullet> \<X> i

goal (1 subgoal):
 1. \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<Longrightarrow> z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
have z_in_cons: "z \<in> consumption_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> consumption_set
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i \<in> agents
competitive_equilibrium P \<X> \<Y>
z \<in> consumption_set
U[i] (\<X> i) < U[i] z

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

goal (1 subgoal):
 1. \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<Longrightarrow> z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> consumption_set
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<in> consumption_set

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
using x_in budget_constraint_def z_leq_endow
[PROOF STATE]
proof (prove)
using this:
z \<in> consumption_set
\<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
budget_constraint ?f ?S ?W = {x \<in> ?S. ?f x \<le> ?W}
P \<bullet> z \<le> P \<bullet> \<X> i

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>z \<in> consumption_set; \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>); \<And>f S W. budget_constraint f S W = {x \<in> S. f x \<le> W}; P \<bullet> z \<le> P \<bullet> \<X> i\<rbrakk> \<Longrightarrow> z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
have "\<forall>r.  P \<bullet> \<X> i \<le> r \<longrightarrow> P \<bullet> z \<le> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r
[PROOF STEP]
using z_leq_endow
[PROOF STATE]
proof (prove)
using this:
P \<bullet> z \<le> P \<bullet> \<X> i

goal (1 subgoal):
 1. \<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r

goal (1 subgoal):
 1. \<lbrakk>z \<in> consumption_set; \<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>); \<And>f S W. budget_constraint f S W = {x \<in> S. f x \<le> W}; P \<bullet> z \<le> P \<bullet> \<X> i\<rbrakk> \<Longrightarrow> z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
using budget_constraint_def x_in z_in_cons
[PROOF STATE]
proof (prove)
using this:
\<forall>r\<ge>P \<bullet> \<X> i. P \<bullet> z \<le> r
budget_constraint ?f ?S ?W = {x \<in> ?S. ?f x \<le> ?W}
\<X> i \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
z \<in> consumption_set

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)
[PROOF STEP]
by (simp add: budget_constraint_def)
[PROOF STATE]
proof (state)
this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
have nex_prop: "\<nexists>e. e \<in>  (budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>)) \<and>
        U[i] e > U[i] (\<X> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>e. e \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] e
[PROOF STEP]
using no_better_in_s[of "\<X> i" "U[i]"
        "budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>)"] x_in_argmax
[PROOF STATE]
proof (prove)
using this:
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)) \<Longrightarrow> \<nexists>y. y \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] y
\<X> i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>))

goal (1 subgoal):
 1. \<nexists>e. e \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<nexists>e. e \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] e

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
have "z \<in> budget_constraint (calculate_value P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] z > U[i] (\<X> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] z
[PROOF STEP]
using assms z_in_budget
[PROOF STATE]
proof (prove)
using this:
i \<in> agents
competitive_equilibrium P \<X> \<Y>
z \<in> consumption_set
U[i] (\<X> i) < U[i] z
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>)

goal (1 subgoal):
 1. z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] z

goal (1 subgoal):
 1. \<not> P \<bullet> \<X> i < z \<bullet> P \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] z

goal (1 subgoal):
 1. False
[PROOF STEP]
using nex_prop
[PROOF STATE]
proof (prove)
using this:
z \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] z
\<nexists>e. e \<in> budget_constraint ((\<bullet>) P) consumption_set (poe_wealth P i \<Y>) \<and> U[i] (\<X> i) < U[i] e

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonneg_incseq_Bseq_subseq_iff:
  fixes f :: "nat \<Rightarrow> real"
    and g :: "nat \<Rightarrow> nat"
  assumes "\<And>x. f x \<ge> 0" "incseq f" "strict_mono g"
  shows "Bseq (\<lambda>x. f (g x)) \<longleftrightarrow> Bseq f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bseq (\<lambda>x. f (g x)) = Bseq f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> f ?x
incseq f
strict_mono g

goal (1 subgoal):
 1. Bseq (\<lambda>x. f (g x)) = Bseq f
[PROOF STEP]
by (intro increasing_Bseq_subseq_iff) (auto simp: incseq_def)


[STATEMENT]
lemma cong_solve_dvd_int:
  fixes a::int
  assumes b: "gcd a n dvd d"
  shows "\<exists>x. [a * x = d] (mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
from cong_solve_int [of a]
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. [a * x = gcd a ?n] (mod ?n)
[PROOF STEP]
obtain x where "[a * x = gcd a n](mod n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. [a * x = gcd a ?n] (mod ?n)

goal (1 subgoal):
 1. (\<And>x. [a * x = gcd a n] (mod n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[a * x = gcd a n] (mod n)

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[a * x = gcd a n] (mod n)
[PROOF STEP]
have "[(d div gcd a n) * (a * x) = (d div gcd a n) * gcd a n] (mod n)"
[PROOF STATE]
proof (prove)
using this:
[a * x = gcd a n] (mod n)

goal (1 subgoal):
 1. [d div gcd a n * (a * x) = d div gcd a n * gcd a n] (mod n)
[PROOF STEP]
using cong_scalar_left
[PROOF STATE]
proof (prove)
using this:
[a * x = gcd a n] (mod n)
[?b = ?c] (mod ?a) \<Longrightarrow> [?d * ?b = ?d * ?c] (mod ?a)

goal (1 subgoal):
 1. [d div gcd a n * (a * x) = d div gcd a n * gcd a n] (mod n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
[d div gcd a n * (a * x) = d div gcd a n * gcd a n] (mod n)

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[d div gcd a n * (a * x) = d div gcd a n * gcd a n] (mod n)

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
from b
[PROOF STATE]
proof (chain)
picking this:
gcd a n dvd d
[PROOF STEP]
have "(d div gcd a n) * gcd a n = d"
[PROOF STATE]
proof (prove)
using this:
gcd a n dvd d

goal (1 subgoal):
 1. d div gcd a n * gcd a n = d
[PROOF STEP]
by (rule dvd_div_mult_self)
[PROOF STATE]
proof (state)
this:
d div gcd a n * gcd a n = d

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d div gcd a n * gcd a n = d

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
have "(d div gcd a n) * (a * x) = a * (d div gcd a n * x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d div gcd a n * (a * x) = a * (d div gcd a n * x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d div gcd a n * (a * x) = a * (d div gcd a n * x)

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[a * (d div gcd a n * x) = d] (mod n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[a * (d div gcd a n * x) = d] (mod n)

goal (1 subgoal):
 1. \<exists>x. [a * x = d] (mod n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. [a * x = d] (mod n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iterate_sel_no_map_genord_correct :
assumes it_OK: "set_iterator_genord it S0 R"
shows "iterate_sel_no_map it P = None \<longleftrightarrow> (\<forall>x\<in>S0. \<not>(P x))"
      "iterate_sel_no_map it P = Some x \<Longrightarrow> (x \<in> S0 \<and> P x \<and> (\<forall>x' \<in> S0-{x}. P x' \<longrightarrow> R x x'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iterate_sel_no_map it P = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel_no_map it P = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0 - {x}. P x' \<longrightarrow> R x x'))
[PROOF STEP]
unfolding iterate_sel_no_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iterate_sel it (\<lambda>x. if P x then Some x else None) = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel it (\<lambda>x. if P x then Some x else None) = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0 - {x}. P x' \<longrightarrow> R x x'))
[PROOF STEP]
using iterate_sel_genord_correct[OF it_OK, of "\<lambda>x. if P x then Some x else None"]
[PROOF STATE]
proof (prove)
using this:
(iterate_sel it (\<lambda>x. if P x then Some x else None) = None) = (\<forall>x\<in>S0. (if P x then Some x else None) = None)
iterate_sel it (\<lambda>x. if P x then Some x else None) = Some ?y \<Longrightarrow> \<exists>x\<in>S0. (if P x then Some x else None) = Some ?y \<and> (\<forall>x'\<in>S0 - {x}. \<forall>y. (if P x' then Some x' else None) = Some ?y' \<longrightarrow> R x x')

goal (1 subgoal):
 1. (iterate_sel it (\<lambda>x. if P x then Some x else None) = None) = (\<forall>x\<in>S0. \<not> P x) &&& (iterate_sel it (\<lambda>x. if P x then Some x else None) = Some x \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0 - {x}. P x' \<longrightarrow> R x x'))
[PROOF STEP]
apply (simp_all add: Bex_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>iterate_sel it (\<lambda>x. if P x then Some x else None) = Some x; \<exists>x. x \<in> S0 \<and> (\<exists>y. (if P x then Some x else None) = Some y); \<And>y y'. x = y \<Longrightarrow> \<exists>x. x \<in> S0 \<and> (if P x then Some x else None) = Some y \<and> (\<forall>x'\<in>S0 - {x}. (if P x' then Some x' else None) = Some y' \<longrightarrow> R x x')\<rbrakk> \<Longrightarrow> x \<in> S0 \<and> P x \<and> (\<forall>x'\<in>S0 - {x}. P x' \<longrightarrow> R x x')
[PROOF STEP]
apply (metis option.inject option.simps(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tllist_ord_antisym: "\<lbrakk> tllist_ord xs ys; tllist_ord ys xs \<rbrakk> \<Longrightarrow> xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>local.tllist_ord xs ys; local.tllist_ord ys xs\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
by transfer(auto simp add: flat_ord_def split: if_split_asm intro: lprefix_antisym)


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

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


[STATEMENT]
lemma paramst_subtermTm:
  \<open>\<forall>i \<in> paramst t. \<exists>l. Fun i l \<in> set (subtermTm t)\<close>
  \<open>\<forall>i \<in> paramsts ts. \<exists>l. Fun i l \<in> (\<Union>t \<in> set ts. set (subtermTm t))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>paramst t. \<exists>l. Fun i l \<in> set (subtermTm t) &&& \<forall>i\<in>paramsts ts. \<exists>l. Fun i l \<in> (\<Union>t\<in>set ts. set (subtermTm t))
[PROOF STEP]
by (induct t and ts rule: paramst.induct paramsts.induct) fastforce+


[STATEMENT]
lemma infinite_chain_below[dest]:
    assumes "Complete_Partial_Order.chain ord C" "infinite C" "x \<in> C"
    assumes "finite {y \<in> C. ord x y}"
    shows "infinite {y \<in> C. ord y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {y \<in> C. ord y x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite {y \<in> C. ord y x}
[PROOF STEP]
have 1: "C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}
[PROOF STEP]
using assms(1, 3)
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain ord C
x \<in> C

goal (1 subgoal):
 1. C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}
[PROOF STEP]
by rule
[PROOF STATE]
proof (state)
this:
C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}

goal (1 subgoal):
 1. infinite {y \<in> C. ord y x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite {y \<in> C. ord y x}
[PROOF STEP]
using finite_Un assms(2, 4) 1
[PROOF STATE]
proof (prove)
using this:
finite (?F \<union> ?G) = (finite ?F \<and> finite ?G)
infinite C
finite {y \<in> C. ord x y}
C = {y \<in> C. ord x y} \<union> {y \<in> C. ord y x}

goal (1 subgoal):
 1. infinite {y \<in> C. ord y x}
[PROOF STEP]
by (metis (poly_guards_query))
[PROOF STATE]
proof (state)
this:
infinite {y \<in> C. ord y x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_emb_PiE_same_index[simp]:
    "(\<And>i. i \<in> I \<Longrightarrow> E i \<subseteq> space (M i)) \<Longrightarrow> prod_emb I M I (Pi\<^sub>E I E) = Pi\<^sub>E I E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> E i \<subseteq> space (M i)) \<Longrightarrow> prod_emb I M I (Pi\<^sub>E I E) = Pi\<^sub>E I E
[PROOF STEP]
by (auto simp: prod_emb_def PiE_iff)


[STATEMENT]
lemma rev_alternating_list:
  "rev (alternating_list n s t) =
    (if even n then alternating_list n t s else alternating_list n s t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (alternating_list n s t) = (if even n then alternating_list n t s else alternating_list n s t)
[PROOF STEP]
using alternating_list_SucSuc_ConsCons[of _ s]
[PROOF STATE]
proof (prove)
using this:
alternating_list (Suc (Suc ?k)) s ?t = s # ?t # alternating_list ?k s ?t

goal (1 subgoal):
 1. rev (alternating_list n s t) = (if even n then alternating_list n t s else alternating_list n s t)
[PROOF STEP]
by    (induct n rule: nat_induct_step2) auto


[STATEMENT]
lemma (in group_hom) iso_between_subgroups:
  assumes "h \<in> iso G H" "S \<subseteq> carrier G" "h ` S = T"
  shows "h \<in> iso (subgroup_generated G S) (subgroup_generated H T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> Group.iso (subgroup_generated G S) (subgroup_generated H T)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h \<in> Group.iso G H
S \<subseteq> carrier G
h ` S = T

goal (1 subgoal):
 1. h \<in> Group.iso (subgroup_generated G S) (subgroup_generated H T)
[PROOF STEP]
by (metis G.carrier_subgroup_generated_subset Group.iso_iff hom_between_subgroups inj_on_subset subgroup_generated_by_image subsetI)


[STATEMENT]
lemma snd_quicksort' [simp]: "snd (quicksort' R xs) = qs_cost R xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (quicksort' R xs) = qs_cost R xs
[PROOF STEP]
by (induction R xs rule: quicksort.induct) (simp_all add: case_prod_unfold Let_def o_def)


[STATEMENT]
lemma Qp_res_closed:
  assumes "x \<in> \<O>\<^sub>p"
  shows "Qp_res  x n \<in> carrier (Zp_res_ring n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Qp_res x n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
unfolding Qp_res_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp x n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
using assms val_ring_memE residue_closed to_Zp_closed
[PROOF STATE]
proof (prove)
using this:
x \<in> \<O>\<^sub>p
?a \<in> \<O>\<^sub>p \<Longrightarrow> 0 \<le> val ?a
?a \<in> \<O>\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?b \<in> carrier Z\<^sub>p \<Longrightarrow> ?b ?k \<in> carrier (residue_ring (p ^ ?k))
?a \<in> carrier Q\<^sub>p \<Longrightarrow> to_Zp ?a \<in> carrier Z\<^sub>p

goal (1 subgoal):
 1. to_Zp x n \<in> carrier (residue_ring (p ^ n))
[PROOF STEP]
by blast


[STATEMENT]
lemma (in Ring) npZero_sub: "0 < n \<longrightarrow> npow R \<zero> n = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<longrightarrow> \<zero>^\<^bsup>R n\<^esup> = \<zero>
[PROOF STEP]
apply (induct_tac "n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < 0 \<longrightarrow> \<zero>^\<^bsup>R 0\<^esup> = \<zero>
 2. \<And>n. 0 < n \<longrightarrow> \<zero>^\<^bsup>R n\<^esup> = \<zero> \<Longrightarrow> 0 < Suc n \<longrightarrow> \<zero>^\<^bsup>R Suc n\<^esup> = \<zero>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < n \<longrightarrow> \<zero>^\<^bsup>R n\<^esup> = \<zero> \<Longrightarrow> 0 < Suc n \<longrightarrow> \<zero>^\<^bsup>R Suc n\<^esup> = \<zero>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. 0 < n \<longrightarrow> \<zero>^\<^bsup>R n\<^esup> = \<zero> \<Longrightarrow> \<zero>^\<^bsup>R n\<^esup> \<cdot>\<^sub>r \<zero> = \<zero>
[PROOF STEP]
apply (cut_tac ring_zero,
           frule_tac n = n in npClose[of "\<zero>"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n \<longrightarrow> \<zero>^\<^bsup>R n\<^esup> = \<zero>; \<zero> \<in> carrier R; \<zero>^\<^bsup>R n\<^esup> \<in> carrier R\<rbrakk> \<Longrightarrow> \<zero>^\<^bsup>R n\<^esup> \<cdot>\<^sub>r \<zero> = \<zero>
[PROOF STEP]
apply (simp add:ring_times_x_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done