[STATEMENT]
theorem (in vectorspace) replacement:
  fixes A B (*A B are lists of vectors (colloquially we refer to them as sets)*)
  assumes h1: "finite A"
      and h2: "finite B"
      and h3: "B\<subseteq>carrier V"
      and h4: "lin_indpt A" (*A is linearly independent*)
      and h5: "A\<subseteq>span B" (*All entries of A are in K*)
  shows "\<exists>C. finite C \<and> C\<subseteq>carrier V \<and> C\<subseteq>span B \<and> C\<inter>A={} \<and> int (card C) \<le> (int (card B)) - (int (card A)) \<and> (span (A \<union> C) = span B)"
  (is "\<exists>C. ?P A B C")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*There is a set C of cardinality |B| - |A| such that A\<union>C generates V*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
using h1 h2 h3 h4 h5
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B

goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
proof (induct "card A" arbitrary: A B)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A B. \<lbrakk>0 = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 = card A
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B

goal (2 subgoals):
 1. \<And>A B. \<lbrakk>0 = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from "0.prems"(1) "0.hyps"
[PROOF STATE]
proof (chain)
picking this:
finite A
0 = card A
[PROOF STEP]
have a0: "A={}"
[PROOF STATE]
proof (prove)
using this:
finite A
0 = card A

goal (1 subgoal):
 1. A = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = {}

goal (2 subgoals):
 1. \<And>A B. \<lbrakk>0 = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from "0.prems"(3)
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> carrier V
[PROOF STEP]
have a3: "B\<subseteq>span B"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> carrier V

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

goal (2 subgoals):
 1. \<And>A B. \<lbrakk>0 = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from a0 a3 "0.prems"
[PROOF STATE]
proof (chain)
picking this:
A = {}
B \<subseteq> span B
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A = {}
B \<subseteq> span B
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B

goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
by (rule_tac x="B" in exI, auto)
[PROOF STATE]
proof (state)
this:
\<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
\<lbrakk>m = card ?A1; finite ?A1; finite ?B1; ?B1 \<subseteq> carrier V; lin_indpt ?A1; ?A1 \<subseteq> span ?B1\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span ?B1 \<and> C \<inter> ?A1 = {} \<and> int (card C) \<le> int (card ?B1) - int (card ?A1) \<and> span (?A1 \<union> C) = span ?B1
Suc m = card A
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
let ?W="span B"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from Suc.prems(3)
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> carrier V
[PROOF STEP]
have BinC: "span B\<subseteq>carrier V"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> carrier V

goal (1 subgoal):
 1. span B \<subseteq> carrier V
[PROOF STEP]
by (rule span_is_subset2)
[PROOF STATE]
proof (state)
this:
span B \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*everything you want to know about A*)
[PROOF STATE]
proof (state)
this:
span B \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from Suc.prems Suc.hyps BinC
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
\<lbrakk>m = card ?A1; finite ?A1; finite ?B1; ?B1 \<subseteq> carrier V; lin_indpt ?A1; ?A1 \<subseteq> span ?B1\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span ?B1 \<and> C \<inter> ?A1 = {} \<and> int (card C) \<le> int (card ?B1) - int (card ?A1) \<and> span (?A1 \<union> C) = span ?B1
Suc m = card A
span B \<subseteq> carrier V
[PROOF STEP]
have A: "finite A" "lin_indpt A" "A\<subseteq>span B" "Suc m = card A" "A\<subseteq>carrier V"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
\<lbrakk>m = card ?A1; finite ?A1; finite ?B1; ?B1 \<subseteq> carrier V; lin_indpt ?A1; ?A1 \<subseteq> span ?B1\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span ?B1 \<and> C \<inter> ?A1 = {} \<and> int (card C) \<le> int (card ?B1) - int (card ?A1) \<and> span (?A1 \<union> C) = span ?B1
Suc m = card A
span B \<subseteq> carrier V

goal (1 subgoal):
 1. (finite A &&& lin_indpt A) &&& A \<subseteq> span B &&& Suc m = card A &&& A \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*everything you want to know about B*)
[PROOF STATE]
proof (state)
this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from Suc.prems
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
[PROOF STEP]
have B: "finite B" "B\<subseteq>carrier V"
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B

goal (1 subgoal):
 1. finite B &&& B \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite B
B \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*A B are lists of vectors (colloquially we refer to them as sets)*)
[PROOF STATE]
proof (state)
this:
finite B
B \<subseteq> carrier V

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from Suc.hyps(2)
[PROOF STATE]
proof (chain)
picking this:
Suc m = card A
[PROOF STEP]
obtain v where v: "v\<in>A"
[PROOF STATE]
proof (prove)
using this:
Suc m = card A

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

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
let ?A'="A-{v}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*?A' is linearly independent because it is the subset of a linearly independent set, A.*)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from A(2)
[PROOF STATE]
proof (chain)
picking this:
lin_indpt A
[PROOF STEP]
have liA': "lin_indpt ?A'"
[PROOF STATE]
proof (prove)
using this:
lin_indpt A

goal (1 subgoal):
 1. lin_indpt (A - {v})
[PROOF STEP]
apply (intro subset_li_is_li[of "A" "?A'"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lin_indpt A \<Longrightarrow> lin_indpt A
 2. lin_indpt A \<Longrightarrow> A - {v} \<subseteq> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (A - {v})

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from v liA' Suc.prems Suc.hyps(2)
[PROOF STATE]
proof (chain)
picking this:
v \<in> A
lin_indpt (A - {v})
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
Suc m = card A
[PROOF STEP]
have "\<exists>C'. ?P ?A' B C'"
[PROOF STATE]
proof (prove)
using this:
v \<in> A
lin_indpt (A - {v})
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
Suc m = card A

goal (1 subgoal):
 1. \<exists>C'. finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
[PROOF STEP]
apply (intro Suc.hyps(1))
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> m = card (A - {v})
 2. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> finite (A - {v})
 3. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> finite B
 4. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> B \<subseteq> carrier V
 5. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> lin_indpt (A - {v})
 6. \<lbrakk>v \<in> A; lin_indpt (A - {v}); finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; Suc m = card A\<rbrakk> \<Longrightarrow> A - {v} \<subseteq> span B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>C'. finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>C'. finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
[PROOF STEP]
obtain C' where C': "?P ?A' B C'"
[PROOF STATE]
proof (prove)
using this:
\<exists>C'. finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B

goal (1 subgoal):
 1. (\<And>C'. finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B

goal (1 subgoal):
 1. \<And>x A B. \<lbrakk>\<And>A B. \<lbrakk>x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc x = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
proof (cases "v\<in> C'")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v \<in> C'

goal (2 subgoals):
 1. v \<in> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
have vinC': "v\<in>C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> C'
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
v \<in> C'

goal (2 subgoals):
 1. v \<in> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from vinC' v
[PROOF STATE]
proof (chain)
picking this:
v \<in> C'
v \<in> A
[PROOF STEP]
have seteq: "A - {v} \<union> C' = A \<union> (C' - {v})"
[PROOF STATE]
proof (prove)
using this:
v \<in> C'
v \<in> A

goal (1 subgoal):
 1. A - {v} \<union> C' = A \<union> (C' - {v})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A - {v} \<union> C' = A \<union> (C' - {v})

goal (2 subgoals):
 1. v \<in> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from C' seteq
[PROOF STATE]
proof (chain)
picking this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
A - {v} \<union> C' = A \<union> (C' - {v})
[PROOF STEP]
have spaneq: "span (A \<union> (C' - {v})) = span (B)"
[PROOF STATE]
proof (prove)
using this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
A - {v} \<union> C' = A \<union> (C' - {v})

goal (1 subgoal):
 1. span (A \<union> (C' - {v})) = span B
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {v})) = span B

goal (2 subgoals):
 1. v \<in> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
 2. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from Suc.prems Suc.hyps C' vinC' v spaneq
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
\<lbrakk>m = card ?A1; finite ?A1; finite ?B1; ?B1 \<subseteq> carrier V; lin_indpt ?A1; ?A1 \<subseteq> span ?B1\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span ?B1 \<and> C \<inter> ?A1 = {} \<and> int (card C) \<le> int (card ?B1) - int (card ?A1) \<and> span (?A1 \<union> C) = span ?B1
Suc m = card A
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> C'
v \<in> A
span (A \<union> (C' - {v})) = span B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
B \<subseteq> carrier V
lin_indpt A
A \<subseteq> span B
\<lbrakk>m = card ?A1; finite ?A1; finite ?B1; ?B1 \<subseteq> carrier V; lin_indpt ?A1; ?A1 \<subseteq> span ?B1\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span ?B1 \<and> C \<inter> ?A1 = {} \<and> int (card C) \<le> int (card ?B1) - int (card ?A1) \<and> span (?A1 \<union> C) = span ?B1
Suc m = card A
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> C'
v \<in> A
span (A \<union> (C' - {v})) = span B

goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
apply (rule_tac x="C'-{v}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; \<And>A B. \<lbrakk>m = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc m = card A; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> C'; v \<in> A; span (A \<union> (C' - {v})) = span B\<rbrakk> \<Longrightarrow> finite (C' - {v}) \<and> C' - {v} \<subseteq> carrier V \<and> C' - {v} \<subseteq> span B \<and> (C' - {v}) \<inter> A = {} \<and> int (card (C' - {v})) \<le> int (card B) - int (card A) \<and> span (A \<union> (C' - {v})) = span B
[PROOF STEP]
apply (subgoal_tac "card C' >0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; \<And>A B. \<lbrakk>m = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc m = card A; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> C'; v \<in> A; span (A \<union> (C' - {v})) = span B; 0 < card C'\<rbrakk> \<Longrightarrow> finite (C' - {v}) \<and> C' - {v} \<subseteq> carrier V \<and> C' - {v} \<subseteq> span B \<and> (C' - {v}) \<inter> A = {} \<and> int (card (C' - {v})) \<le> int (card B) - int (card A) \<and> span (A \<union> (C' - {v})) = span B
 2. \<lbrakk>finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B; \<And>A B. \<lbrakk>m = card A; finite A; finite B; B \<subseteq> carrier V; lin_indpt A; A \<subseteq> span B\<rbrakk> \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B; Suc m = card A; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> C'; v \<in> A; span (A \<union> (C' - {v})) = span B\<rbrakk> \<Longrightarrow> 0 < card C'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<notin> C'

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
have f: "v\<notin>C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> C'
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
v \<notin> C'

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from A v C'
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
v \<in> A
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
[PROOF STEP]
have "\<exists>a. a\<in>(?A'\<union>C')\<rightarrow>carrier K \<and>  lincomb a (?A' \<union> C') =v"
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
v \<in> A
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B

goal (1 subgoal):
 1. \<exists>a. a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> lincomb a (A - {v} \<union> C') = v
[PROOF STEP]
by (intro finite_in_span, auto)
[PROOF STATE]
proof (state)
this:
\<exists>a. a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> lincomb a (A - {v} \<union> C') = v

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> lincomb a (A - {v} \<union> C') = v
[PROOF STEP]
obtain a where a: "a\<in>(?A'\<union>C')\<rightarrow>carrier K \<and> v= lincomb a (?A' \<union> C')"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> lincomb a (A - {v} \<union> C') = v

goal (1 subgoal):
 1. (\<And>a. a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C') \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C')

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
let ?b="(\<lambda> w. if (w=v) then \<ominus>\<^bsub>K\<^esub>\<one>\<^bsub>K\<^esub> else a w)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C')
[PROOF STEP]
have b: "?b\<in>A\<union>C'\<rightarrow>carrier K"
[PROOF STATE]
proof (prove)
using this:
a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C')

goal (1 subgoal):
 1. (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from v
[PROOF STATE]
proof (chain)
picking this:
v \<in> A
[PROOF STEP]
have rewrite_ins: "A\<union>C'=(?A'\<union>C')\<union>{v}"
[PROOF STATE]
proof (prove)
using this:
v \<in> A

goal (1 subgoal):
 1. A \<union> C' = A - {v} \<union> C' \<union> {v}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> C' = A - {v} \<union> C' \<union> {v}

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
v \<notin> C'
[PROOF STEP]
have "v\<notin>?A'\<union>C'"
[PROOF STATE]
proof (prove)
using this:
v \<notin> C'

goal (1 subgoal):
 1. v \<notin> A - {v} \<union> C'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<notin> A - {v} \<union> C'

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from this A C' v a f
[PROOF STATE]
proof (chain)
picking this:
v \<notin> A - {v} \<union> C'
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> A
a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C')
v \<notin> C'
[PROOF STEP]
have lcb: "lincomb ?b (A \<union> C') = \<zero>\<^bsub>V\<^esub>"
[PROOF STATE]
proof (prove)
using this:
v \<notin> A - {v} \<union> C'
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> A
a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C')
v \<notin> C'

goal (1 subgoal):
 1. lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
apply (subst rewrite_ins)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A - {v} \<union> C' \<union> {v}) = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
apply (subst lincomb_insert)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> finite (A - {v} \<union> C')
 2. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> A - {v} \<union> C' \<subseteq> carrier V
 3. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A - {v} \<union> C' \<union> {v} \<rightarrow> carrier K
 4. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> v \<notin> A - {v} \<union> C'
 5. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> v \<in> carrier V
 6. \<lbrakk>v \<notin> A - {v} \<union> C'; finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<union> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> (if v = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a v) \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A - {v} \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
apply (simp_all add: ring_subset_carrier coeff_in_ring)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card A - Suc 0) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<rightarrow> carrier K \<and> a \<in> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> A - {v} \<subseteq> carrier V
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card A - Suc 0) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<rightarrow> carrier K \<and> a \<in> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A - {v} \<rightarrow> carrier K \<and> (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> C' \<rightarrow> carrier K
 3. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card A - Suc 0) \<and> span (A - {v} \<union> C') = span B; v \<in> A; a \<in> A - {v} \<rightarrow> carrier K \<and> a \<in> C' \<rightarrow> carrier K \<and> v = lincomb a (A - {v} \<union> C'); v \<notin> C'\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A - {v} \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
apply (auto split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; v \<in> A; v \<notin> C'; finite C'; a \<in> A - {v} \<rightarrow> carrier K; C' \<subseteq> carrier V; a \<in> C' \<rightarrow> carrier K; v = lincomb a (A - {v} \<union> C'); C' \<subseteq> span B; C' \<inter> (A - {v}) = {}; int (card C') \<le> int (card B) - int (card A - Suc 0); span (A - {v} \<union> C') = span B\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A - {v} \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
apply (subst lincomb_elim_if)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; v \<in> A; v \<notin> C'; finite C'; a \<in> A - {v} \<rightarrow> carrier K; C' \<subseteq> carrier V; a \<in> C' \<rightarrow> carrier K; v = lincomb a (A - {v} \<union> C'); C' \<subseteq> span B; C' \<inter> (A - {v}) = {}; int (card C') \<le> int (card B) - int (card A - Suc 0); span (A - {v} \<union> C') = span B\<rbrakk> \<Longrightarrow> A - {v} \<union> C' \<subseteq> carrier V
 2. \<And>va. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; v \<in> A; v \<notin> C'; finite C'; a \<in> A - {v} \<rightarrow> carrier K; C' \<subseteq> carrier V; a \<in> C' \<rightarrow> carrier K; v = lincomb a (A - {v} \<union> C'); C' \<subseteq> span B; C' \<inter> (A - {v}) = {}; int (card C') \<le> int (card B) - int (card A - Suc 0); span (A - {v} \<union> C') = span B; va \<in> A - {v} \<union> C'\<rbrakk> \<Longrightarrow> va \<noteq> v
 3. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; v \<in> A; v \<notin> C'; finite C'; a \<in> A - {v} \<rightarrow> carrier K; C' \<subseteq> carrier V; a \<in> C' \<rightarrow> carrier K; v = lincomb a (A - {v} \<union> C'); C' \<subseteq> span B; C' \<inter> (A - {v}) = {}; int (card C') \<le> int (card B) - int (card A - Suc 0); span (A - {v} \<union> C') = span B\<rbrakk> \<Longrightarrow> a \<in> A - {v} \<union> C' \<rightarrow> carrier K
 4. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; v \<in> A; v \<notin> C'; finite C'; a \<in> A - {v} \<rightarrow> carrier K; C' \<subseteq> carrier V; a \<in> C' \<rightarrow> carrier K; v = lincomb a (A - {v} \<union> C'); C' \<subseteq> span B; C' \<inter> (A - {v}) = {}; int (card C') \<le> int (card B) - int (card A - Suc 0); span (A - {v} \<union> C') = span B\<rbrakk> \<Longrightarrow> \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> \<odot>\<^bsub>V\<^esub> v \<oplus>\<^bsub>V\<^esub> lincomb a (A - {v} \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
by (auto simp add: smult_minus_1 l_neg ring_subset_carrier)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(*NOTE: l_neg got deleted from the simp rules, but it is very useful.*)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from C' f
[PROOF STATE]
proof (chain)
picking this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<notin> C'
[PROOF STEP]
have rewrite_minus: "C'=(A\<union>C')-A"
[PROOF STATE]
proof (prove)
using this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<notin> C'

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

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from A C' b lcb v
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
(\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
v \<in> A
[PROOF STEP]
have exw: "\<exists>w\<in> C'. ?b w\<noteq>\<zero>\<^bsub>K\<^esub>"
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
(\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
v \<in> A

goal (1 subgoal):
 1. \<exists>w\<in>C'. (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
apply (subst rewrite_minus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> \<exists>w\<in>A \<union> C' - A. (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
apply (intro lincomb_must_include[where ?T="A\<union>C'" and ?v="v"])
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> A \<union> C' \<subseteq> carrier V
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> lin_indpt A
 3. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> A \<subseteq> A \<union> C'
 4. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> A \<union> C' \<subseteq> A \<union> C'
 5. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> finite (A \<union> C')
 6. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
 7. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
 8. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> v \<in> A \<union> C'
 9. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>; v \<in> A\<rbrakk> \<Longrightarrow> (if v = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a v) \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>w\<in>C'. (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from exw
[PROOF STATE]
proof (chain)
picking this:
\<exists>w\<in>C'. (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
[PROOF STEP]
obtain w where w: "w\<in> C'" "?b w\<noteq>\<zero>\<^bsub>K\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<exists>w\<in>C'. (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> C'
(if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from A C' w f b lcb
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
(if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
v \<notin> C'
(\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
have w_in: "w\<in>span ((A\<union> C') -{w})"
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
(if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
v \<notin> C'
(\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>

goal (1 subgoal):
 1. w \<in> span (A \<union> C' - {w})
[PROOF STEP]
apply (intro lincomb_isolate[where a="?b"])
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> finite (A \<union> C')
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> A \<union> C' \<subseteq> carrier V
 3. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K
 4. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> w \<in> A \<union> C'
 5. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
 6. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<in> A \<union> C' \<rightarrow> carrier K; lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>\<rbrakk> \<Longrightarrow> lincomb (\<lambda>w. if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) (A \<union> C') = \<zero>\<^bsub>V\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> span (A \<union> C' - {w})

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
have spaneq2: "span (A\<union>(C'-{w})) = span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span B
[PROOF STEP]
have 1: "span (?A'\<union>C') = span (A\<union> C')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A \<union> C')
[PROOF STEP]
(*adding v doesn't change the span*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A \<union> C')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A \<union> C')
[PROOF STEP]
from A C' v
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> A
[PROOF STEP]
have m1: "span (?A'\<union>C') = span ((?A'\<union> C')\<union>{v})"
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
v \<in> A

goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A - {v} \<union> C' \<union> {v})
[PROOF STEP]
apply (intro already_in_span)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A\<rbrakk> \<Longrightarrow> A - {v} \<union> C' \<subseteq> carrier V
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; v \<in> A\<rbrakk> \<Longrightarrow> v \<in> span (A - {v} \<union> C')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
span (A - {v} \<union> C') = span (A - {v} \<union> C' \<union> {v})

goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A \<union> C')
[PROOF STEP]
from f m1
[PROOF STATE]
proof (chain)
picking this:
v \<notin> C'
span (A - {v} \<union> C') = span (A - {v} \<union> C' \<union> {v})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<notin> C'
span (A - {v} \<union> C') = span (A - {v} \<union> C' \<union> {v})

goal (1 subgoal):
 1. span (A - {v} \<union> C') = span (A \<union> C')
[PROOF STEP]
by (metis rewrite_ins)
[PROOF STATE]
proof (state)
this:
span (A - {v} \<union> C') = span (A \<union> C')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
span (A - {v} \<union> C') = span (A \<union> C')

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span B
[PROOF STEP]
have 2: "span (A\<union> (C'-{w})) = span (A\<union> C')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
(*removing w doesn't change the span*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
from C' w(1) f
[PROOF STATE]
proof (chain)
picking this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
v \<notin> C'
[PROOF STEP]
have b60: "A\<union> (C'-{w}) = (A\<union> C') -{w}"
[PROOF STATE]
proof (prove)
using this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
v \<notin> C'

goal (1 subgoal):
 1. A \<union> (C' - {w}) = A \<union> C' - {w}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> (C' - {w}) = A \<union> C' - {w}

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
from  w(1)
[PROOF STATE]
proof (chain)
picking this:
w \<in> C'
[PROOF STEP]
have b61: "A\<union> C'= (A\<union> C' -{w})\<union>{w}"
[PROOF STATE]
proof (prove)
using this:
w \<in> C'

goal (1 subgoal):
 1. A \<union> C' = A \<union> C' - {w} \<union> {w}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<union> C' = A \<union> C' - {w} \<union> {w}

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
from A C'  w_in
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> span (A \<union> C' - {w})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> span (A \<union> C' - {w})

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
apply (subst b61)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> span (A \<union> C' - {w})\<rbrakk> \<Longrightarrow> span (A \<union> (C' - {w})) = span (A \<union> C' - {w} \<union> {w})
[PROOF STEP]
apply (subst b60)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> span (A \<union> C' - {w})\<rbrakk> \<Longrightarrow> span (A \<union> C' - {w}) = span (A \<union> C' - {w} \<union> {w})
[PROOF STEP]
apply (intro already_in_span)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> span (A \<union> C' - {w})\<rbrakk> \<Longrightarrow> A \<union> C' - {w} \<subseteq> carrier V
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> span (A \<union> C' - {w})\<rbrakk> \<Longrightarrow> w \<in> span (A \<union> C' - {w})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {w})) = span (A \<union> C')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {w})) = span (A \<union> C')

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span B
[PROOF STEP]
from C' 1 2
[PROOF STATE]
proof (chain)
picking this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
span (A - {v} \<union> C') = span (A \<union> C')
span (A \<union> (C' - {w})) = span (A \<union> C')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
span (A - {v} \<union> C') = span (A \<union> C')
span (A \<union> (C' - {w})) = span (A \<union> C')

goal (1 subgoal):
 1. span (A \<union> (C' - {w})) = span B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {w})) = span B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {w})) = span B

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
(* "span (A\<union>(C'-{w})) = span B"*)
[PROOF STATE]
proof (state)
this:
span (A \<union> (C' - {w})) = span B

goal (1 subgoal):
 1. v \<notin> C' \<Longrightarrow> \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
from A C' w f v spaneq2
[PROOF STATE]
proof (chain)
picking this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
(if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
v \<notin> C'
v \<in> A
span (A \<union> (C' - {w})) = span B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
lin_indpt A
A \<subseteq> span B
Suc m = card A
A \<subseteq> carrier V
finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B
w \<in> C'
(if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>
v \<notin> C'
v \<in> A
span (A \<union> (C' - {w})) = span B

goal (1 subgoal):
 1. \<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B
[PROOF STEP]
apply (rule_tac x="C'-{w}" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; v \<in> A; span (A \<union> (C' - {w})) = span B\<rbrakk> \<Longrightarrow> finite (C' - {w}) \<and> C' - {w} \<subseteq> carrier V \<and> C' - {w} \<subseteq> span B \<and> (C' - {w}) \<inter> A = {} \<and> int (card (C' - {w})) \<le> int (card B) - int (card A) \<and> span (A \<union> (C' - {w})) = span B
[PROOF STEP]
apply (subgoal_tac "card C' >0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; v \<in> A; span (A \<union> (C' - {w})) = span B; 0 < card C'\<rbrakk> \<Longrightarrow> finite (C' - {w}) \<and> C' - {w} \<subseteq> carrier V \<and> C' - {w} \<subseteq> span B \<and> (C' - {w}) \<inter> A = {} \<and> int (card (C' - {w})) \<le> int (card B) - int (card A) \<and> span (A \<union> (C' - {w})) = span B
 2. \<lbrakk>finite A; lin_indpt A; A \<subseteq> span B; Suc m = card A; A \<subseteq> carrier V; finite C' \<and> C' \<subseteq> carrier V \<and> C' \<subseteq> span B \<and> C' \<inter> (A - {v}) = {} \<and> int (card C') \<le> int (card B) - int (card (A - {v})) \<and> span (A - {v} \<union> C') = span B; w \<in> C'; (if w = v then \<ominus>\<^bsub>K\<^esub> \<one>\<^bsub>K\<^esub> else a w) \<noteq> \<zero>\<^bsub>K\<^esub>; v \<notin> C'; v \<in> A; span (A \<union> (C' - {w})) = span B\<rbrakk> \<Longrightarrow> 0 < card C'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>C. finite C \<and> C \<subseteq> carrier V \<and> C \<subseteq> span B \<and> C \<inter> A = {} \<and> int (card C) \<le> int (card B) - int (card A) \<and> span (A \<union> C) = span B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_upper_bound:
  assumes "x > 0" "n > 0"
  shows "p n x \<le> 1/(12*x^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
0 < n
[PROOF STEP]
have "p n x = (\<Sum>r<n. D (real r + x))"
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < n

goal (1 subgoal):
 1. p n x = (\<Sum>r<n. D (real r + x))
[PROOF STEP]
by (simp add: p_def)
[PROOF STATE]
proof (state)
this:
p n x = (\<Sum>r<n. D (real r + x))

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p n x = (\<Sum>r<n. D (real r + x))

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
have "\<dots> \<le> (\<Sum>r<n. 1/(12*(real r + x)^2) - 1/(12 * (real (Suc r) + x)^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<n. D (real r + x)) \<le> (\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2))
[PROOF STEP]
using stirling_trapezium[of "real r + x" for r] assms
[PROOF STATE]
proof (prove)
using this:
0 < real ?r2 + x \<Longrightarrow> D (real ?r2 + x) \<in> {0..1 / (12 * (real ?r2 + x)\<^sup>2) - 1 / (12 * (real ?r2 + x + 1)\<^sup>2)}
0 < x
0 < n

goal (1 subgoal):
 1. (\<Sum>r<n. D (real r + x)) \<le> (\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2))
[PROOF STEP]
by (intro sum_mono) (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>r<n. D (real r + x)) \<le> (\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2))

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<n. D (real r + x)) \<le> (\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2))

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
have "\<dots> = 1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2)) = 1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2)
[PROOF STEP]
by (subst sum_lessThan_telescope') simp
[PROOF STATE]
proof (state)
this:
(\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2)) = 1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2)

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<n. 1 / (12 * (real r + x)\<^sup>2) - 1 / (12 * (real (Suc r) + x)\<^sup>2)) = 1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2)

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
have "\<dots> \<le> 1 / (12 * x^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2) \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / (12 * x\<^sup>2) - 1 / (12 * (real n + x)\<^sup>2) \<le> 1 / (12 * x\<^sup>2)

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p n x \<le> 1 / (12 * x\<^sup>2)

goal (1 subgoal):
 1. p n x \<le> 1 / (12 * x\<^sup>2)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p n x \<le> 1 / (12 * x\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vderiv_on_open:
  assumes "open T"
  shows "(f has_vderiv_on f') T \<longleftrightarrow> (\<forall>t \<in> T. (f has_vector_derivative f' t) (at t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_vderiv_on f') T = (\<forall>t\<in>T. (f has_vector_derivative f' t) (at t))
[PROOF STEP]
by (auto simp: has_vderiv_on_def at_within_open[OF _ \<open>open T\<close>])


[STATEMENT]
lemma power_series_tendsto_at_left:
  assumes nonneg: "\<And>i. 0 \<le> f i" and summable: "\<And>z. 0 \<le> z \<Longrightarrow> z < 1 \<Longrightarrow> summable (\<lambda>n. f n * z^n)"
  shows "((\<lambda>z. ennreal (\<Sum>n. f n * z^n)) \<longlongrightarrow> (\<Sum>n. ennreal (f n))) (at_left (1::real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. ennreal (\<Sum>n. f n * z ^ n)) \<longlongrightarrow> (\<Sum>n. ennreal (f n))) (at_left 1)
[PROOF STEP]
proof (intro tendsto_at_left_sequentially)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?b < 1
 2. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. ?b < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
show "0 < (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
fix S :: "nat \<Rightarrow> real"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
assume S: "\<And>n. S n < 1" "\<And>n. 0 < S n" "S \<longlonglongrightarrow> 1" "incseq S"
[PROOF STATE]
proof (state)
this:
S ?n < 1
0 < S ?n
S \<longlonglongrightarrow> 1
incseq S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S ?n < 1
0 < S ?n
S \<longlonglongrightarrow> 1
incseq S
[PROOF STEP]
have S_nonneg: "\<And>i. 0 \<le> S i"
[PROOF STATE]
proof (prove)
using this:
S ?n < 1
0 < S ?n
S \<longlonglongrightarrow> 1
incseq S

goal (1 subgoal):
 1. \<And>i. 0 \<le> S i
[PROOF STEP]
by (auto intro: less_imp_le)
[PROOF STATE]
proof (state)
this:
0 \<le> S ?i

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
have "(\<lambda>i. (\<integral>\<^sup>+n. f n * S i^n \<partial>count_space UNIV)) \<longlonglongrightarrow> (\<integral>\<^sup>+n. ennreal (f n) \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) \<longlonglongrightarrow> \<integral>\<^sup>+ n. ennreal (f n) \<partial>count_space UNIV
[PROOF STEP]
proof (rule nn_integral_LIMSEQ)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. incseq (\<lambda>n x. ennreal (f x * S n ^ x))
 2. \<And>i. (\<lambda>x. ennreal (f x * S i ^ x)) \<in> borel_measurable (count_space UNIV)
 3. \<And>x. (\<lambda>i. ennreal (f x * S i ^ x)) \<longlonglongrightarrow> ennreal (f x)
[PROOF STEP]
show "incseq (\<lambda>i n. ennreal (f n * S i^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>i n. ennreal (f n * S i ^ n))
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
S ?n < 1
0 < S ?n
S \<longlonglongrightarrow> 1
incseq S

goal (1 subgoal):
 1. incseq (\<lambda>i n. ennreal (f n * S i ^ n))
[PROOF STEP]
by (auto intro!: mult_mono power_mono nonneg ennreal_leI
                       simp: incseq_def le_fun_def less_imp_le)
[PROOF STATE]
proof (state)
this:
incseq (\<lambda>i n. ennreal (f n * S i ^ n))

goal (2 subgoals):
 1. \<And>i. (\<lambda>x. ennreal (f x * S i ^ x)) \<in> borel_measurable (count_space UNIV)
 2. \<And>x. (\<lambda>i. ennreal (f x * S i ^ x)) \<longlonglongrightarrow> ennreal (f x)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. (\<lambda>x. ennreal (f x * S i ^ x)) \<in> borel_measurable (count_space UNIV)
 2. \<And>x. (\<lambda>i. ennreal (f x * S i ^ x)) \<longlonglongrightarrow> ennreal (f x)
[PROOF STEP]
have "(\<lambda>i. ennreal (f n * S i^n)) \<longlonglongrightarrow> ennreal (f n * 1^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n * 1 ^ n)
[PROOF STEP]
by (intro tendsto_intros tendsto_ennrealI S)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n * 1 ^ n)

goal (2 subgoals):
 1. \<And>i. (\<lambda>x. ennreal (f x * S i ^ x)) \<in> borel_measurable (count_space UNIV)
 2. \<And>x. (\<lambda>i. ennreal (f x * S i ^ x)) \<longlonglongrightarrow> ennreal (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n * 1 ^ n)
[PROOF STEP]
show "(\<lambda>i. ennreal (f n * S i^n)) \<longlonglongrightarrow> ennreal (f n)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n * 1 ^ n)

goal (1 subgoal):
 1. (\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>i. ennreal (f n * S i ^ n)) \<longlonglongrightarrow> ennreal (f n)

goal (1 subgoal):
 1. \<And>i. (\<lambda>x. ennreal (f x * S i ^ x)) \<in> borel_measurable (count_space UNIV)
[PROOF STEP]
qed (auto simp: S_nonneg intro!: mult_nonneg_nonneg nonneg)
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) \<longlonglongrightarrow> \<integral>\<^sup>+ n. ennreal (f n) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) \<longlonglongrightarrow> \<integral>\<^sup>+ n. ennreal (f n) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
have "(\<lambda>i. (\<integral>\<^sup>+n. f n * S i^n \<partial>count_space UNIV)) = (\<lambda>i. \<Sum>n. f n * S i^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) = (\<lambda>x. ennreal (\<Sum>n. f n * S x ^ n))
[PROOF STEP]
by (subst nn_integral_count_space_nat)
       (intro ext suminf_ennreal2 mult_nonneg_nonneg nonneg S_nonneg
              zero_le_power summable S)+
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) = (\<lambda>x. ennreal (\<Sum>n. f n * S x ^ n))

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>i. \<integral>\<^sup>+ x. ennreal (f x * S i ^ x) \<partial>count_space UNIV) = (\<lambda>x. ennreal (\<Sum>n. f n * S x ^ n))

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
have "(\<integral>\<^sup>+n. ennreal (f n) \<partial>count_space UNIV) = (\<Sum>n. ennreal (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ n. ennreal (f n) \<partial>count_space UNIV = (\<Sum>n. ennreal (f n))
[PROOF STEP]
by (simp add: nn_integral_count_space_nat nonneg)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ n. ennreal (f n) \<partial>count_space UNIV = (\<Sum>n. ennreal (f n))

goal (1 subgoal):
 1. \<And>S. \<lbrakk>\<And>n. S n < 1; \<And>n. 0 < S n; incseq S; S \<longlonglongrightarrow> 1\<rbrakk> \<Longrightarrow> (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. ennreal (\<Sum>n. f n * S i ^ n)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
show "(\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. ennreal (\<Sum>n. f n * S i ^ n)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))

goal (1 subgoal):
 1. (\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ennreal (\<Sum>na. f na * S n ^ na)) \<longlonglongrightarrow> (\<Sum>n. ennreal (f n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prob_space_uniform_count_measure: "finite A \<Longrightarrow> A \<noteq> {} \<Longrightarrow> prob_space (uniform_count_measure A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> prob_space (uniform_count_measure A)
[PROOF STEP]
by standard (auto simp: emeasure_uniform_count_measure space_uniform_count_measure one_ennreal_def)