[STATEMENT]
lemma rGamma_complex_plus1: "z * rGamma (z + 1) = rGamma (z :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
let ?f = "\<lambda>n. (z + 1) * inverse (of_nat n) + 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
have "eventually (\<lambda>n. ?f n * rGamma_series z n = z * rGamma_series (z + 1) n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
using eventually_gt_at_top[of "0::nat"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
assume n: "n > 0"
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
hence "z * rGamma_series (z + 1) n = inverse (of_nat n) *
             pochhammer z (Suc (Suc n)) / (fact n * exp (z * of_real (ln (of_nat n))))"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. z * rGamma_series (z + 1) n = inverse (of_nat n) * pochhammer z (Suc (Suc n)) / (fact n * exp (z * complex_of_real (ln (real n))))
[PROOF STEP]
by (subst pochhammer_rec) (simp add: rGamma_series_def field_simps exp_add exp_of_real)
[PROOF STATE]
proof (state)
this:
z * rGamma_series (z + 1) n = inverse (of_nat n) * pochhammer z (Suc (Suc n)) / (fact n * exp (z * complex_of_real (ln (real n))))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z * rGamma_series (z + 1) n = inverse (of_nat n) * pochhammer z (Suc (Suc n)) / (fact n * exp (z * complex_of_real (ln (real n))))

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
from n
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "\<dots> = ?f n * rGamma_series z n"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. inverse (of_nat n) * pochhammer z (Suc (Suc n)) / (fact n * exp (z * complex_of_real (ln (real n)))) = ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n
[PROOF STEP]
by (subst pochhammer_rec') (simp_all add: field_split_simps rGamma_series_def add_ac)
[PROOF STATE]
proof (state)
this:
inverse (of_nat n) * pochhammer z (Suc (Suc n)) / (fact n * exp (z * complex_of_real (ln (real n)))) = ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n

goal (1 subgoal):
 1. \<And>n. 0 < n \<Longrightarrow> ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
z * rGamma_series (z + 1) n = ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n
[PROOF STEP]
show "?f n * rGamma_series z n = z * rGamma_series (z + 1) n"
[PROOF STATE]
proof (prove)
using this:
z * rGamma_series (z + 1) n = ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n

goal (1 subgoal):
 1. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
have "(\<lambda>n. ?f n * rGamma_series z n) \<longlonglongrightarrow> ((z+1) * 0 + 1) * rGamma z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> ((z + 1) * 0 + 1) * rGamma z
[PROOF STEP]
using rGamma_series_complex_converges
[PROOF STATE]
proof (prove)
using this:
convergent (rGamma_series ?z)

goal (1 subgoal):
 1. (\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> ((z + 1) * 0 + 1) * rGamma z
[PROOF STEP]
by (intro tendsto_intros lim_inverse_n)
       (simp_all add: convergent_LIMSEQ_iff rGamma_complex_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> ((z + 1) * 0 + 1) * rGamma z

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
hence "(\<lambda>n. ?f n * rGamma_series z n) \<longlonglongrightarrow> rGamma z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> ((z + 1) * 0 + 1) * rGamma z

goal (1 subgoal):
 1. (\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> rGamma z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> rGamma z

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
(\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> rGamma z
[PROOF STEP]
have "(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n = z * rGamma_series (z + 1) n
(\<lambda>n. ((z + 1) * inverse (of_nat n) + 1) * rGamma_series z n) \<longlonglongrightarrow> rGamma z

goal (1 subgoal):
 1. (\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z
[PROOF STEP]
by (blast intro: Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
have "(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)
[PROOF STEP]
using rGamma_series_complex_converges
[PROOF STATE]
proof (prove)
using this:
convergent (rGamma_series ?z)

goal (1 subgoal):
 1. (\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)
[PROOF STEP]
by (auto intro!: tendsto_mult simp: rGamma_complex_def convergent_LIMSEQ_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)
[PROOF STEP]
show "z * rGamma (z + 1) = rGamma z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> rGamma z
(\<lambda>n. z * rGamma_series (z + 1) n) \<longlonglongrightarrow> z * rGamma (z + 1)
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. z * rGamma (z + 1) = rGamma z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z * rGamma (z + 1) = rGamma z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_geq_1_eq_neqz: "x\<ge>1 \<longleftrightarrow> x\<noteq>(0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 \<le> x) = (x \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma plus_dim1[simp]: "dims A = dims B \<Longrightarrow> dims (A + B) = dims A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> dims (A + B) = dims A
[PROOF STEP]
unfolding plus_def plus_base_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> dims (if dims A = dims B then tensor_from_vec (dims A) (vec_plus (vec A) (vec B)) else undefined) = dims A
[PROOF STEP]
using dims_tensor length_vec length_map map_fst_zip vec_plus_def
[PROOF STATE]
proof (prove)
using this:
length ?v = prod_list ?d \<Longrightarrow> dims (tensor_from_vec ?d ?v) = ?d
length (vec ?A) = prod_list (dims ?A)
length (map ?f ?xs) = length ?xs
length ?xs = length ?ys \<Longrightarrow> map fst (zip ?xs ?ys) = ?xs
vec_plus ?a ?b = map2 (+) ?a ?b

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> dims (if dims A = dims B then tensor_from_vec (dims A) (vec_plus (vec A) (vec B)) else undefined) = dims A
[PROOF STEP]
by (metis (full_types))


[STATEMENT]
lemma choose_row_sum_set:
  assumes "finite (\<Union>F)"
  shows "card {S. S \<subseteq> \<Union>F \<and> card S \<le> k} = (\<Sum>i\<le>k. card (\<Union> F) choose i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k}
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> 0} = sum ((choose) (card (\<Union> F))) {..0}
 2. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> 0} = sum ((choose) (card (\<Union> F))) {..0}
 2. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
from rev_finite_subset[OF assms]
[PROOF STATE]
proof (chain)
picking this:
?A \<subseteq> \<Union> F \<Longrightarrow> finite ?A
[PROOF STEP]
have "S \<subseteq> \<Union>F \<and> card S \<le> 0 \<longleftrightarrow> S = {}" for S
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> \<Union> F \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. (S \<subseteq> \<Union> F \<and> card S \<le> 0) = (S = {})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(?S \<subseteq> \<Union> F \<and> card ?S \<le> 0) = (?S = {})

goal (2 subgoals):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> 0} = sum ((choose) (card (\<Union> F))) {..0}
 2. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?S \<subseteq> \<Union> F \<and> card ?S \<le> 0) = (?S = {})
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(?S \<subseteq> \<Union> F \<and> card ?S \<le> 0) = (?S = {})

goal (1 subgoal):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> 0} = sum ((choose) (card (\<Union> F))) {..0}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> 0} = sum ((choose) (card (\<Union> F))) {..0}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
let ?FS = "{S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k}"
  and ?F_Asm = "{S. S \<subseteq> \<Union> F \<and> card S \<le> k}"
  and ?F_Step = "{S. S \<subseteq> \<Union> F \<and> card S = Suc k}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
from finite_Pow_iff[of "\<Union>F"] assms
[PROOF STATE]
proof (chain)
picking this:
finite (Pow (\<Union> F)) = finite (\<Union> F)
finite (\<Union> F)
[PROOF STEP]
have finite_Pow_Un_F: "finite (Pow (\<Union> F))"
[PROOF STATE]
proof (prove)
using this:
finite (Pow (\<Union> F)) = finite (\<Union> F)
finite (\<Union> F)

goal (1 subgoal):
 1. finite (Pow (\<Union> F))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
finite (Pow (\<Union> F))

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
have "?F_Asm \<subseteq> Pow (\<Union> F)" and "?F_Step \<subseteq> Pow (\<Union> F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<subseteq> Pow (\<Union> F) &&& {S. S \<subseteq> \<Union> F \<and> card S = Suc k} \<subseteq> Pow (\<Union> F)
[PROOF STEP]
by fast+
[PROOF STATE]
proof (state)
this:
{S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<subseteq> Pow (\<Union> F)
{S. S \<subseteq> \<Union> F \<and> card S = Suc k} \<subseteq> Pow (\<Union> F)

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
with rev_finite_subset[OF finite_Pow_Un_F]
[PROOF STATE]
proof (chain)
picking this:
?A \<subseteq> Pow (\<Union> F) \<Longrightarrow> finite ?A
{S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<subseteq> Pow (\<Union> F)
{S. S \<subseteq> \<Union> F \<and> card S = Suc k} \<subseteq> Pow (\<Union> F)
[PROOF STEP]
have finite_F_Asm: "finite ?F_Asm" and finite_F_Step: "finite ?F_Step"
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> Pow (\<Union> F) \<Longrightarrow> finite ?A
{S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<subseteq> Pow (\<Union> F)
{S. S \<subseteq> \<Union> F \<and> card S = Suc k} \<subseteq> Pow (\<Union> F)

goal (1 subgoal):
 1. finite {S. S \<subseteq> \<Union> F \<and> card S \<le> k} &&& finite {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
[PROOF STEP]
by presburger+
[PROOF STATE]
proof (state)
this:
finite {S. S \<subseteq> \<Union> F \<and> card S \<le> k}
finite {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
have F_Un: "?FS = ?F_Asm \<union> ?F_Step"  and F_disjoint: "?F_Asm \<inter> ?F_Step = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k} &&& {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<inter> {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = {}
[PROOF STEP]
by fastforce+
[PROOF STATE]
proof (state)
this:
{S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
{S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<inter> {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = {}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
from card_Un_disjoint[OF finite_F_Asm finite_F_Step F_disjoint] F_Un
[PROOF STATE]
proof (chain)
picking this:
card ({S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k}) = card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
{S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
[PROOF STEP]
have "card ?FS = card ?F_Asm + card ?F_Step"
[PROOF STATE]
proof (prove)
using this:
card ({S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k}) = card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
{S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = {S. S \<subseteq> \<Union> F \<and> card S \<le> k} \<union> {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k}
[PROOF STEP]
have "... = (\<Sum>i\<le>k. card (\<Union> F) choose i) + card ?F_Step"
[PROOF STATE]
proof (prove)
using this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k}

goal (1 subgoal):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = sum ((choose) (card (\<Union> F))) {..k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}
[PROOF STEP]
by argo
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = sum ((choose) (card (\<Union> F))) {..k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = sum ((choose) (card (\<Union> F))) {..k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
from n_subsets[OF assms, of "Suc k"]
[PROOF STATE]
proof (chain)
picking this:
card {B. B \<subseteq> \<Union> F \<and> card B = Suc k} = card (\<Union> F) choose Suc k
[PROOF STEP]
have "... = (\<Sum>i\<le>Suc k. card (\<Union> F) choose i)"
[PROOF STATE]
proof (prove)
using this:
card {B. B \<subseteq> \<Union> F \<and> card B = Suc k} = card (\<Union> F) choose Suc k

goal (1 subgoal):
 1. sum ((choose) (card (\<Union> F))) {..k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
sum ((choose) (card (\<Union> F))) {..k} + card {S. S \<subseteq> \<Union> F \<and> card S = Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}

goal (1 subgoal):
 1. \<And>k. card {S. S \<subseteq> \<Union> F \<and> card S \<le> k} = sum ((choose) (card (\<Union> F))) {..k} \<Longrightarrow> card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}

goal (1 subgoal):
 1. card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card {S. S \<subseteq> \<Union> F \<and> card S \<le> Suc k} = sum ((choose) (card (\<Union> F))) {..Suc k}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_row_mat_diag[simp]: "dim_row (mat_diag n f) = n" and
      dim_col_mat_diag[simp]: "dim_col (mat_diag n f) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat_diag n f) = n &&& dim_col (mat_diag n f) = n
[PROOF STEP]
using mat_diag_dim
[PROOF STATE]
proof (prove)
using this:
mat_diag ?n ?f \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. dim_row (mat_diag n f) = n &&& dim_col (mat_diag n f) = n
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
mat_diag ?n ?f \<in> {m. dim_row m = ?n \<and> dim_col m = ?n}

goal (1 subgoal):
 1. dim_row (mat_diag n f) = n &&& dim_col (mat_diag n f) = n
[PROOF STEP]
by auto+


[STATEMENT]
lemma Cauchy_next_derivative_circlepath:
  assumes contf: "continuous_on (path_image (circlepath z r)) f"
      and int: "\<And>w. w \<in> ball z r \<Longrightarrow> ((\<lambda>u. f u / (u - w)^k) has_contour_integral g w) (circlepath z r)"
      and k: "k \<noteq> 0"
      and w: "w \<in> ball z r"
    shows "(\<lambda>u. f u / (u - w)^(Suc k)) contour_integrable_on (circlepath z r)"
           (is "?thes1")
      and "(g has_field_derivative (k * contour_integral (circlepath z r) (\<lambda>u. f u/(u - w)^(Suc k)))) (at w)"
           (is "?thes2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r &&& (g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
 2. (g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)
[PROOF STEP]
have "r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using ball_eq_empty
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r
(ball ?x ?e = {}) = (?e \<le> 0)

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

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
 2. (g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)
[PROOF STEP]
have wim: "w \<in> ball z r - path_image (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> ball z r - path_image (circlepath z r)
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> ball z r

goal (1 subgoal):
 1. w \<in> ball z r - path_image (circlepath z r)
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
w \<in> ball z r - path_image (circlepath z r)

goal (2 subgoals):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
 2. (g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)
[PROOF STEP]
show ?thes1 ?thes2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r &&& (g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)
[PROOF STEP]
by (rule Cauchy_next_derivative [OF contf _ int k open_ball valid_path_circlepath wim, where B = "2 * pi * \<bar>r\<bar>"];
        auto simp: vector_derivative_circlepath norm_mult)+
[PROOF STATE]
proof (state)
this:
(\<lambda>u. f u / (u - w) ^ Suc k) contour_integrable_on circlepath z r
(g has_field_derivative of_nat k * contour_integral (circlepath z r) (\<lambda>u. f u / (u - w) ^ Suc k)) (at w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma an_npn:"an (n + m) = an n + an m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. an (n + m) = an n + an m
[PROOF STEP]
by (unfold an_def, simp add:a_zpz)


[STATEMENT]
lemma aux2_digit_lt_linear:
  fixes a b c d t l :: nat
  shows "\<exists>k. (a * 2^t) \<exclamdown> k \<le> (c * 2^t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
define k where "k = l + t"
[PROOF STATE]
proof (state)
this:
k = l + t

goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
have "(a * 2^t) \<exclamdown> k = a \<exclamdown> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l
[PROOF STEP]
using nth_bit_def k_def
[PROOF STATE]
proof (prove)
using this:
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2
k = l + t

goal (1 subgoal):
 1. (a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l
[PROOF STEP]
using aux_digit_shift
[PROOF STATE]
proof (prove)
using this:
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2
k = l + t
(?a * 2 ^ ?t) \<exclamdown> (?l + ?t) = ?a \<exclamdown> ?l

goal (1 subgoal):
 1. (a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l

goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l

goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
have "(c * 2^t) \<exclamdown> k = c \<exclamdown> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l
[PROOF STEP]
using nth_bit_def k_def
[PROOF STATE]
proof (prove)
using this:
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2
k = l + t

goal (1 subgoal):
 1. (c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l
[PROOF STEP]
using aux_digit_shift
[PROOF STATE]
proof (prove)
using this:
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2
k = l + t
(?a * 2 ^ ?t) \<exclamdown> (?l + ?t) = ?a \<exclamdown> ?l

goal (1 subgoal):
 1. (c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l

goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l
(c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * 2 ^ t) \<exclamdown> k = a \<exclamdown> l
(c * 2 ^ t) \<exclamdown> k = c \<exclamdown> l

goal (1 subgoal):
 1. \<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>k. (a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<longrightarrow> a \<exclamdown> l \<le> c \<exclamdown> l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ncg_trans: "\<lbrakk>ncg x y; ncg y z\<rbrakk> \<Longrightarrow> ncg x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ncg x y; ncg y z\<rbrakk> \<Longrightarrow> ncg x z
[PROOF STEP]
using ncg_def
[PROOF STATE]
proof (prove)
using this:
ncg ?x ?y = (\<nu> ?x \<le> \<nu> ?y \<and> \<nu> ?y \<le> \<nu> ?x)

goal (1 subgoal):
 1. \<lbrakk>ncg x y; ncg y z\<rbrakk> \<Longrightarrow> ncg x z
[PROOF STEP]
by force


[STATEMENT]
lemma list_contains_last_take :
  assumes "x \<in> set xs"
  shows "\<exists> i . 0 < i \<and> i \<le> length xs \<and> last (take i xs) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i>0. i \<le> length xs \<and> last (take i xs) = x
[PROOF STEP]
by (metis Suc_leI assms hd_drop_conv_nth in_set_conv_nth last_snoc take_hd_drop zero_less_Suc)


[STATEMENT]
lemma inconsistent_imp_solve_eq_none:
  fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
  assumes con: "inconsistent A b"
  shows "solve A b = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solve A b = None
[PROOF STEP]
unfolding solve_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None) = None
[PROOF STEP]
unfolding if_not_P[OF con[unfolded inconsistent_def]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. None = None
[PROOF STEP]
..


[STATEMENT]
lemma fib_rec:
  "fib n =
    (if n = 0 then 0 else if n = 1 then 1
     else if even n then let n' = n div 2; fn = fib n' in (2 * fib (n' - 1) + fn) * fn
     else let n' = n div 2 in fib n' ^ 2 + fib (Suc n') ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib n = (if n = 0 then 0 else if n = 1 then 1 else if even n then let n' = n div 2; fn = fib n' in (2 * fib (n' - 1) + fn) * fn else let n' = n div 2 in (fib n')\<^sup>2 + (fib (Suc n'))\<^sup>2)
[PROOF STEP]
by (auto elim: evenE oddE simp: fib_rec_odd fib_rec_even' Let_def)


[STATEMENT]
lemma openin_discrete_topology [simp]: "openin (discrete_topology U) S \<longleftrightarrow> S \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (discrete_topology U) S = (S \<subseteq> U)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. openin (discrete_topology U) S = (S \<subseteq> U)
[PROOF STEP]
have "istopology (\<lambda>S. S \<subseteq> U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. istopology (\<lambda>S. S \<subseteq> U)
[PROOF STEP]
by (auto simp: istopology_def)
[PROOF STATE]
proof (state)
this:
istopology (\<lambda>S. S \<subseteq> U)

goal (1 subgoal):
 1. openin (discrete_topology U) S = (S \<subseteq> U)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
istopology (\<lambda>S. S \<subseteq> U)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
istopology (\<lambda>S. S \<subseteq> U)

goal (1 subgoal):
 1. openin (discrete_topology U) S = (S \<subseteq> U)
[PROOF STEP]
by (simp add: discrete_topology_def topology_inverse')
[PROOF STATE]
proof (state)
this:
openin (discrete_topology U) S = (S \<subseteq> U)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem TBtheorem3b:
assumes "\<not> (ineM P M E)"
       and "\<not> (ineM Q M E)"
       and "subcomponents PQ = {P,Q}"
       and "correctCompositionIn PQ"
shows    "\<not> (ineM PQ M E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> ineM PQ M E
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> ineM P M E
\<not> ineM Q M E
subcomponents PQ = {P, Q}
correctCompositionIn PQ

goal (1 subgoal):
 1. \<not> ineM PQ M E
[PROOF STEP]
by (metis TBtheorem1b)


[STATEMENT]
theorem space_bound: assumes "invar_vebt t n" "u = 2^n"
  shows "space t \<le> 12 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space t \<le> 12 * u
[PROOF STEP]
by (metis assms(1) assms(2) dual_order.trans less_imp_le_nat space'_bound space_space')


[STATEMENT]
lemma lset_subset: "\<not>(lset xs \<subseteq> A) \<Longrightarrow> \<exists>n. enat n < llength xs \<and> lnth xs n \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> lset xs \<subseteq> A \<Longrightarrow> \<exists>n. enat n < llength xs \<and> lnth xs n \<notin> A
[PROOF STEP]
by (metis in_lset_conv_lnth subsetI)


[STATEMENT]
lemma measure_nonneg' [simp]: "\<not> measure M A < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Sigma_Algebra.measure M A < 0
[PROOF STEP]
using measure_nonneg not_le
[PROOF STATE]
proof (prove)
using this:
0 \<le> Sigma_Algebra.measure ?M ?A
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. \<not> Sigma_Algebra.measure M A < 0
[PROOF STEP]
by blast


[STATEMENT]
lemma of_int_floor_le [simp]: "of_int \<lfloor>x\<rfloor> \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
using floor_correct
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>?x\<rfloor> \<le> ?x \<and> ?x < of_int (\<lfloor>?x\<rfloor> + 1)

goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
..


[STATEMENT]
theorem nat_to_list_th [simp]: "nat_to_list (list_to_nat ls) = ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
have S1: "ls=[] \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ls = [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
by (simp add: nat_to_list_def list_to_nat_def)
[PROOF STATE]
proof (state)
this:
ls = [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls

goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
have S2: "ls \<noteq> [] \<Longrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
assume A1: "ls \<noteq> []"
[PROOF STATE]
proof (state)
this:
ls \<noteq> []

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
define u where "u = list_to_nat ls"
[PROOF STATE]
proof (state)
this:
u = list_to_nat ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from u_def A1
[PROOF STATE]
proof (chain)
picking this:
u = list_to_nat ls
ls \<noteq> []
[PROOF STEP]
have S2_1: "u = (c_pair ((length ls)-(1::nat)) (c_fold ls))+1"
[PROOF STATE]
proof (prove)
using this:
u = list_to_nat ls
ls \<noteq> []

goal (1 subgoal):
 1. u = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
by (simp add: list_to_nat_def)
[PROOF STATE]
proof (state)
this:
u = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
let ?k = "length ls"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
ls \<noteq> []
[PROOF STEP]
have S2_2: "?k > 0"
[PROOF STATE]
proof (prove)
using this:
ls \<noteq> []

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

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from S2_1
[PROOF STATE]
proof (chain)
picking this:
u = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
have S2_3: "u>0"
[PROOF STATE]
proof (prove)
using this:
u = c_pair (length ls - 1) (c_fold ls) + 1

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

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from S2_3
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have S2_4: "nat_to_list u = c_unfold (c_len u) (c_snd (u-(1::nat)))"
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. nat_to_list u = c_unfold (c_len u) (c_snd (u - 1))
[PROOF STEP]
by (simp add: nat_to_list_def)
[PROOF STATE]
proof (state)
this:
nat_to_list u = c_unfold (c_len u) (c_snd (u - 1))

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
have S2_5: "c_len u = length ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
from S2_1
[PROOF STATE]
proof (chain)
picking this:
u = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
have S2_5_1: "u-(1::nat) = c_pair ((length ls)-(1::nat)) (c_fold ls)"
[PROOF STATE]
proof (prove)
using this:
u = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. u - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
from S2_5_1
[PROOF STATE]
proof (chain)
picking this:
u - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
have S2_5_2: "c_fst (u-(1::nat)) = (length ls)-(1::nat)"
[PROOF STATE]
proof (prove)
using this:
u - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. c_fst (u - 1) = length ls - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_fst (u - 1) = length ls - 1

goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
from S2_2 S2_5_2
[PROOF STATE]
proof (chain)
picking this:
0 < length ls
c_fst (u - 1) = length ls - 1
[PROOF STEP]
have "c_fst (u-(1::nat))+1 = length ls"
[PROOF STATE]
proof (prove)
using this:
0 < length ls
c_fst (u - 1) = length ls - 1

goal (1 subgoal):
 1. c_fst (u - 1) + 1 = length ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_fst (u - 1) + 1 = length ls

goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
from S2_3 this
[PROOF STATE]
proof (chain)
picking this:
0 < u
c_fst (u - 1) + 1 = length ls
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < u
c_fst (u - 1) + 1 = length ls

goal (1 subgoal):
 1. c_len u = length ls
[PROOF STEP]
by (simp add: c_len_2)
[PROOF STATE]
proof (state)
this:
c_len u = length ls

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c_len u = length ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
have S2_6: "c_snd (u-(1::nat)) = c_fold ls"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_snd (u - 1) = c_fold ls
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_snd (u - 1) = c_fold ls
[PROOF STEP]
from S2_1
[PROOF STATE]
proof (chain)
picking this:
u = c_pair (length ls - 1) (c_fold ls) + 1
[PROOF STEP]
have S2_6_1: "u-(1::nat) = c_pair ((length ls)-(1::nat)) (c_fold ls)"
[PROOF STATE]
proof (prove)
using this:
u = c_pair (length ls - 1) (c_fold ls) + 1

goal (1 subgoal):
 1. u - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. c_snd (u - 1) = c_fold ls
[PROOF STEP]
from S2_6_1
[PROOF STATE]
proof (chain)
picking this:
u - 1 = c_pair (length ls - 1) (c_fold ls)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u - 1 = c_pair (length ls - 1) (c_fold ls)

goal (1 subgoal):
 1. c_snd (u - 1) = c_fold ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c_snd (u - 1) = c_fold ls

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
c_snd (u - 1) = c_fold ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from S2_4 S2_5 S2_6
[PROOF STATE]
proof (chain)
picking this:
nat_to_list u = c_unfold (c_len u) (c_snd (u - 1))
c_len u = length ls
c_snd (u - 1) = c_fold ls
[PROOF STEP]
have S2_7:"nat_to_list u = c_unfold (length ls) (c_fold ls)"
[PROOF STATE]
proof (prove)
using this:
nat_to_list u = c_unfold (c_len u) (c_snd (u - 1))
c_len u = length ls
c_snd (u - 1) = c_fold ls

goal (1 subgoal):
 1. nat_to_list u = c_unfold (length ls) (c_fold ls)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_list u = c_unfold (length ls) (c_fold ls)

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from S2_7
[PROOF STATE]
proof (chain)
picking this:
nat_to_list u = c_unfold (length ls) (c_fold ls)
[PROOF STEP]
have "nat_to_list u = ls"
[PROOF STATE]
proof (prove)
using this:
nat_to_list u = c_unfold (length ls) (c_fold ls)

goal (1 subgoal):
 1. nat_to_list u = ls
[PROOF STEP]
by (simp add: th_3)
[PROOF STATE]
proof (state)
this:
nat_to_list u = ls

goal (1 subgoal):
 1. ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from u_def this
[PROOF STATE]
proof (chain)
picking this:
u = list_to_nat ls
nat_to_list u = ls
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u = list_to_nat ls
nat_to_list u = ls

goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat_to_list (list_to_nat ls) = ls

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls

goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
have S3: "ls = [] \<or> ls \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ls = [] \<or> ls \<noteq> []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ls = [] \<or> ls \<noteq> []

goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
from S1 S2 S3
[PROOF STATE]
proof (chain)
picking this:
ls = [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
ls = [] \<or> ls \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ls = [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
ls \<noteq> [] \<Longrightarrow> nat_to_list (list_to_nat ls) = ls
ls = [] \<or> ls \<noteq> []

goal (1 subgoal):
 1. nat_to_list (list_to_nat ls) = ls
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nat_to_list (list_to_nat ls) = ls

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powsum_split: "x\<^bsub>m\<^esub>\<^bsup>i+Suc n\<^esup> = x\<^bsub>m\<^esub>\<^bsup>i\<^esup> + x\<^bsub>m+Suc i\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>m\<^esub>\<^bsup>i + Suc n\<^esup> = x\<^bsub>m\<^esub>\<^bsup>i\<^esup> + x\<^bsub>m + Suc i\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by (induct n, simp_all add:powsum_simps ac_simps)


[STATEMENT]
lemma real2_eq:
  fixes u v :: "real^2"
  assumes "u$1 = v$1" and "u$2 = v$2"
  shows "u = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = v
[PROOF STEP]
by (simp add: vec_eq_iff [of u v] forall_2 assms)