[STATEMENT]
lemma row_length_eq:
 "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
   \<longrightarrow>
    (row_length (a#b#N) = (row_length (b#N)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
have "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
                        \<longrightarrow> (b \<in> set (a#b#M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # M)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # M)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
have
         "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
                 \<longrightarrow> (Ball (set (a#b#N)) (vec (row_length (a#b#N))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> Ball (set (a # b # N)) (vec (row_length (a # b # N)))
[PROOF STEP]
using mat_def
[PROOF STATE]
proof (prove)
using this:
mat ?nr ?nc ?m = (length ?m = ?nc \<and> Ball (set ?m) (vec ?nr))

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> Ball (set (a # b # N)) (vec (row_length (a # b # N)))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> Ball (set (a # b # N)) (vec (row_length (a # b # N)))

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> Ball (set (a # b # N)) (vec (row_length (a # b # N)))

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
have "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
                  \<longrightarrow> (b \<in> (set (a#b#N)))
                    \<longrightarrow> (vec (row_length (a#b#N)) b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # N) \<longrightarrow> vec (row_length (a # b # N)) b
[PROOF STEP]
by (metis calculation(2))
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # N) \<longrightarrow> vec (row_length (a # b # N)) b

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # N) \<longrightarrow> vec (row_length (a # b # N)) b
[PROOF STEP]
have "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
                         \<longrightarrow> (length b) = (row_length (a#b#N))"
[PROOF STATE]
proof (prove)
using this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # N) \<longrightarrow> vec (row_length (a # b # N)) b

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)
[PROOF STEP]
using vec_def
[PROOF STATE]
proof (prove)
using this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> b \<in> set (a # b # N) \<longrightarrow> vec (row_length (a # b # N)) b
vec ?n ?x = (length ?x = ?n)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)
[PROOF STEP]
have "(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
                          \<longrightarrow> (row_length (b#N))
                                       = (row_length (a#b#N))"
[PROOF STATE]
proof (prove)
using this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)
[PROOF STEP]
using row_length_def
[PROOF STATE]
proof (prove)
using this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> length b = row_length (a # b # N)
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma replicate_mset_rec: "n > 0 \<Longrightarrow> replicate_mset n x = add_mset x (replicate_mset (n - 1) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> replicate_mset n x = add_mset x (replicate_mset (n - 1) x)
[PROOF STEP]
by (cases n) auto


[STATEMENT]
lemma odd_p: "odd p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd p
[PROOF STEP]
using p_ge_2 p_prime prime_odd_nat
[PROOF STATE]
proof (prove)
using this:
2 < p
prime p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> odd ?p

goal (1 subgoal):
 1. odd p
[PROOF STEP]
by blast


[STATEMENT]
lemma prob_short_aux:
  "Buffon {(x, \<phi>). needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = ennreal (2 * l / (d * pi))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure local.Buffon {(x, \<phi>). needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = ennreal (2 * l / (d * pi))
[PROOF STEP]
unfolding buffon_prob_aux emeasure_buffon_set_short
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ennreal l / ennreal (2 * d * pi) = ennreal (2 * l / (d * pi))
[PROOF STEP]
using d l
[PROOF STATE]
proof (prove)
using this:
0 < d
0 < l

goal (1 subgoal):
 1. 4 * ennreal l / ennreal (2 * d * pi) = ennreal (2 * l / (d * pi))
[PROOF STEP]
by (simp flip: ennreal_mult ennreal_numeral add: divide_ennreal)


[STATEMENT]
lemma  member_bound: "vebt_member tree x \<Longrightarrow> invar_vebt tree n  \<Longrightarrow> x < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>vebt_member tree x; invar_vebt tree n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
proof(induction tree x arbitrary: n rule: vebt_member.induct)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>a b x n. \<lbrakk>vebt_member (Leaf a b) x; invar_vebt (Leaf a b) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>uu_ uv_ uw_ x n. \<lbrakk>vebt_member (Node None uu_ uv_ uw_) x; invar_vebt (Node None uu_ uv_ uw_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 4. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 5. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
case (1 a b x)
[PROOF STATE]
proof (state)
this:
vebt_member (Leaf a b) x
invar_vebt (Leaf a b) n

goal (5 subgoals):
 1. \<And>a b x n. \<lbrakk>vebt_member (Leaf a b) x; invar_vebt (Leaf a b) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>uu_ uv_ uw_ x n. \<lbrakk>vebt_member (Node None uu_ uv_ uw_) x; invar_vebt (Node None uu_ uv_ uw_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 4. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 5. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (Leaf a b) x
invar_vebt (Leaf a b) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_member (Leaf a b) x
invar_vebt (Leaf a b) n

goal (1 subgoal):
 1. x < 2 ^ n
[PROOF STEP]
by (metis vebt_member.simps(1) One_nat_def le_neq_implies_less nat_power_eq_Suc_0_iff
                       numeral_eq_iff numerals(1) one_le_numeral one_le_power semiring_norm(85) valid_tree_deg_neq_0
                       zero_less_numeral zero_less_power)
[PROOF STATE]
proof (state)
this:
x < 2 ^ n

goal (4 subgoals):
 1. \<And>uu_ uv_ uw_ x n. \<lbrakk>vebt_member (Node None uu_ uv_ uw_) x; invar_vebt (Node None uu_ uv_ uw_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 4. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>uu_ uv_ uw_ x n. \<lbrakk>vebt_member (Node None uu_ uv_ uw_) x; invar_vebt (Node None uu_ uv_ uw_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 4. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
case (2 uu uv uw x)
[PROOF STATE]
proof (state)
this:
vebt_member (Node None uu uv uw) x
invar_vebt (Node None uu uv uw) n

goal (4 subgoals):
 1. \<And>uu_ uv_ uw_ x n. \<lbrakk>vebt_member (Node None uu_ uv_ uw_) x; invar_vebt (Node None uu_ uv_ uw_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 4. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (Node None uu uv uw) x
invar_vebt (Node None uu uv uw) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node None uu uv uw) x
invar_vebt (Node None uu uv uw) n

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

goal (3 subgoals):
 1. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
case (3 v uy uz x)
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some v) 0 uy uz) x
invar_vebt (Node (Some v) 0 uy uz) n

goal (3 subgoals):
 1. \<And>v uy_ uz_ x n. \<lbrakk>vebt_member (Node (Some v) 0 uy_ uz_) x; invar_vebt (Node (Some v) 0 uy_ uz_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 3. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (Node (Some v) 0 uy uz) x
invar_vebt (Node (Some v) 0 uy uz) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some v) 0 uy uz) x
invar_vebt (Node (Some v) 0 uy uz) n

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

goal (2 subgoals):
 1. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
case (4 v vb vc x)
[PROOF STATE]
proof (state)
this:
vebt_member (Node (Some v) (Suc 0) vb vc) x
invar_vebt (Node (Some v) (Suc 0) vb vc) n

goal (2 subgoals):
 1. \<And>v vb_ vc_ x n. \<lbrakk>vebt_member (Node (Some v) (Suc 0) vb_ vc_) x; invar_vebt (Node (Some v) (Suc 0) vb_ vc_) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
 2. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vebt_member (Node (Some v) (Suc 0) vb vc) x
invar_vebt (Node (Some v) (Suc 0) vb vc) n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vebt_member (Node (Some v) (Suc 0) vb vc) x
invar_vebt (Node (Some v) (Suc 0) vb vc) n

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

goal (1 subgoal):
 1. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
case (5 mi ma va treeList summary x)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; ?xa = high x (Suc (Suc va) div 2); ?xb = low x (Suc (Suc va) div 2); ?xa < length treeList; vebt_member (treeList ! ?xa) ?xb; invar_vebt (treeList ! ?xa) ?n\<rbrakk> \<Longrightarrow> ?xb < 2 ^ ?n
vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x
invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n

goal (1 subgoal):
 1. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
hence 111: "n =  Suc (Suc va)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; ?xa = high x (Suc (Suc va) div 2); ?xb = low x (Suc (Suc va) div 2); ?xa < length treeList; vebt_member (treeList ! ?xa) ?xb; invar_vebt (treeList ! ?xa) ?n\<rbrakk> \<Longrightarrow> ?xb < 2 ^ ?n
vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x
invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n

goal (1 subgoal):
 1. n = Suc (Suc va)
[PROOF STEP]
using deg_deg_n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; ?xa = high x (Suc (Suc va) div 2); ?xb = low x (Suc (Suc va) div 2); ?xa < length treeList; vebt_member (treeList ! ?xa) ?xb; invar_vebt (treeList ! ?xa) ?n\<rbrakk> \<Longrightarrow> ?xb < 2 ^ ?n
vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x
invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n
invar_vebt (Node ?info ?deg ?treeList ?summary) ?n \<Longrightarrow> ?deg = ?n

goal (1 subgoal):
 1. n = Suc (Suc va)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
n = Suc (Suc va)

goal (1 subgoal):
 1. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
hence "ma < 2^n"
[PROOF STATE]
proof (prove)
using this:
n = Suc (Suc va)

goal (1 subgoal):
 1. ma < 2 ^ n
[PROOF STEP]
using "5.prems"(2) mi_ma_2_deg
[PROOF STATE]
proof (prove)
using this:
n = Suc (Suc va)
invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n
invar_vebt (Node (Some (?mi, ?ma)) ?deg ?treeList ?summary) ?n \<Longrightarrow> ?mi \<le> ?ma \<and> ?ma < 2 ^ ?deg

goal (1 subgoal):
 1. ma < 2 ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ma < 2 ^ n

goal (1 subgoal):
 1. \<And>mi ma va treeList summary x n. \<lbrakk>\<And>xa xb n. \<lbrakk>x \<noteq> mi; x \<noteq> ma; \<not> x < mi; \<not> ma < x; xa = high x (Suc (Suc va) div 2); xb = low x (Suc (Suc va) div 2); xa < length treeList; vebt_member (treeList ! xa) xb; invar_vebt (treeList ! xa) n\<rbrakk> \<Longrightarrow> xb < 2 ^ n; vebt_member (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) x; invar_vebt (Node (Some (mi, ma)) (Suc (Suc va)) treeList summary) n\<rbrakk> \<Longrightarrow> x < 2 ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ma < 2 ^ n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ma < 2 ^ n

goal (1 subgoal):
 1. x < 2 ^ n
[PROOF STEP]
by (metis "5.prems"(1) "5.prems"(2) le_less_trans less_imp_le_nat member_inv mi_ma_2_deg)
[PROOF STATE]
proof (state)
this:
x < 2 ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux_digit_lt_linear:
  assumes b: "b < (2::nat)^t"
  assumes d: "d < (2::nat)^t"
  shows "(a * 2^t + b) \<exclamdown> k \<le> (c * 2^t + d) \<exclamdown> k \<longleftrightarrow> ((a * 2^t) \<exclamdown> k \<le> (c * 2^t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
proof (cases "k < t")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k < t

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
k < t
[PROOF STEP]
have "(a * 2^t + b) \<exclamdown> k = b \<exclamdown> k"
[PROOF STATE]
proof (prove)
using this:
k < t

goal (1 subgoal):
 1. (a * 2 ^ t + b) \<exclamdown> k = b \<exclamdown> k
[PROOF STEP]
using aux2_digit_sum_repr assms(1)
[PROOF STATE]
proof (prove)
using this:
k < t
\<lbrakk>?n < 2 ^ ?c; ?r < ?c\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?c + ?n) \<exclamdown> ?r = ?n \<exclamdown> ?r
b < 2 ^ t

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

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a * 2 ^ t + b) \<exclamdown> k = b \<exclamdown> k

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
k < t
[PROOF STEP]
have "(c * 2^t + d) \<exclamdown> k = d \<exclamdown> k"
[PROOF STATE]
proof (prove)
using this:
k < t

goal (1 subgoal):
 1. (c * 2 ^ t + d) \<exclamdown> k = d \<exclamdown> k
[PROOF STEP]
using aux2_digit_sum_repr assms(2)
[PROOF STATE]
proof (prove)
using this:
k < t
\<lbrakk>?n < 2 ^ ?c; ?r < ?c\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?c + ?n) \<exclamdown> ?r = ?n \<exclamdown> ?r
d < 2 ^ t

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

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(c * 2 ^ t + d) \<exclamdown> k = d \<exclamdown> k

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
k < t
[PROOF STEP]
have "(a * 2^t) \<exclamdown> k = 0"
[PROOF STATE]
proof (prove)
using this:
k < t

goal (1 subgoal):
 1. (a * 2 ^ t) \<exclamdown> k = 0
[PROOF STEP]
using aux2_digit_sum_repr[of "0"] nth_bit_def
[PROOF STATE]
proof (prove)
using this:
k < t
\<lbrakk>0 < 2 ^ ?c; ?r < ?c\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?c + 0) \<exclamdown> ?r = 0 \<exclamdown> ?r
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2

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

goal (2 subgoals):
 1. k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
 2. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a * 2 ^ t + b) \<exclamdown> k = b \<exclamdown> k
(c * 2 ^ t + d) \<exclamdown> k = d \<exclamdown> k
(a * 2 ^ t) \<exclamdown> k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * 2 ^ t + b) \<exclamdown> k = b \<exclamdown> k
(c * 2 ^ t + d) \<exclamdown> k = d \<exclamdown> k
(a * 2 ^ t) \<exclamdown> k = 0

goal (1 subgoal):
 1. ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
using aux2_digit_sum_repr assms
[PROOF STATE]
proof (prove)
using this:
(a * 2 ^ t + b) \<exclamdown> k = b \<exclamdown> k
(c * 2 ^ t + d) \<exclamdown> k = d \<exclamdown> k
(a * 2 ^ t) \<exclamdown> k = 0
\<lbrakk>?n < 2 ^ ?c; ?r < ?c\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?c + ?n) \<exclamdown> ?r = ?n \<exclamdown> ?r
b < 2 ^ t
d < 2 ^ t

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

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k < t

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> k < t
[PROOF STEP]
have "(a * 2^t + b) \<exclamdown> k = (a * 2^t) \<exclamdown> k"
[PROOF STATE]
proof (prove)
using this:
\<not> k < t

goal (1 subgoal):
 1. (a * 2 ^ t + b) \<exclamdown> k = (a * 2 ^ t) \<exclamdown> k
[PROOF STEP]
using aux1_digit_lt_linear assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> k < t
\<lbrakk>?b < 2 ^ ?r; ?r \<le> ?k\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?r + ?b) \<exclamdown> ?k = (?a * 2 ^ ?r) \<exclamdown> ?k
b < 2 ^ t

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

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a * 2 ^ t + b) \<exclamdown> k = (a * 2 ^ t) \<exclamdown> k

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> k < t
[PROOF STEP]
have "(c * 2^t + d) \<exclamdown> k = (c * 2^t) \<exclamdown> k"
[PROOF STATE]
proof (prove)
using this:
\<not> k < t

goal (1 subgoal):
 1. (c * 2 ^ t + d) \<exclamdown> k = (c * 2 ^ t) \<exclamdown> k
[PROOF STEP]
using aux1_digit_lt_linear assms(2)
[PROOF STATE]
proof (prove)
using this:
\<not> k < t
\<lbrakk>?b < 2 ^ ?r; ?r \<le> ?k\<rbrakk> \<Longrightarrow> (?a * 2 ^ ?r + ?b) \<exclamdown> ?k = (?a * 2 ^ ?r) \<exclamdown> ?k
d < 2 ^ t

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

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(c * 2 ^ t + d) \<exclamdown> k = (c * 2 ^ t) \<exclamdown> k

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
\<not> k < t
[PROOF STEP]
have "b \<exclamdown> k = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> k < t

goal (1 subgoal):
 1. b \<exclamdown> k = 0
[PROOF STEP]
using aux1_digit_lt_linear[of _ _ _ "0"] nth_bit_def assms(1)
[PROOF STATE]
proof (prove)
using this:
\<not> k < t
\<lbrakk>?b < 2 ^ ?r; ?r \<le> ?k\<rbrakk> \<Longrightarrow> (0 * 2 ^ ?r + ?b) \<exclamdown> ?k = (0 * 2 ^ ?r) \<exclamdown> ?k
?num \<exclamdown> ?k = ?num div 2 ^ ?k mod 2
b < 2 ^ t

goal (1 subgoal):
 1. b \<exclamdown> k = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<exclamdown> k = 0

goal (1 subgoal):
 1. \<not> k < t \<Longrightarrow> ((a * 2 ^ t + b) \<exclamdown> k \<le> (c * 2 ^ t + d) \<exclamdown> k) = ((a * 2 ^ t) \<exclamdown> k \<le> (c * 2 ^ t) \<exclamdown> k \<and> b \<exclamdown> k \<le> d \<exclamdown> k)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a * 2 ^ t + b) \<exclamdown> k = (a * 2 ^ t) \<exclamdown> k
(c * 2 ^ t + d) \<exclamdown> k = (c * 2 ^ t) \<exclamdown> k
b \<exclamdown> k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * 2 ^ t + b) \<exclamdown> k = (a * 2 ^ t) \<exclamdown> k
(c * 2 ^ t + d) \<exclamdown> k = (c * 2 ^ t) \<exclamdown> k
b \<exclamdown> k = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Semilat) plus_le_conv [simp]:
  "\<lbrakk> x \<in> A; y \<in> A; z \<in> A \<rbrakk> \<Longrightarrow> (x \<squnion>\<^sub>f y \<sqsubseteq>\<^sub>r z) = (x \<sqsubseteq>\<^sub>r z \<and> y \<sqsubseteq>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> (x \<squnion>\<^bsub>f\<^esub> y \<sqsubseteq>\<^bsub>r\<^esub> z) = (x \<sqsubseteq>\<^bsub>r\<^esub> z \<and> y \<sqsubseteq>\<^bsub>r\<^esub> z)
[PROOF STEP]
by (blast intro: ub1 ub2 lub order_trans)


[STATEMENT]
lemma (in Corps) val_surj_n_valTr:"\<lbrakk>valuation K v; \<exists>x \<in> carrier K. v x = 1\<rbrakk>
      \<Longrightarrow>  Lv K v = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; \<exists>x\<in>carrier K. v x = 1\<rbrakk> \<Longrightarrow> Lv K v = 1
[PROOF STEP]
apply (erule bexE,
       frule_tac x = x in n_val[of v],
       simp, frule Lv_pos[of v])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>valuation K v; x \<in> carrier K; v x = 1; n_val K v x * Lv K v = v x; 0 < Lv K v\<rbrakk> \<Longrightarrow> Lv K v = 1
[PROOF STEP]
apply (frule_tac w = "Lv K v" and x = "n_val K v x" in amult_1_both)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>valuation K v; x \<in> carrier K; v x = 1; n_val K v x * Lv K v = v x; 0 < Lv K v\<rbrakk> \<Longrightarrow> n_val K v x * Lv K v = 1
 2. \<And>x. \<lbrakk>valuation K v; x \<in> carrier K; v x = 1; n_val K v x * Lv K v = v x; 0 < Lv K v; n_val K v x = 1 \<and> Lv K v = 1\<rbrakk> \<Longrightarrow> Lv K v = 1
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma restrict_to_reachable_states_simps[simp] :
shows "initial (restrict_to_reachable_states M) = initial M"
      "states (restrict_to_reachable_states M) = reachable_states M"
      "inputs (restrict_to_reachable_states M) = inputs M"
      "outputs (restrict_to_reachable_states M) = outputs M"
      "transitions (restrict_to_reachable_states M)
          = {t \<in> transitions M . (t_source t) \<in> reachable_states M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (FSM.initial (restrict_to_reachable_states M) = FSM.initial M &&& FSM.states (restrict_to_reachable_states M) = reachable_states M) &&& FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M &&& FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M &&& FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. FSM.initial (restrict_to_reachable_states M) = FSM.initial M
 2. FSM.states (restrict_to_reachable_states M) = reachable_states M
 3. FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M
 4. FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M
 5. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
show "initial (restrict_to_reachable_states M) = initial M"
       "states (restrict_to_reachable_states M) = reachable_states M"
       "inputs (restrict_to_reachable_states M) = inputs M"
       "outputs (restrict_to_reachable_states M) = outputs M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (FSM.initial (restrict_to_reachable_states M) = FSM.initial M &&& FSM.states (restrict_to_reachable_states M) = reachable_states M) &&& FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M &&& FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M
[PROOF STEP]
using filter_states_simps[of "(\<lambda> q . q \<in> reachable_states M)", OF reachable_states_initial]
[PROOF STATE]
proof (prove)
using this:
FSM.initial (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.initial M
FSM.states (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = Set.filter (\<lambda>q. q \<in> reachable_states M) (FSM.states M)
FSM.inputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.inputs M
FSM.outputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.outputs M
FSM.transitions (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}

goal (1 subgoal):
 1. (FSM.initial (restrict_to_reachable_states M) = FSM.initial M &&& FSM.states (restrict_to_reachable_states M) = reachable_states M) &&& FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M &&& FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M
[PROOF STEP]
using reachable_state_is_state[of _ M]
[PROOF STATE]
proof (prove)
using this:
FSM.initial (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.initial M
FSM.states (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = Set.filter (\<lambda>q. q \<in> reachable_states M) (FSM.states M)
FSM.inputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.inputs M
FSM.outputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.outputs M
FSM.transitions (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}
?q \<in> reachable_states M \<Longrightarrow> ?q \<in> FSM.states M

goal (1 subgoal):
 1. (FSM.initial (restrict_to_reachable_states M) = FSM.initial M &&& FSM.states (restrict_to_reachable_states M) = reachable_states M) &&& FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M &&& FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FSM.initial (restrict_to_reachable_states M) = FSM.initial M
FSM.states (restrict_to_reachable_states M) = reachable_states M
FSM.inputs (restrict_to_reachable_states M) = FSM.inputs M
FSM.outputs (restrict_to_reachable_states M) = FSM.outputs M

goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
have "transitions (restrict_to_reachable_states M)
          = {t \<in> transitions M. (t_source t) \<in> reachable_states M \<and> (t_target t) \<in> reachable_states M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}
[PROOF STEP]
using filter_states_simps[of "(\<lambda> q . q \<in> reachable_states M)", OF reachable_states_initial]
[PROOF STATE]
proof (prove)
using this:
FSM.initial (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.initial M
FSM.states (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = Set.filter (\<lambda>q. q \<in> reachable_states M) (FSM.states M)
FSM.inputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.inputs M
FSM.outputs (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = FSM.outputs M
FSM.transitions (FSM.filter_states M (\<lambda>q. q \<in> reachable_states M)) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}

goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}

goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}
[PROOF STEP]
show "transitions (restrict_to_reachable_states M)
              = {t \<in> transitions M . (t_source t) \<in> reachable_states M}"
[PROOF STATE]
proof (prove)
using this:
FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}

goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
using reachable_states_next[of _ M]
[PROOF STATE]
proof (prove)
using this:
FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M \<and> t_target t \<in> reachable_states M}
\<lbrakk>?q \<in> reachable_states M; ?t \<in> FSM.transitions M; t_source ?t = ?q\<rbrakk> \<Longrightarrow> t_target ?t \<in> reachable_states M

goal (1 subgoal):
 1. FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
FSM.transitions (restrict_to_reachable_states M) = {t \<in> FSM.transitions M. t_source t \<in> reachable_states M}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma line_integral_on_pair_path:
  fixes F::"('a::euclidean_space) \<Rightarrow> ('a)" and
    g::"real \<Rightarrow> 'a" and
    \<gamma>::"(real \<Rightarrow> 'a)" and
    i::'a
  assumes i_norm_1: "norm i = 1" and
    g_orthogonal_to_i: "\<forall>x. g(x) \<bullet> i = 0" and
    gamma_is_in_terms_of_i: "\<gamma> = (\<lambda>x. f(x) *\<^sub>R i + g(f(x)))" and
    gamma_smooth: "\<gamma> C1_differentiable_on {0 .. 1}" and
    g_continuous_on_f: "continuous_on (f ` {0..1}) g" and
    path_start_le_path_end: "(pathstart \<gamma>) \<bullet> i \<le> (pathfinish \<gamma>) \<bullet> i" and
    field_i_comp_cont: "continuous_on (path_image \<gamma>) (\<lambda>x. F x \<bullet> i)"
  shows "(line_integral F {i} \<gamma>)
                 = integral (cbox ((pathstart \<gamma>) \<bullet> i) ((pathfinish \<gamma>) \<bullet> i)) (\<lambda>f_var. (F (f_var *\<^sub>R i + g(f_var)) \<bullet> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} \<gamma> = integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
proof (simp add: line_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have gamma_differentiable: "\<forall>x \<in> {0 .. 1}. \<gamma> differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. \<gamma> differentiable at x
[PROOF STEP]
using gamma_smooth  C1_differentiable_on_eq
[PROOF STATE]
proof (prove)
using this:
\<gamma> C1_differentiable_on {0..1}
(?f C1_differentiable_on ?S) = ((\<forall>x\<in>?S. ?f differentiable at x) \<and> continuous_on ?S (\<lambda>x. vector_derivative ?f (at x)))

goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. \<gamma> differentiable at x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..1}. \<gamma> differentiable at x

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{0..1}. \<gamma> differentiable at x
[PROOF STEP]
have gamma_i_component_smooth:
    "\<forall>x \<in> {0 .. 1}. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. \<gamma> differentiable at x

goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..1}. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have vec_deriv_i_comp_cont:
    "continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
have "continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x) (at x within {0..1}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}))
[PROOF STEP]
using gamma_smooth C1_differentiable_on_eq
[PROOF STATE]
proof (prove)
using this:
\<gamma> C1_differentiable_on {0..1}
(?f C1_differentiable_on ?S) = ((\<forall>x\<in>?S. ?f differentiable at x) \<and> continuous_on ?S (\<lambda>x. vector_derivative ?f (at x)))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}))
[PROOF STEP]
by (smt C1_differentiable_on_def atLeastAtMost_iff continuous_on_eq vector_derivative_at_within_ivl)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}))
[PROOF STEP]
have deriv_comp_cont:
      "continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x) (at x within {0..1}) \<bullet> i)"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)
[PROOF STEP]
by (simp add: continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
using derivative_component_fun_component_at_within[OF gamma_differentiable, of "i"]
        continuous_on_eq[OF deriv_comp_cont, of "(\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
(\<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) \<Longrightarrow> continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have field_cont_on_path:
    "continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have 0: "(\<lambda>x. \<gamma> x \<bullet> i) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<gamma> x \<bullet> i) = f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<gamma> x \<bullet> i = f x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<gamma> x \<bullet> i = f x
[PROOF STEP]
show "\<gamma> x \<bullet> i = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> x \<bullet> i = f x
[PROOF STEP]
using g_orthogonal_to_i i_norm_1
[PROOF STATE]
proof (prove)
using this:
\<forall>x. g x \<bullet> i = 0
norm i = 1

goal (1 subgoal):
 1. \<gamma> x \<bullet> i = f x
[PROOF STEP]
by (simp only: gamma_is_in_terms_of_i  real_inner_class.inner_add_left g_orthogonal_to_i inner_scaleR_left inner_same_Basis norm_eq_1)
[PROOF STATE]
proof (state)
this:
\<gamma> x \<bullet> i = f x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<gamma> x \<bullet> i) = f

goal (1 subgoal):
 1. continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
unfolding 0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (f ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
apply (rule continuous_on_compose2 [of _ "(\<lambda>x. F(x)  \<bullet> i)" "f ` { 0..1}" "(\<lambda>x. x *\<^sub>R i + g x)"]
          field_i_comp_cont g_continuous_on_f field_i_comp_cont continuous_intros)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f_var. f_var *\<^sub>R i + g f_var) ` f ` {0..1} \<subseteq> path_image \<gamma>
[PROOF STEP]
by (auto simp add: gamma_is_in_terms_of_i path_image_def)
[PROOF STATE]
proof (state)
this:
continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have path_vector_deriv_line_integrals:
    "\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative
                                          vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x))
                                                  (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)
[PROOF STEP]
using gamma_i_component_smooth and derivative_component_fun_component and
      vector_derivative_works
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x
?f differentiable at ?x \<Longrightarrow> vector_derivative ?f (at ?x) \<bullet> ?i = vector_derivative (\<lambda>x. ?f x \<bullet> ?i) (at ?x)
(?f differentiable ?net) = (?f has_vector_derivative vector_derivative ?f ?net) ?net

goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)
[PROOF STEP]
have "\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative
                                          vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
                                                  (at x within {0..1})"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)

goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})
[PROOF STEP]
using has_vector_derivative_at_within vector_derivative_at_within_ivl
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> (?f has_vector_derivative ?f') (at ?x within ?S)
\<lbrakk>(?f has_vector_derivative ?f') (at ?x); ?a \<le> ?x; ?x \<le> ?b; ?a < ?b\<rbrakk> \<Longrightarrow> vector_derivative ?f (at ?x within {?a..?b}) = ?f'

goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})
[PROOF STEP]
have substitute:
    "integral (cbox ((pathstart \<gamma>) \<bullet> i) ((pathfinish \<gamma>) \<bullet> i)) (\<lambda>f_var. (F (f_var *\<^sub>R i + g(f_var)) \<bullet> i))
                 = integral (cbox 0 1) (\<lambda>x. (F(\<gamma>(x)) \<bullet> i)*(vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x within {0..1})))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})

goal (1 subgoal):
 1. integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral (cbox 0 1) (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
using gauge_integral_by_substitution
      [of "0" "1" "(\<lambda>x. (\<gamma> x) \<bullet> i)"
        "(\<lambda>x. vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x within {0..1}))"
        "(\<lambda>f_var. (F (f_var *\<^sub>R i + g(f_var)) \<bullet> i))"] and
      path_start_le_path_end and vec_deriv_i_comp_cont and field_cont_on_path and
      gamma_is_in_terms_of_i i_norm_1
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1})
\<lbrakk>0 \<le> 1; \<gamma> 0 \<bullet> i \<le> \<gamma> 1 \<bullet> i; \<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) (at x within {0..1}); continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})); continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)\<rbrakk> \<Longrightarrow> integral {\<gamma> 0 \<bullet> i..\<gamma> 1 \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral {0..1} (\<lambda>x. F ((\<gamma> x \<bullet> i) *\<^sub>R i + g (\<gamma> x \<bullet> i)) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
pathstart \<gamma> \<bullet> i \<le> pathfinish \<gamma> \<bullet> i
continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
continuous_on ((\<lambda>x. \<gamma> x \<bullet> i) ` {0..1}) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
\<gamma> = (\<lambda>x. f x *\<^sub>R i + g (f x))
norm i = 1

goal (1 subgoal):
 1. integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral (cbox 0 1) (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
[PROOF STEP]
apply (auto simp add: pathstart_def pathfinish_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>{0..1}. ((\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) (at x within {0..1})) (at x within {0..1}); integral {(f 0 *\<^sub>R i + g (f 0)) \<bullet> i..(f 1 *\<^sub>R i + g (f 1)) \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral {0..1} (\<lambda>x. F (((f x *\<^sub>R i + g (f x)) \<bullet> i) *\<^sub>R i + g ((f x *\<^sub>R i + g (f x)) \<bullet> i)) \<bullet> i * vector_derivative (\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) (at x within {0..1})); (f 0 *\<^sub>R i + g (f 0)) \<bullet> i \<le> (f 1 *\<^sub>R i + g (f 1)) \<bullet> i; continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) (at x within {0..1})); continuous_on ((\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) ` {0..1}) (\<lambda>x. F (x *\<^sub>R i + g x) \<bullet> i); \<gamma> = (\<lambda>x. f x *\<^sub>R i + g (f x)); norm i = 1\<rbrakk> \<Longrightarrow> integral {0..1} (\<lambda>x. F (((f x *\<^sub>R i + g (f x)) \<bullet> i) *\<^sub>R i + g ((f x *\<^sub>R i + g (f x)) \<bullet> i)) \<bullet> i * vector_derivative (\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) (at x within {0..1})) = integral {0..1} (\<lambda>x. F (f x *\<^sub>R i + g (f x)) \<bullet> i * vector_derivative (\<lambda>x. (f x *\<^sub>R i + g (f x)) \<bullet> i) (at x within {0..1}))
[PROOF STEP]
apply (simp only:  real_inner_class.inner_add_left inner_not_same_Basis g_orthogonal_to_i inner_scaleR_left norm_eq_1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>{0..1}. ((\<lambda>x. f x * 1 + 0) has_vector_derivative vector_derivative (\<lambda>x. f x * 1 + 0) (at x within {0..1})) (at x within {0..1}); integral {f 0 * 1 + 0..f 1 * 1 + 0} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral {0..1} (\<lambda>x. F ((f x * 1 + 0) *\<^sub>R i + g (f x * 1 + 0)) \<bullet> i * vector_derivative (\<lambda>x. f x * 1 + 0) (at x within {0..1})); f 0 * 1 + 0 \<le> f 1 * 1 + 0; continuous_on {0..1} (\<lambda>x. vector_derivative (\<lambda>x. f x * 1 + 0) (at x within {0..1})); continuous_on ((\<lambda>x. f x * 1 + 0) ` {0..1}) (\<lambda>x. F (x *\<^sub>R i + g x) \<bullet> i); \<gamma> = (\<lambda>x. f x *\<^sub>R i + g (f x)); i \<bullet> i = 1\<rbrakk> \<Longrightarrow> integral {0..1} (\<lambda>x. F ((f x * 1 + 0) *\<^sub>R i + g (f x * 1 + 0)) \<bullet> i * vector_derivative (\<lambda>x. f x * 1 + 0) (at x within {0..1})) = integral {0..1} (\<lambda>x. F (f x *\<^sub>R i + g (f x)) \<bullet> i * vector_derivative (\<lambda>x. f x * 1 + 0) (at x within {0..1}))
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral (cbox 0 1) (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
(*integration by substitution*)
[PROOF STATE]
proof (state)
this:
integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral (cbox 0 1) (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
have comp_in_eq_comp_out: "\<forall>x \<in> {0..1}.
            (vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x within {0..1}))
                = (vector_derivative \<gamma> (at x within {0..1})) \<bullet> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{0..1}. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
fix x:: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
assume x_bounds: "x \<in> {0..1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0..1}

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0..1}
[PROOF STEP]
have "\<gamma> differentiable at x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..1}

goal (1 subgoal):
 1. \<gamma> differentiable at x
[PROOF STEP]
using gamma_differentiable
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..1}
\<forall>x\<in>{0..1}. \<gamma> differentiable at x

goal (1 subgoal):
 1. \<gamma> differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<gamma> differentiable at x

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<gamma> differentiable at x
[PROOF STEP]
have dotprod_in_is_out:
      "vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x)
                         = (vector_derivative \<gamma> (at x)) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
\<gamma> differentiable at x

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
[PROOF STEP]
using derivative_component_fun_component
[PROOF STATE]
proof (prove)
using this:
\<gamma> differentiable at x
?f differentiable at ?x \<Longrightarrow> vector_derivative ?f (at ?x) \<bullet> ?i = vector_derivative (\<lambda>x. ?f x \<bullet> ?i) (at ?x)

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
[PROOF STEP]
have 0: "(vector_derivative \<gamma> (at x)) \<bullet> i
                         = (vector_derivative \<gamma> (at x within {0..1})) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
using has_vector_derivative_at_within and x_bounds and vector_derivative_at_within_ivl
[PROOF STATE]
proof (prove)
using this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> (?f has_vector_derivative ?f') (at ?x within ?S)
x \<in> {0..1}
\<lbrakk>(?f has_vector_derivative ?f') (at ?x); ?a \<le> ?x; ?x \<le> ?b; ?a < ?b\<rbrakk> \<Longrightarrow> vector_derivative ?f (at ?x within {?a..?b}) = ?f'

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
by (smt atLeastAtMost_iff gamma_differentiable inner_commute vector_derivative_works)
[PROOF STATE]
proof (state)
this:
vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
have 1: "vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma>(x) \<bullet> i) (at x within {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
using path_vector_deriv_line_integrals and vector_derivative_at_within_ivl and
        x_bounds
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{0..1}. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)) (at x)
\<lbrakk>(?f has_vector_derivative ?f') (at ?x); ?a \<le> ?x; ?x \<le> ?b; ?a < ?b\<rbrakk> \<Longrightarrow> vector_derivative ?f (at ?x within {?a..?b}) = ?f'
x \<in> {0..1}

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})

goal (1 subgoal):
 1. \<And>x. x \<in> {0..1} \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
show "vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
using 0 and 1 and dotprod_in_is_out
[PROOF STATE]
proof (prove)
using this:
vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{0..1}. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
show "integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) =
                   integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
using substitute and comp_in_eq_comp_out and
      Henstock_Kurzweil_Integration.integral_cong
      [of "{0..1}" "(\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i))"
        "(\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))"]
[PROOF STATE]
proof (prove)
using this:
integral (cbox (pathstart \<gamma> \<bullet> i) (pathfinish \<gamma> \<bullet> i)) (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i) = integral (cbox 0 1) (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))
\<forall>x\<in>{0..1}. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}) = vector_derivative \<gamma> (at x within {0..1}) \<bullet> i
(\<And>x. x \<in> {0..1} \<Longrightarrow> F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})) \<Longrightarrow> integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1}))

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = integral {pathstart \<gamma> \<bullet> i..pathfinish \<gamma> \<bullet> i} (\<lambda>f_var. F (f_var *\<^sub>R i + g f_var) \<bullet> i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_Zp_mult:
  assumes "a \<in> \<O>\<^sub>p"
  assumes "b \<in> \<O>\<^sub>p"
  shows "to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> (to_Zp b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
have "(a \<otimes> b) \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<in> \<O>\<^sub>p
[PROOF STEP]
by (simp add: val_ring_subring assms(1) assms(2) subringE(6))
[PROOF STATE]
proof (state)
this:
a \<otimes> b \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<otimes> b \<in> \<O>\<^sub>p
[PROOF STEP]
have
    "\<iota> ((to_Zp a) \<otimes>\<^bsub>Z\<^sub>p\<^esub> (to_Zp) b) =  ((\<iota> (to_Zp a)) \<otimes> (\<iota> (to_Zp b)))"
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> \<O>\<^sub>p

goal (1 subgoal):
 1. \<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = \<iota> (to_Zp a) \<otimes> \<iota> (to_Zp b)
[PROOF STEP]
using assms(1) assms(2) inc_of_prod inc_to_Zp
[PROOF STATE]
proof (prove)
using this:
a \<otimes> b \<in> \<O>\<^sub>p
a \<in> \<O>\<^sub>p
b \<in> \<O>\<^sub>p
\<lbrakk>?a \<in> carrier Z\<^sub>p; ?b \<in> carrier Z\<^sub>p\<rbrakk> \<Longrightarrow> \<iota> (?a \<otimes>\<^bsub>Z\<^sub>p\<^esub> ?b) = \<iota> ?a \<otimes> \<iota> ?b
?b \<in> carrier Z\<^sub>p \<Longrightarrow> to_Zp (\<iota> ?b) = ?b

goal (1 subgoal):
 1. \<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = \<iota> (to_Zp a) \<otimes> \<iota> (to_Zp b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = \<iota> (to_Zp a) \<otimes> \<iota> (to_Zp b)

goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = \<iota> (to_Zp a) \<otimes> \<iota> (to_Zp b)
[PROOF STEP]
have "\<iota> ((to_Zp a) \<otimes>\<^bsub>Z\<^sub>p\<^esub> (to_Zp) b) =  a \<otimes>b"
[PROOF STATE]
proof (prove)
using this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = \<iota> (to_Zp a) \<otimes> \<iota> (to_Zp b)

goal (1 subgoal):
 1. \<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = a \<otimes> b
[PROOF STEP]
by (simp add: assms(1) assms(2) to_Zp_inc)
[PROOF STATE]
proof (state)
this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = a \<otimes> b

goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = a \<otimes> b
[PROOF STEP]
have "to_Zp ( \<iota> ((to_Zp a) \<otimes>\<^bsub>Z\<^sub>p\<^esub> (to_Zp) b)) = to_Zp (a \<otimes>b)"
[PROOF STATE]
proof (prove)
using this:
\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b) = a \<otimes> b

goal (1 subgoal):
 1. to_Zp (\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b)) = to_Zp (a \<otimes> b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
to_Zp (\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b)) = to_Zp (a \<otimes> b)

goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
to_Zp (\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b)) = to_Zp (a \<otimes> b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
to_Zp (\<iota> (to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b)) = to_Zp (a \<otimes> b)

goal (1 subgoal):
 1. to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b
[PROOF STEP]
by (metis (no_types, opaque_lifting) Zp.domain_axioms val_ring_subring assms(1) assms(2)
        cring.cring_simprules(5) domain.axioms(1) inc_to_Zp subringE(1) subset_iff to_Zp_closed)
[PROOF STATE]
proof (state)
this:
to_Zp (a \<otimes> b) = to_Zp a \<otimes>\<^bsub>Z\<^sub>p\<^esub> to_Zp b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RDirProd_list_zero':
  shows "zero (RDirProd_list (R # Rs)) = (zero R) # (zero (RDirProd_list Rs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>RDirProd_list (R # Rs)\<^esub> = \<zero>\<^bsub>R\<^esub> # \<zero>\<^bsub>RDirProd_list Rs\<^esub>
[PROOF STEP]
unfolding RDirProd_list_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>R. (#) \<zero>\<^bsub>R\<^esub>) (R # Rs) [] = \<zero>\<^bsub>R\<^esub> # foldr (\<lambda>R. (#) \<zero>\<^bsub>R\<^esub>) Rs []
[PROOF STEP]
by simp


[STATEMENT]
lemma wft_param[param]:
    assumes "bijective S" "bijective L"
    shows "(wft, wft) \<in> \<langle>L\<rangle> set_rel \<rightarrow> \<langle>S\<rangle> set_rel \<rightarrow> \<langle>S \<times>\<^sub>r L \<times>\<^sub>r S\<rangle> set_rel \<rightarrow> bool_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (wft, wft) \<in> \<langle>L\<rangle>set_rel \<rightarrow> \<langle>S\<rangle>set_rel \<rightarrow> \<langle>S \<times>\<^sub>r L \<times>\<^sub>r S\<rangle>set_rel \<rightarrow> bool_rel
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bijective S
bijective L

goal (1 subgoal):
 1. (wft, wft) \<in> \<langle>L\<rangle>set_rel \<rightarrow> \<langle>S\<rangle>set_rel \<rightarrow> \<langle>S \<times>\<^sub>r L \<times>\<^sub>r S\<rangle>set_rel \<rightarrow> bool_rel
[PROOF STEP]
unfolding wft_def
[PROOF STATE]
proof (prove)
using this:
bijective S
bijective L

goal (1 subgoal):
 1. (\<lambda>L S T. \<forall>a\<in>L. \<forall>p\<in>S. is_singleton ((T `` {p}) `` {a}), \<lambda>L S T. \<forall>a\<in>L. \<forall>p\<in>S. is_singleton ((T `` {p}) `` {a})) \<in> \<langle>L\<rangle>set_rel \<rightarrow> \<langle>S\<rangle>set_rel \<rightarrow> \<langle>S \<times>\<^sub>r L \<times>\<^sub>r S\<rangle>set_rel \<rightarrow> bool_rel
[PROOF STEP]
by parametricity


[STATEMENT]
lemma linear_independent_extend_subspace:
  \<comment> \<open>legacy: use \<^term>\<open>construct\<close> instead\<close>
  assumes "vs1.independent B"
  shows "\<exists>g. linear s1 s2 g \<and> (\<forall>x\<in>B. g x = f x) \<and> range g = vs2.span (f`B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. linear (*a) (*b) g \<and> (\<forall>x\<in>B. g x = f x) \<and> range g = vs2.span (f ` B)
[PROOF STEP]
by (rule exI[where x="construct B f"])
    (auto simp: linear_construct assms construct_basis range_construct_eq_span)


[STATEMENT]
lemma wfBoolLess:
  shows "wf boolLess"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf boolLess
[PROOF STEP]
proof (rule finite_acyclic_wf)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite boolLess
 2. acyclic boolLess
[PROOF STEP]
show "finite boolLess"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite boolLess
[PROOF STEP]
unfolding boolLess_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(True, False)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite boolLess

goal (1 subgoal):
 1. acyclic boolLess
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. acyclic boolLess
[PROOF STEP]
have "boolLess^+ = boolLess"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. boolLess\<^sup>+ = boolLess
[PROOF STEP]
using transBoolLess
[PROOF STATE]
proof (prove)
using this:
trans boolLess

goal (1 subgoal):
 1. boolLess\<^sup>+ = boolLess
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
boolLess\<^sup>+ = boolLess

goal (1 subgoal):
 1. acyclic boolLess
[PROOF STEP]
thus "acyclic boolLess"
[PROOF STATE]
proof (prove)
using this:
boolLess\<^sup>+ = boolLess

goal (1 subgoal):
 1. acyclic boolLess
[PROOF STEP]
unfolding boolLess_def
[PROOF STATE]
proof (prove)
using this:
{(True, False)}\<^sup>+ = {(True, False)}

goal (1 subgoal):
 1. acyclic {(True, False)}
[PROOF STEP]
unfolding acyclic_def
[PROOF STATE]
proof (prove)
using this:
{(True, False)}\<^sup>+ = {(True, False)}

goal (1 subgoal):
 1. \<forall>x. (x, x) \<notin> {(True, False)}\<^sup>+
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
acyclic boolLess

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iIN_subset: "\<lbrakk> n \<le> n'; n' + d' \<le> n + d \<rbrakk> \<Longrightarrow> [n'\<dots>,d'] \<subseteq> [n\<dots>,d]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> n'; n' + d' \<le> n + d\<rbrakk> \<Longrightarrow> [n'\<dots>,d'] \<subseteq> [n\<dots>,d]
[PROOF STEP]
by (simp add: iIN_subset_conv)


[STATEMENT]
lemma path_connected_Iic[simp]: "path_connected {..a}" for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected {..a}
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma take_apply_SA_closed:
  assumes "f \<in> carrier (SA n)"
  assumes "k \<ge> n"
  shows "take_apply k n f \<in> carrier (SA k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_apply k n f \<in> carrier (SA k)
[PROOF STEP]
apply(rule SA_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. take_apply k n f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>k\<^esup>)) Q\<^sub>p)
 2. is_semialg_function k (take_apply k n f)
[PROOF STEP]
using SA_car_memE(2) assms(1) assms(2) take_apply_closed
[PROOF STATE]
proof (prove)
using this:
?f \<in> carrier (SA ?n) \<Longrightarrow> ?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p)
f \<in> carrier (SA n)
n \<le> k
\<lbrakk>?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p); ?n \<le> ?k\<rbrakk> \<Longrightarrow> take_apply ?k ?n ?f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>?k\<^esup>)) Q\<^sub>p)

goal (2 subgoals):
 1. take_apply k n f \<in> carrier (function_ring (carrier (Q\<^sub>p\<^bsup>k\<^esup>)) Q\<^sub>p)
 2. is_semialg_function k (take_apply k n f)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialg_function k (take_apply k n f)
[PROOF STEP]
using assms take_is_semialg_map[of n k]
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
n \<le> k
n \<le> k \<Longrightarrow> is_semialg_map k n (take n)

goal (1 subgoal):
 1. is_semialg_function k (take_apply k n f)
[PROOF STEP]
unfolding take_apply_def
[PROOF STATE]
proof (prove)
using this:
f \<in> carrier (SA n)
n \<le> k
n \<le> k \<Longrightarrow> is_semialg_map k n (take n)

goal (1 subgoal):
 1. is_semialg_function k (restrict (f \<circ> take n) (carrier (Q\<^sub>p\<^bsup>k\<^esup>)))
[PROOF STEP]
by (metis padic_fields.SA_imp_semialg
      padic_fields_axioms restrict_is_semialg semialg_function_comp_closed)


[STATEMENT]
lemma submultiset_implies_subset: assumes "M \<subseteq># N" shows "set_mset M \<subseteq> set_mset N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset M \<subseteq> set_mset N
[PROOF STEP]
using assms mset_subset_eqD
[PROOF STATE]
proof (prove)
using this:
M \<subseteq># N
\<lbrakk>?A \<subseteq># ?B; ?x \<in># ?A\<rbrakk> \<Longrightarrow> ?x \<in># ?B

goal (1 subgoal):
 1. set_mset M \<subseteq> set_mset N
[PROOF STEP]
by auto