[STATEMENT]
lemma integral_less:
  fixes f :: "'n::euclidean_space \<Rightarrow> real"
  assumes cont: "continuous_on (cbox a b) f" "continuous_on (cbox a b) g" and ne: "box a b \<noteq> {}"
    and fg: "\<And>x. x \<in> box a b \<Longrightarrow> f x < g x"
  shows "integral (cbox a b) f < integral (cbox a b) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
obtain int: "f integrable_on (cbox a b)" "g integrable_on (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>f integrable_on cbox a b; g integrable_on cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cont integrable_continuous
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) f
continuous_on (cbox a b) g
continuous_on (cbox ?a ?b) ?f \<Longrightarrow> ?f integrable_on cbox ?a ?b

goal (1 subgoal):
 1. (\<lbrakk>f integrable_on cbox a b; g integrable_on cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f integrable_on cbox a b
g integrable_on cbox a b

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f integrable_on cbox a b
g integrable_on cbox a b
[PROOF STEP]
have "integral (cbox a b) f \<le> integral (cbox a b) g"
[PROOF STATE]
proof (prove)
using this:
f integrable_on cbox a b
g integrable_on cbox a b

goal (1 subgoal):
 1. integral (cbox a b) f \<le> integral (cbox a b) g
[PROOF STEP]
by (metis fg integrable_on_open_interval integral_le integral_open_interval less_eq_real_def)
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<le> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<le> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
have "integral (cbox a b) f \<noteq> integral (cbox a b) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
assume "\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g"
[PROOF STATE]
proof (state)
this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
have 0: "((\<lambda>x. g x - f x) has_integral 0) (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
\<not> integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. ((\<lambda>x. g x - f x) has_integral 0) (cbox a b)
[PROOF STEP]
by (metis (full_types) cancel_comm_monoid_add_class.diff_cancel has_integral_diff int
                integrable_integral)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. g x - f x) has_integral 0) (cbox a b)

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
have cgf: "continuous_on (cbox a b) (\<lambda>x. g x - f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. g x - f x)
[PROOF STEP]
using cont continuous_on_diff
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox a b) f
continuous_on (cbox a b) g
\<lbrakk>continuous_on ?s ?f; continuous_on ?s ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (\<lambda>x. ?f x - ?g x)

goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. g x - f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) (\<lambda>x. g x - f x)

goal (1 subgoal):
 1. \<not> integral (cbox a b) f \<noteq> integral (cbox a b) g \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using has_integral_0_cbox_imp_0 [OF cgf _ 0] ne box_subset_cbox fg
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x. x \<in> box a b \<Longrightarrow> 0 \<le> g x - f x; box a b \<noteq> {}; ?x \<in> cbox a b\<rbrakk> \<Longrightarrow> g ?x - f ?x = 0
box a b \<noteq> {}
box ?a ?b \<subseteq> cbox ?a ?b
?x \<in> box a b \<Longrightarrow> f ?x < g ?x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
integral (cbox a b) f \<le> integral (cbox a b) g
integral (cbox a b) f \<noteq> integral (cbox a b) g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral (cbox a b) f \<le> integral (cbox a b) g
integral (cbox a b) f \<noteq> integral (cbox a b) g

goal (1 subgoal):
 1. integral (cbox a b) f < integral (cbox a b) g
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
integral (cbox a b) f < integral (cbox a b) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjunctiveI:
  assumes "(\<And>b c. times_abc a (inf_b b c) = inf_c (times_abc a b) (times_abc a c))"
  shows "a \<in> conjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> conjunctive
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
times_abc a (inf_b ?b ?c) = inf_c (times_abc a ?b) (times_abc a ?c)

goal (1 subgoal):
 1. a \<in> conjunctive
[PROOF STEP]
by (simp add: conjunctive_def)


[STATEMENT]
lemma is_zero_uminus[simp]: "is_zero (- a) \<longleftrightarrow> is_zero a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero (- a) = is_zero a
[PROOF STEP]
by (simp add: is_zero_def)


[STATEMENT]
lemma elements_matD [dest]:
  "a \<in> elements_mat A \<Longrightarrow> \<exists>i j. i < dim_row A \<and> j < dim_col A \<and> a = A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> elements_mat A \<Longrightarrow> \<exists>i j. i < dim_row A \<and> j < dim_col A \<and> a = A $$ (i, j)
[PROOF STEP]
unfolding elements_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> set (concat (map (\<lambda>i. map (\<lambda>j. A $$ (i, j)) [0..<dim_col A]) [0..<dim_row A])) \<Longrightarrow> \<exists>i j. i < dim_row A \<and> j < dim_col A \<and> a = A $$ (i, j)
[PROOF STEP]
by force


[STATEMENT]
lemma row_space_subset_phull:
  assumes "Keys (set ps) \<subseteq> set ts"
  shows "row_to_poly ts ` row_space (polys_to_mat ts ps) \<subseteq> phull (set ps)"
    (is "?r \<subseteq> ?h")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts ` row_space (polys_to_mat ts ps) \<subseteq> phull (set ps)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
assume "q \<in> ?r"
[PROOF STATE]
proof (state)
this:
q \<in> row_to_poly ts ` row_space (polys_to_mat ts ps)

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q \<in> row_to_poly ts ` row_space (polys_to_mat ts ps)
[PROOF STEP]
obtain x where x1: "x \<in> row_space (polys_to_mat ts ps)"
    and q1: "q = row_to_poly ts x"
[PROOF STATE]
proof (prove)
using this:
q \<in> row_to_poly ts ` row_space (polys_to_mat ts ps)

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> row_space (polys_to_mat ts ps); q = row_to_poly ts x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<in> row_space (polys_to_mat ts ps)
q = row_to_poly ts x

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
from x1
[PROOF STATE]
proof (chain)
picking this:
x \<in> row_space (polys_to_mat ts ps)
[PROOF STEP]
obtain v where v: "v \<in> carrier_vec (dim_row (polys_to_mat ts ps))" and x: "x = v \<^sub>v* polys_to_mat ts ps"
[PROOF STATE]
proof (prove)
using this:
x \<in> row_space (polys_to_mat ts ps)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec (dim_row (polys_to_mat ts ps)); x = v \<^sub>v* polys_to_mat ts ps\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule row_spaceE)
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (dim_row (polys_to_mat ts ps))
x = v \<^sub>v* polys_to_mat ts ps

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
from v
[PROOF STATE]
proof (chain)
picking this:
v \<in> carrier_vec (dim_row (polys_to_mat ts ps))
[PROOF STEP]
have "v \<in> carrier_vec (length ps)"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec (dim_row (polys_to_mat ts ps))

goal (1 subgoal):
 1. v \<in> carrier_vec (length ps)
[PROOF STEP]
by (simp only: dim_row_polys_to_mat)
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (length ps)

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
thm vec_times_polys_to_mat
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec (length ps)

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
with x q1
[PROOF STATE]
proof (chain)
picking this:
x = v \<^sub>v* polys_to_mat ts ps
q = row_to_poly ts x
v \<in> carrier_vec (length ps)
[PROOF STEP]
have q: "q = (\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. c \<cdot> p)"
[PROOF STATE]
proof (prove)
using this:
x = v \<^sub>v* polys_to_mat ts ps
q = row_to_poly ts x
v \<in> carrier_vec (length ps)

goal (1 subgoal):
 1. q = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
by (simp add: vec_times_polys_to_mat[OF assms])
[PROOF STATE]
proof (state)
this:
q = sum_list (map2 (\<cdot>) (list_of_vec v) ps)

goal (1 subgoal):
 1. \<And>x. x \<in> row_to_poly ts ` row_space (polys_to_mat ts ps) \<Longrightarrow> x \<in> phull (set ps)
[PROOF STEP]
show "q \<in> ?h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> phull (set ps)
[PROOF STEP]
unfolding q
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<cdot>) (list_of_vec v) ps) \<in> phull (set ps)
[PROOF STEP]
by (rule phull.span_listI)
[PROOF STATE]
proof (state)
this:
q \<in> phull (set ps)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "A \<and> B \<longrightarrow> B \<and> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<and> B \<longrightarrow> B \<and> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<and> B \<Longrightarrow> B \<and> A
[PROOF STEP]
assume "A \<and> B"
[PROOF STATE]
proof (state)
this:
A \<and> B

goal (1 subgoal):
 1. A \<and> B \<Longrightarrow> B \<and> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<and> B
[PROOF STEP]
show "B \<and> A"
[PROOF STATE]
proof (prove)
using this:
A \<and> B

goal (1 subgoal):
 1. B \<and> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A; B\<rbrakk> \<Longrightarrow> B \<and> A
[PROOF STEP]
assume B A
[PROOF STATE]
proof (state)
this:
B
A

goal (1 subgoal):
 1. \<lbrakk>A; B\<rbrakk> \<Longrightarrow> B \<and> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B
A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
B
A

goal (1 subgoal):
 1. B \<and> A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
B \<and> A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B \<and> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_prod_power: "f has_prod a \<Longrightarrow> (\<lambda>i. f i ^ n) has_prod (a ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f has_prod a \<Longrightarrow> (\<lambda>i. f i ^ n) has_prod a ^ n
[PROOF STEP]
by (induction n) (auto simp: has_prod_mult)


[STATEMENT]
lemma restrict_to_indices_submultiset[simp]:
"restrict_to_indices m S \<subseteq># m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict_to_indices m S \<subseteq># m
[PROOF STEP]
unfolding restrict_to_indices_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#i \<in># m. i \<in> S#} \<subseteq># m
[PROOF STEP]
using multiset_filter_subset
[PROOF STATE]
proof (prove)
using this:
filter_mset ?f ?M \<subseteq># ?M

goal (1 subgoal):
 1. {#i \<in># m. i \<in> S#} \<subseteq># m
[PROOF STEP]
by blast


[STATEMENT]
lemma inner_zero_left [simp]: "inner 0 x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner (0::'a) x = 0
[PROOF STEP]
using inner_add_left [of 0 0 x]
[PROOF STATE]
proof (prove)
using this:
inner ((0::'a) + (0::'a)) x = inner (0::'a) x + inner (0::'a) x

goal (1 subgoal):
 1. inner (0::'a) x = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma filterlim_sequentially_iff:
  "filterlim f F1 sequentially \<longleftrightarrow> filterlim (\<lambda>x. f (x+k)) F1 sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F1 sequentially = (LIM x sequentially. f (x + k) :> F1)
[PROOF STEP]
unfolding filterlim_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>P. eventually P F1 \<longrightarrow> (\<forall>\<^sub>F x in sequentially. P (f x))) = (\<forall>P. eventually P F1 \<longrightarrow> (\<forall>\<^sub>F x in sequentially. P (f (x + k))))
[PROOF STEP]
by (metis eventually_at_top_linorder eventually_sequentially_seg)


[STATEMENT]
lemma x_y_split [simp]: "(x \<sqinter> nc) \<cdot> y + x \<cdot> 0 = x \<cdot> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<sqinter> nc) \<cdot> y + x \<cdot> (0::'a) = x \<cdot> y
[PROOF STEP]
by (metis c_0 local.cl6 local.s_prod_distr x_split)


[STATEMENT]
lemma dims_nths_one_lt_n:
  assumes "l < n"
  shows "nths dims {l} = [2]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
have "{i. i < length dims \<and> i \<in> {l}} = {l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i < length dims \<and> i \<in> {l}} = {l}
[PROOF STEP]
using assms length_dims
[PROOF STATE]
proof (prove)
using this:
l < n
length dims = n + 1

goal (1 subgoal):
 1. {i. i < length dims \<and> i \<in> {l}} = {l}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{i. i < length dims \<and> i \<in> {l}} = {l}

goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{i. i < length dims \<and> i \<in> {l}} = {l}
[PROOF STEP]
have "nths dims {l} = [dims ! l]"
[PROOF STATE]
proof (prove)
using this:
{i. i < length dims \<and> i \<in> {l}} = {l}

goal (1 subgoal):
 1. nths dims {l} = [dims ! l]
[PROOF STEP]
using nths_only_one[of dims "{l}" l]
[PROOF STATE]
proof (prove)
using this:
{i. i < length dims \<and> i \<in> {l}} = {l}
{i. i < length dims \<and> i \<in> {l}} = {l} \<Longrightarrow> nths dims {l} = [dims ! l]

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

goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
nths dims {l} = [dims ! l]

goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
have "dims ! l = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims ! l = 2
[PROOF STEP]
unfolding dims_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (replicate n 2 @ [K]) ! l = 2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < n

goal (1 subgoal):
 1. (replicate n 2 @ [K]) ! l = 2
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
dims ! l = 2

goal (1 subgoal):
 1. nths dims {l} = [2]
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
nths dims {l} = [dims ! l]
dims ! l = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nths dims {l} = [dims ! l]
dims ! l = 2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma path_appendI: "path v v' pth1 \<Longrightarrow> path v' v'' pth2 \<Longrightarrow> path v v'' (pth1@pth2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path v v' pth1; path v' v'' pth2\<rbrakk> \<Longrightarrow> path v v'' (pth1 @ pth2)
[PROOF STEP]
by (induction pth1 arbitrary: v) (auto simp add: path_cons_simp )


[STATEMENT]
lemma mat_minus_minus:
  fixes A :: "'a :: ab_group_add Matrix.mat"
  assumes "A \<in> carrier_mat n m"
  and "B\<in> carrier_mat n m"
  and "C\<in> carrier_mat n m"
shows "A - (B - C) = A - B + C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A - (B - C) = A - B + C
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
 2. dim_row (A - (B - C)) = dim_row (A - B + C)
 3. dim_col (A - (B - C)) = dim_col (A - B + C)
[PROOF STEP]
show "dim_row (A - (B - C)) = dim_row (A - B + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (A - (B - C)) = dim_row (A - B + C)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
B \<in> carrier_mat n m
C \<in> carrier_mat n m

goal (1 subgoal):
 1. dim_row (A - (B - C)) = dim_row (A - B + C)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (A - (B - C)) = dim_row (A - B + C)

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
 2. dim_col (A - (B - C)) = dim_col (A - B + C)
[PROOF STEP]
show "dim_col (A - (B - C)) = dim_col (A - B + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (A - (B - C)) = dim_col (A - B + C)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
B \<in> carrier_mat n m
C \<in> carrier_mat n m

goal (1 subgoal):
 1. dim_col (A - (B - C)) = dim_col (A - B + C)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (A - (B - C)) = dim_col (A - B + C)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
show "\<And>i j. i < dim_row (A - B + C) \<Longrightarrow> j < dim_col (A - B + C) \<Longrightarrow>
    (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
assume "i < dim_row (A - B + C)" and "j < dim_col (A - B + C)"
[PROOF STATE]
proof (state)
this:
i < dim_row (A - B + C)
j < dim_col (A - B + C)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
note ij = this
[PROOF STATE]
proof (state)
this:
i < dim_row (A - B + C)
j < dim_col (A - B + C)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
have "(A - (B - C)) $$ (i, j) = (A $$ (i,j) - B $$ (i,j) + C $$ (i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A - (B - C)) $$ (i, j) = A $$ (i, j) - B $$ (i, j) + C $$ (i, j)
[PROOF STEP]
using ij assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row (A - B + C)
j < dim_col (A - B + C)
A \<in> carrier_mat n m
B \<in> carrier_mat n m
C \<in> carrier_mat n m

goal (1 subgoal):
 1. (A - (B - C)) $$ (i, j) = A $$ (i, j) - B $$ (i, j) + C $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(A - (B - C)) $$ (i, j) = A $$ (i, j) - B $$ (i, j) + C $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A - (B - C)) $$ (i, j) = A $$ (i, j) - B $$ (i, j) + C $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
have "... = (A - B + C) $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) - B $$ (i, j) + C $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
using assms ij
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n m
B \<in> carrier_mat n m
C \<in> carrier_mat n m
i < dim_row (A - B + C)
j < dim_col (A - B + C)

goal (1 subgoal):
 1. A $$ (i, j) - B $$ (i, j) + C $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A $$ (i, j) - B $$ (i, j) + C $$ (i, j) = (A - B + C) $$ (i, j)

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (A - B + C); j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
show "(A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
(A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)

goal (1 subgoal):
 1. (A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(A - (B - C)) $$ (i, j) = (A - B + C) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < dim_row (A - B + C); ?j < dim_col (A - B + C)\<rbrakk> \<Longrightarrow> (A - (B - C)) $$ (?i, ?j) = (A - B + C) $$ (?i, ?j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma greaterThanLessThan_eq: "{a<\<^sub>a..<\<^sub>ab} = {a<\<^sub>a..} \<inter> {..<\<^sub>ab}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a<\<^sub>a..<\<^sub>ab} = {a<\<^sub>a..} \<inter> {..<\<^sub>ab}
[PROOF STEP]
unfolding interval_def ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> UNIV. a <\<^sub>a x} \<inter> {x \<in> UNIV. x <\<^sub>a b} = {x \<in> UNIV. a <\<^sub>a x} \<inter> {x \<in> UNIV. x <\<^sub>a b}
[PROOF STEP]
by simp


[STATEMENT]
lemma hurwitz_zeta_cnj [simp]: "a > 0 \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
assume "a > 0"
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
have "cnj z = 1 \<longleftrightarrow> z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cnj z = 1) = (z = 1)
[PROOF STEP]
by (simp add: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
(cnj z = 1) = (z = 1)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < a
(cnj z = 1) = (z = 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < a
(cnj z = 1) = (z = 1)

goal (1 subgoal):
 1. hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)
[PROOF STEP]
by (auto simp: hurwitz_zeta_def cnj_powr)
[PROOF STATE]
proof (state)
this:
hurwitz_zeta a (cnj z) = cnj (hurwitz_zeta a z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid_add) prod_list_prod_nth:
  "prod_list xs = (\<Prod>i=0..<length xs. xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
have "xs = map (\<lambda>i. xs ! i) [0..<length xs]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = map ((!) xs) [0..<length xs]
[PROOF STEP]
by (simp add: map_nth)
[PROOF STATE]
proof (state)
this:
xs = map ((!) xs) [0..<length xs]

goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
xs = map ((!) xs) [0..<length xs]

goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
have "prod_list \<dots> = (\<Prod>i=0..<length xs. xs ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (map ((!) xs) [0..<length xs]) = prod ((!) xs) {0..<length xs}
[PROOF STEP]
by (subst prod.distinct_set_conv_list [symmetric]) auto
[PROOF STATE]
proof (state)
this:
prod_list (map ((!) xs) [0..<length xs]) = prod ((!) xs) {0..<length xs}

goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prod_list xs = prod ((!) xs) {0..<length xs}

goal (1 subgoal):
 1. prod_list xs = prod ((!) xs) {0..<length xs}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod_list xs = prod ((!) xs) {0..<length xs}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma times_canc_left:
  assumes "h * p = h * q" and "h \<noteq> (0::('x::linorder \<Rightarrow>\<^sub>0 nat) \<Rightarrow>\<^sub>0 'a::ring_no_zero_divisors)"
  shows "p = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = q
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
assume "p \<noteq> q"
[PROOF STATE]
proof (state)
this:
p \<noteq> q

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
hence "p - q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q

goal (1 subgoal):
 1. p - q \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p - q \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
h \<noteq> 0
p - q \<noteq> 0
[PROOF STEP]
have "h * (p - q) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
h \<noteq> 0
p - q \<noteq> 0

goal (1 subgoal):
 1. h * (p - q) \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
h * (p - q) \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
hence "h * p \<noteq> h * q"
[PROOF STATE]
proof (prove)
using this:
h * (p - q) \<noteq> 0

goal (1 subgoal):
 1. h * p \<noteq> h * q
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
h * p \<noteq> h * q

goal (1 subgoal):
 1. p \<noteq> q \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
h * p \<noteq> h * q

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
h * p \<noteq> h * q
h * p = h * q

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma concat_all_nth:
  assumes "length xs = length ys"
    and "\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i)"
    and "\<And>i j. i < length xs \<Longrightarrow> j < length (xs ! i) \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)"
  shows "\<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
?i < length xs \<Longrightarrow> length (xs ! ?i) = length (ys ! ?i)
\<lbrakk>?i < length xs; ?j < length (xs ! ?i)\<rbrakk> \<Longrightarrow> P (xs ! ?i ! ?j) (ys ! ?i ! ?j)

goal (1 subgoal):
 1. \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)
[PROOF STEP]
proof (induct xs ys rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
\<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)
?i < length (x # xs) \<Longrightarrow> length ((x # xs) ! ?i) = length ((y # ys) ! ?i)
\<lbrakk>?i < length (x # xs); ?j < length ((x # xs) ! ?i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! ?i ! ?j) ((y # ys) ! ?i ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
from Cons(3)[of 0]
[PROOF STATE]
proof (chain)
picking this:
0 < length (x # xs) \<Longrightarrow> length ((x # xs) ! 0) = length ((y # ys) ! 0)
[PROOF STEP]
have xy: "length x = length y"
[PROOF STATE]
proof (prove)
using this:
0 < length (x # xs) \<Longrightarrow> length ((x # xs) ! 0) = length ((y # ys) ! 0)

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

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
from Cons(4)[of 0] xy
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (x # xs); ?j < length ((x # xs) ! 0)\<rbrakk> \<Longrightarrow> P ((x # xs) ! 0 ! ?j) ((y # ys) ! 0 ! ?j)
length x = length y
[PROOF STEP]
have pxy: "\<And> j. j < length x \<Longrightarrow> P (x ! j) (y ! j)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (x # xs); ?j < length ((x # xs) ! 0)\<rbrakk> \<Longrightarrow> P ((x # xs) ! 0 ! ?j) ((y # ys) ! 0 ! ?j)
length x = length y

goal (1 subgoal):
 1. \<And>j. j < length x \<Longrightarrow> P (x ! j) (y ! j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j < length x \<Longrightarrow> P (x ! ?j) (y ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?j < length x \<Longrightarrow> P (x ! ?j) (y ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
assume i: "i < length xs"
[PROOF STATE]
proof (state)
this:
i < length xs

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
with Cons(3)[of "Suc i"]
[PROOF STATE]
proof (chain)
picking this:
Suc i < length (x # xs) \<Longrightarrow> length ((x # xs) ! Suc i) = length ((y # ys) ! Suc i)
i < length xs
[PROOF STEP]
have len: "length (xs ! i) = length (ys ! i)"
[PROOF STATE]
proof (prove)
using this:
Suc i < length (x # xs) \<Longrightarrow> length ((x # xs) ! Suc i) = length ((y # ys) ! Suc i)
i < length xs

goal (1 subgoal):
 1. length (xs ! i) = length (ys ! i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (xs ! i) = length (ys ! i)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
from Cons(4)[of "Suc i"] i
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Suc i < length (x # xs); ?j < length ((x # xs) ! Suc i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! Suc i ! ?j) ((y # ys) ! Suc i ! ?j)
i < length xs
[PROOF STEP]
have "\<And> j. j < length (xs ! i) \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Suc i < length (x # xs); ?j < length ((x # xs) ! Suc i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! Suc i ! ?j) ((y # ys) ! Suc i ! ?j)
i < length xs

goal (1 subgoal):
 1. \<And>j. j < length (xs ! i) \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j < length (xs ! i) \<Longrightarrow> P (xs ! i ! ?j) (ys ! i ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
note len and this
[PROOF STATE]
proof (state)
this:
length (xs ! i) = length (ys ! i)
?j < length (xs ! i) \<Longrightarrow> P (xs ! i ! ?j) (ys ! i ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i3 < length xs \<Longrightarrow> length (xs ! ?i3) = length (ys ! ?i3)
\<lbrakk>?i3 < length xs; ?j < length (xs ! ?i3)\<rbrakk> \<Longrightarrow> P (xs ! ?i3 ! ?j) (ys ! ?i3 ! ?j)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
from Cons(2)[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>i. i < length xs \<Longrightarrow> i < length xs; \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> i < length xs; \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> j < length (xs ! i)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)
[PROOF STEP]
have ind: "\<And> k. k < length (concat xs) \<Longrightarrow> P (concat xs ! k) (concat ys ! k)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>i. i < length xs \<Longrightarrow> i < length xs; \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> i < length xs; \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> j < length (xs ! i)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k)

goal (1 subgoal):
 1. \<And>k. k < length (concat xs) \<Longrightarrow> P (concat xs ! k) (concat ys ! k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < length (concat xs) \<Longrightarrow> P (concat xs ! ?k) (concat ys ! ?k)

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>\<And>i. i < length xs \<Longrightarrow> length (xs ! i) = length (ys ! i); \<And>i j. \<lbrakk>i < length xs; j < length (xs ! i)\<rbrakk> \<Longrightarrow> P (xs ! i ! j) (ys ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat xs). P (concat xs ! k) (concat ys ! k); \<And>i. i < length (x # xs) \<Longrightarrow> length ((x # xs) ! i) = length ((y # ys) ! i); \<And>i j. \<lbrakk>i < length (x # xs); j < length ((x # xs) ! i)\<rbrakk> \<Longrightarrow> P ((x # xs) ! i ! j) ((y # ys) ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)
[PROOF STEP]
unfolding concat.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k<length (x @ concat xs). P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k < length (x @ concat xs) \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
fix k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k < length (x @ concat xs) \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
assume k: "k < length (x @ concat xs)"
[PROOF STATE]
proof (state)
this:
k < length (x @ concat xs)

goal (1 subgoal):
 1. \<And>k. k < length (x @ concat xs) \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
show "P ((x @ concat xs) ! k) ((y @ concat ys) ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
proof (cases "k < length x")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
 2. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k < length x

goal (2 subgoals):
 1. k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
 2. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
unfolding nth_append
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (if k < length x then x ! k else concat xs ! (k - length x)) (if k < length y then y ! k else concat ys ! (k - length y))
[PROOF STEP]
using True xy pxy[OF True]
[PROOF STATE]
proof (prove)
using this:
k < length x
length x = length y
P (x ! k) (y ! k)

goal (1 subgoal):
 1. P (if k < length x then x ! k else concat xs ! (k - length x)) (if k < length y then y ! k else concat ys ! (k - length y))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P ((x @ concat xs) ! k) ((y @ concat ys) ! k)

goal (1 subgoal):
 1. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k < length x

goal (1 subgoal):
 1. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
with k
[PROOF STATE]
proof (chain)
picking this:
k < length (x @ concat xs)
\<not> k < length x
[PROOF STEP]
have "k - (length x) < length (concat xs)"
[PROOF STATE]
proof (prove)
using this:
k < length (x @ concat xs)
\<not> k < length x

goal (1 subgoal):
 1. k - length x < length (concat xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k - length x < length (concat xs)

goal (1 subgoal):
 1. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k - length x < length (concat xs)
[PROOF STEP]
obtain n where n: "k - length x = n" and nxs: "n < length (concat xs)"
[PROOF STATE]
proof (prove)
using this:
k - length x < length (concat xs)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>k - length x = n; n < length (concat xs)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k - length x = n
n < length (concat xs)

goal (1 subgoal):
 1. \<not> k < length x \<Longrightarrow> P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ((x @ concat xs) ! k) ((y @ concat ys) ! k)
[PROOF STEP]
unfolding nth_append n n[unfolded xy]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (if k < length x then x ! k else concat xs ! n) (if k < length y then y ! k else concat ys ! n)
[PROOF STEP]
using False xy ind[OF nxs]
[PROOF STATE]
proof (prove)
using this:
\<not> k < length x
length x = length y
P (concat xs ! n) (concat ys ! n)

goal (1 subgoal):
 1. P (if k < length x then x ! k else concat xs ! n) (if k < length y then y ! k else concat ys ! n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P ((x @ concat xs) ! k) ((y @ concat ys) ! k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P ((x @ concat xs) ! k) ((y @ concat ys) ! k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>k<length (concat (x # xs)). P (concat (x # xs) ! k) (concat (y # ys) ! k)

goal (1 subgoal):
 1. \<lbrakk>\<And>i. i < length [] \<Longrightarrow> length ([] ! i) = length ([] ! i); \<And>i j. \<lbrakk>i < length []; j < length ([] ! i)\<rbrakk> \<Longrightarrow> P ([] ! i ! j) ([] ! i ! j)\<rbrakk> \<Longrightarrow> \<forall>k<length (concat []). P (concat [] ! k) (concat [] ! k)
[PROOF STEP]
qed auto


[STATEMENT]
lemma lm063:
  assumes "inj_on g X"
  shows "sum f (g`X) = sum (f \<circ> g) X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f (g ` X) = sum (f \<circ> g) X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on g X

goal (1 subgoal):
 1. sum f (g ` X) = sum (f \<circ> g) X
[PROOF STEP]
by (metis sum.reindex)


[STATEMENT]
lemma subst_fm_ShiftP [simp]:
  "(ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
obtain x::name and x'::name and y::name and z::name
  where "atom x \<sharp> (x',y,z,f,del,k,i,u)" "atom x' \<sharp> (y,z,f,del,k,i,u)"
        "atom y \<sharp> (z,f,del,k,i,u)" "atom z \<sharp> (f,del,g,k,i,u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x x' y z. \<lbrakk>atom x \<sharp> (x', y, z, f, del, k, i, u); atom x' \<sharp> (y, z, f, del, k, i, u); atom y \<sharp> (z, f, del, k, i, u); atom z \<sharp> (f, del, g, k, i, u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom x \<sharp> (x', y, z, f, del, k, i, u)
atom x' \<sharp> (y, z, f, del, k, i, u)
atom y \<sharp> (z, f, del, k, i, u)
atom z \<sharp> (f, del, g, k, i, u)

goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom x \<sharp> (x', y, z, f, del, k, i, u)
atom x' \<sharp> (y, z, f, del, k, i, u)
atom y \<sharp> (z, f, del, k, i, u)
atom z \<sharp> (f, del, g, k, i, u)

goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
by (auto simp: ShiftP.simps [of x x' y z])
[PROOF STATE]
proof (state)
this:
(ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_mdpcI: "states M \<subseteq> states N \<Longrightarrow> (\<And>s. s \<in> states M \<Longrightarrow> actions M s \<subseteq> actions N s) \<Longrightarrow> M \<le> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>states M \<subseteq> states N; \<And>s. s \<in> states M \<Longrightarrow> actions M s \<subseteq> actions N s\<rbrakk> \<Longrightarrow> M \<le> N
[PROOF STEP]
by transfer
     (force simp: fun_ord_def ord_option.simps subset_eq split: option.splits)


[STATEMENT]
lemma convergent_ignore_initial_segment: "convergent (\<lambda>n. f (n + m)) = convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (n + m)) = convergent f
[PROOF STEP]
proof (induct m arbitrary: f)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. convergent (\<lambda>n. f (n + 0)) = convergent f
 2. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>f. convergent (\<lambda>n. f (n + 0)) = convergent f
 2. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (n + 0)) = convergent f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (n + 0)) = convergent f

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. ?f (n + m)) = convergent ?f

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
have "convergent (\<lambda>n. f (n + Suc m)) \<longleftrightarrow> convergent (\<lambda>n. f (Suc n + m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (n + Suc m)) = convergent (\<lambda>n. f (Suc n + m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (n + Suc m)) = convergent (\<lambda>n. f (Suc n + m))

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (n + Suc m)) = convergent (\<lambda>n. f (Suc n + m))

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
have "\<dots> \<longleftrightarrow> convergent (\<lambda>n. f (n + m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (Suc n + m)) = convergent (\<lambda>n. f (n + m))
[PROOF STEP]
by (rule convergent_Suc_iff)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (Suc n + m)) = convergent (\<lambda>n. f (n + m))

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (Suc n + m)) = convergent (\<lambda>n. f (n + m))

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
have "\<dots> \<longleftrightarrow> convergent f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. f (n + m)) = convergent f
[PROOF STEP]
by (rule Suc)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (n + m)) = convergent f

goal (1 subgoal):
 1. \<And>m f. (\<And>f. convergent (\<lambda>n. f (n + m)) = convergent f) \<Longrightarrow> convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. f (n + Suc m)) = convergent f

goal (1 subgoal):
 1. convergent (\<lambda>n. f (n + Suc m)) = convergent f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. f (n + Suc m)) = convergent f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isLubI:
  "\<lbrakk>L \<in> A; \<forall>y \<in> S. (y, L) \<in> r; (\<forall>z \<in> A. (\<forall>y \<in> S. (y, z)\<in>r) \<longrightarrow> (L, z) \<in> r)\<rbrakk> \<Longrightarrow> isLub S cl L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>L \<in> A; \<forall>y\<in>S. (y, L) \<in> r; \<forall>z\<in>A. (\<forall>y\<in>S. (y, z) \<in> r) \<longrightarrow> (L, z) \<in> r\<rbrakk> \<Longrightarrow> isLub S cl L
[PROOF STEP]
by (simp add: isLub_def A_def r_def)


[STATEMENT]
lemma lfp_cs_unfold: "lfp (step S) c = step S (lfp (step S) c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Collecting.lfp (step S) c = step S (Collecting.lfp (step S) c)
[PROOF STEP]
apply(rule lfp_unfold[OF _  mono_step])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i. (step S x \<in> {c'. strip c' = i}) = (x \<in> {c'. strip c' = i})
[PROOF STEP]
apply(simp add: strip_step)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lcl_trans_r:
  assumes "locally_compatible_l R1 R2 (A + B) (C + D) (E + F)"
  shows "locally_compatible_l R1 R2 B D F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally_compatible_l R1 R2 B D F
[PROOF STEP]
using assms[unfolded locally_compatible_l_def, rule_format]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R1; (?u, ?v) \<in> R2\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. locally_compatible_l R1 R2 B D F
[PROOF STEP]
unfolding locally_compatible_l_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t \<in># A + B; ?u \<in># C + D; ?v \<in># E + F; (?t, ?u) \<in> R1; (?u, ?v) \<in> R2\<rbrakk> \<Longrightarrow> (?t, ?v) \<in> R2

goal (1 subgoal):
 1. \<forall>t u v. t \<in># B \<longrightarrow> u \<in># D \<longrightarrow> v \<in># F \<longrightarrow> (t, u) \<in> R1 \<longrightarrow> (u, v) \<in> R2 \<longrightarrow> (t, v) \<in> R2
[PROOF STEP]
by auto


[STATEMENT]
lemma lin_indpt_list_add_vec: assumes
      i: "j < length us" "i < length us" "i \<noteq> j"
   and indep: "lin_indpt_list  us"
shows "lin_indpt_list (us [i := us ! i + c \<cdot>\<^sub>v us ! j])" (is "lin_indpt_list ?V")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from indep[unfolded lin_indpt_list_def]
[PROOF STATE]
proof (chain)
picking this:
set us \<subseteq> carrier_vec n \<and> distinct us \<and> lin_indpt (set us)
[PROOF STEP]
have us: "set us \<subseteq> carrier_vec n"
    and dist: "distinct us" and indep: "lin_indpt (set us)"
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n \<and> distinct us \<and> lin_indpt (set us)

goal (1 subgoal):
 1. set us \<subseteq> carrier_vec n &&& distinct us &&& lin_indpt (set us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set us \<subseteq> carrier_vec n
distinct us
lin_indpt (set us)

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
let ?E = "set us - {us ! i}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
let ?us = "insert (us ! i) ?E"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
let ?v = "us ! i + c \<cdot>\<^sub>v us ! j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from us i
[PROOF STATE]
proof (chain)
picking this:
set us \<subseteq> carrier_vec n
j < length us
i < length us
i \<noteq> j
[PROOF STEP]
have usi: "us ! i \<in> carrier_vec n" "us ! i \<notin> ?E" "us ! i \<in> set us"
    and usj: "us ! j \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. (us ! i \<in> carrier_vec n &&& us ! i \<notin> set us - {us ! i} &&& us ! i \<in> set us) &&& us ! j \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us
us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from usi usj
[PROOF STATE]
proof (chain)
picking this:
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us
us ! j \<in> carrier_vec n
[PROOF STEP]
have v: "?v \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us
us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have fin: "finite ?E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set us - {us ! i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have id: "set us = insert (us ! i) (set us - {us ! i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set us = insert (us ! i) (set us - {us ! i})
[PROOF STEP]
using i(2)
[PROOF STATE]
proof (prove)
using this:
i < length us

goal (1 subgoal):
 1. set us = insert (us ! i) (set us - {us ! i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set us = insert (us ! i) (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from dist i
[PROOF STATE]
proof (chain)
picking this:
distinct us
j < length us
i < length us
i \<noteq> j
[PROOF STEP]
have diff': "us ! i \<noteq> us ! j"
[PROOF STATE]
proof (prove)
using this:
distinct us
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. us ! i \<noteq> us ! j
[PROOF STEP]
unfolding distinct_conv_nth
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length us. \<forall>j<length us. i \<noteq> j \<longrightarrow> us ! i \<noteq> us ! j
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. us ! i \<noteq> us ! j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i \<noteq> us ! j

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from subset_li_is_li[OF indep]
[PROOF STATE]
proof (chain)
picking this:
?B \<subseteq> set us \<Longrightarrow> lin_indpt ?B
[PROOF STEP]
have indepE: "lin_indpt ?E"
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> set us \<Longrightarrow> lin_indpt ?B

goal (1 subgoal):
 1. lin_indpt (set us - {us ! i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have Vid: "set ?V = insert ?v ?E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) = insert (us ! i + c \<cdot>\<^sub>v us ! j) (set us - {us ! i})
[PROOF STEP]
using set_update_distinct[OF dist i(2)]
[PROOF STATE]
proof (prove)
using this:
set (us[i := ?x]) = insert ?x (set us - {us ! i})

goal (1 subgoal):
 1. set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) = insert (us ! i + c \<cdot>\<^sub>v us ! j) (set us - {us ! i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) = insert (us ! i + c \<cdot>\<^sub>v us ! j) (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have E: "?E \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set us - {us ! i} \<subseteq> carrier_vec n
[PROOF STEP]
using us
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set us - {us ! i} \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set us - {us ! i} \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have V: "set ?V \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n
[PROOF STEP]
using us v
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
us ! i + c \<cdot>\<^sub>v us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n
[PROOF STEP]
unfolding Vid
[PROOF STATE]
proof (prove)
using this:
set us \<subseteq> carrier_vec n
us ! i + c \<cdot>\<^sub>v us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. insert (us ! i + c \<cdot>\<^sub>v us ! j) (set us - {us ! i}) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from dist i
[PROOF STATE]
proof (chain)
picking this:
distinct us
j < length us
i < length us
i \<noteq> j
[PROOF STEP]
have diff: "us ! i \<noteq> us ! j"
[PROOF STATE]
proof (prove)
using this:
distinct us
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. us ! i \<noteq> us ! j
[PROOF STEP]
unfolding distinct_conv_nth
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length us. \<forall>j<length us. i \<noteq> j \<longrightarrow> us ! i \<noteq> us ! j
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. us ! i \<noteq> us ! j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i \<noteq> us ! j

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
have vspan: "?v \<notin> span ?E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
assume mem: "?v \<in> span ?E"
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
from diff i
[PROOF STATE]
proof (chain)
picking this:
us ! i \<noteq> us ! j
j < length us
i < length us
i \<noteq> j
[PROOF STEP]
have "us ! j \<in> ?E"
[PROOF STATE]
proof (prove)
using this:
us ! i \<noteq> us ! j
j < length us
i < length us
i \<noteq> j

goal (1 subgoal):
 1. us ! j \<in> set us - {us ! i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! j \<in> set us - {us ! i}

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
hence "us ! j \<in> span ?E"
[PROOF STATE]
proof (prove)
using this:
us ! j \<in> set us - {us ! i}

goal (1 subgoal):
 1. us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
using E
[PROOF STATE]
proof (prove)
using this:
us ! j \<in> set us - {us ! i}
set us - {us ! i} \<subseteq> carrier_vec n

goal (1 subgoal):
 1. us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
by (metis span_mem)
[PROOF STATE]
proof (state)
this:
us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
hence "- c \<cdot>\<^sub>v us ! j \<in> span ?E"
[PROOF STATE]
proof (prove)
using this:
us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
using smult_in_span[OF E]
[PROOF STATE]
proof (prove)
using this:
us ! j \<in> local.span (set us - {us ! i})
?x \<in> local.span (set us - {us ! i}) \<Longrightarrow> ?c \<cdot>\<^sub>v ?x \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
from span_add1[OF E mem this]
[PROOF STATE]
proof (chain)
picking this:
us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
have "?v + (- c \<cdot>\<^sub>v us ! j) \<in> span ?E"
[PROOF STATE]
proof (prove)
using this:
us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
have "?v + (- c \<cdot>\<^sub>v us ! j) = us ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j = us ! i
[PROOF STEP]
using usi usj
[PROOF STATE]
proof (prove)
using this:
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us
us ! j \<in> carrier_vec n

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j = us ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j + - c \<cdot>\<^sub>v us ! j = us ! i

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
us ! i \<in> local.span (set us - {us ! i})
[PROOF STEP]
have mem: "us ! i \<in> span ?E"
[PROOF STATE]
proof (prove)
using this:
us ! i \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i \<in> local.span (set us - {us ! i})
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
us ! i \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
from in_spanE[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>a A. us ! i = lincomb a A \<and> finite A \<and> A \<subseteq> set us - {us ! i}
[PROOF STEP]
obtain a A where lc: "us ! i = lincomb a A" and A: "finite A"
      "A \<subseteq> set us - {us ! i}"
[PROOF STATE]
proof (prove)
using this:
\<exists>a A. us ! i = lincomb a A \<and> finite A \<and> A \<subseteq> set us - {us ! i}

goal (1 subgoal):
 1. (\<And>a A. \<lbrakk>us ! i = lincomb a A; finite A; A \<subseteq> set us - {us ! i}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i = lincomb a A
finite A
A \<subseteq> set us - {us ! i}

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
let ?a = "a (us ! i := -1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
let ?A = "insert (us ! i) A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> set us - {us ! i}
[PROOF STEP]
have fin: "finite ?A"
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> set us - {us ! i}

goal (1 subgoal):
 1. finite (insert (us ! i) A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (insert (us ! i) A)

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
have lc: "lincomb ?a A = us ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (a(us ! i := - (1::'a))) A = us ! i
[PROOF STEP]
unfolding lc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (a(lincomb a A := - (1::'a))) A = lincomb a A
[PROOF STEP]
by (rule lincomb_cong, insert A us lc, auto)
[PROOF STATE]
proof (state)
this:
lincomb (a(us ! i := - (1::'a))) A = us ! i

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
have "lincomb ?a ?A = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (a(us ! i := - (1::'a))) (insert (us ! i) A) = 0\<^sub>v n
[PROOF STEP]
by (subst lincomb_insert2[OF A(1)], insert A us lc usi diff, auto)
[PROOF STATE]
proof (state)
this:
lincomb (a(us ! i := - (1::'a))) (insert (us ! i) A) = 0\<^sub>v n

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i}) \<Longrightarrow> False
[PROOF STEP]
from not_lindepD[OF indep _ _ _ this] A usi
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>finite (insert (us ! i) A); insert (us ! i) A \<subseteq> set us; a(us ! i := - (1::'a)) \<in> insert (us ! i) A \<rightarrow> UNIV\<rbrakk> \<Longrightarrow> a(us ! i := - (1::'a)) \<in> insert (us ! i) A \<rightarrow> {0::'a}
finite A
A \<subseteq> set us - {us ! i}
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (insert (us ! i) A); insert (us ! i) A \<subseteq> set us; a(us ! i := - (1::'a)) \<in> insert (us ! i) A \<rightarrow> UNIV\<rbrakk> \<Longrightarrow> a(us ! i := - (1::'a)) \<in> insert (us ! i) A \<rightarrow> {0::'a}
finite A
A \<subseteq> set us - {us ! i}
us ! i \<in> carrier_vec n
us ! i \<notin> set us - {us ! i}
us ! i \<in> set us

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
hence vmem: "?v \<notin> ?E"
[PROOF STATE]
proof (prove)
using this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<notin> set us - {us ! i}
[PROOF STEP]
using span_mem[OF E, of ?v]
[PROOF STATE]
proof (prove)
using this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})
us ! i + c \<cdot>\<^sub>v us ! j \<in> set us - {us ! i} \<Longrightarrow> us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})

goal (1 subgoal):
 1. us ! i + c \<cdot>\<^sub>v us ! j \<notin> set us - {us ! i}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> set us - {us ! i}

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from lin_dep_iff_in_span[OF E indepE v this] vspan
[PROOF STATE]
proof (chain)
picking this:
(us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})) = lin_dep (set us - {us ! i} \<union> {us ! i + c \<cdot>\<^sub>v us ! j})
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})
[PROOF STEP]
have indep1: "lin_indpt (set ?V)"
[PROOF STATE]
proof (prove)
using this:
(us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})) = lin_dep (set us - {us ! i} \<union> {us ! i + c \<cdot>\<^sub>v us ! j})
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))
[PROOF STEP]
unfolding Vid
[PROOF STATE]
proof (prove)
using this:
(us ! i + c \<cdot>\<^sub>v us ! j \<in> local.span (set us - {us ! i})) = lin_dep (set us - {us ! i} \<union> {us ! i + c \<cdot>\<^sub>v us ! j})
us ! i + c \<cdot>\<^sub>v us ! j \<notin> local.span (set us - {us ! i})

goal (1 subgoal):
 1. lin_indpt (insert (us ! i + c \<cdot>\<^sub>v us ! j) (set us - {us ! i}))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
from vmem dist
[PROOF STATE]
proof (chain)
picking this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> set us - {us ! i}
distinct us
[PROOF STEP]
have "distinct ?V"
[PROOF STATE]
proof (prove)
using this:
us ! i + c \<cdot>\<^sub>v us ! j \<notin> set us - {us ! i}
distinct us

goal (1 subgoal):
 1. distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
by (metis distinct_list_update)
[PROOF STATE]
proof (state)
this:
distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j])

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
with indep1 V
[PROOF STATE]
proof (chain)
picking this:
lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))
set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n
distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))
set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n
distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j])

goal (1 subgoal):
 1. lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])
[PROOF STEP]
unfolding lin_indpt_list_def
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))
set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n
distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j])

goal (1 subgoal):
 1. set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<subseteq> carrier_vec n \<and> distinct (us[i := us ! i + c \<cdot>\<^sub>v us ! j]) \<and> lin_indpt (set (us[i := us ! i + c \<cdot>\<^sub>v us ! j]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt_list (us[i := us ! i + c \<cdot>\<^sub>v us ! j])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_ind_in_set_bound:
  fixes M :: "nat" and v0 :: "nat set"
  assumes "\<And>x. f x = card {y. y \<in> v0 \<and> y < x}"
  shows "bij_betw f ({0..<M} \<inter> v0) {0..<card ({0..<M} \<inter> v0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f ({0..<M} \<inter> v0) {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f ({0..<M} \<inter> v0) \<and> f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
let ?dom = "{0..<M} \<inter> v0"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
let ?ran = "{0..<card ({0..<M} \<inter> v0)}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
fix x1 x2 :: nat
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
assume x1: "x1 \<in> ?dom" and x2: "x2 \<in> ?dom" and "f x1 = f x2"
[PROOF STATE]
proof (state)
this:
x1 \<in> {0..<M} \<inter> v0
x2 \<in> {0..<M} \<inter> v0
f x1 = f x2

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x1 \<in> {0..<M} \<inter> v0
x2 \<in> {0..<M} \<inter> v0
f x1 = f x2
[PROOF STEP]
have "card {y. y \<in> v0 \<and> y < x1} = card {y. y \<in> v0 \<and> y < x2}"
[PROOF STATE]
proof (prove)
using this:
x1 \<in> {0..<M} \<inter> v0
x2 \<in> {0..<M} \<inter> v0
f x1 = f x2

goal (1 subgoal):
 1. card {y \<in> v0. y < x1} = card {y \<in> v0. y < x2}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x1 \<in> {0..<M} \<inter> v0
x2 \<in> {0..<M} \<inter> v0
f x1 = f x2
f ?x = card {y \<in> v0. y < ?x}

goal (1 subgoal):
 1. card {y \<in> v0. y < x1} = card {y \<in> v0. y < x2}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {y \<in> v0. y < x1} = card {y \<in> v0. y < x2}

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {y \<in> v0. y < x1} = card {y \<in> v0. y < x2}
[PROOF STEP]
have "pick v0 (card {y. y \<in> v0 \<and> y < x1}) = pick v0 (card {y. y \<in> v0 \<and> y < x2})"
[PROOF STATE]
proof (prove)
using this:
card {y \<in> v0. y < x1} = card {y \<in> v0. y < x2}

goal (1 subgoal):
 1. pick v0 (card {y \<in> v0. y < x1}) = pick v0 (card {y \<in> v0. y < x2})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pick v0 (card {y \<in> v0. y < x1}) = pick v0 (card {y \<in> v0. y < x2})

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pick v0 (card {y \<in> v0. y < x1}) = pick v0 (card {y \<in> v0. y < x2})

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
have "pick v0 (card {y. y \<in> v0 \<and> y < x1}) = x1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick v0 (card {y \<in> v0. y < x1}) = x1
[PROOF STEP]
using pick_card_in_set x1
[PROOF STATE]
proof (prove)
using this:
?i \<in> ?I \<Longrightarrow> pick ?I (card {a \<in> ?I. a < ?i}) = ?i
x1 \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. pick v0 (card {y \<in> v0. y < x1}) = x1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pick v0 (card {y \<in> v0. y < x1}) = x1

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
pick v0 (card {y \<in> v0. y < x1}) = x1

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
have "pick v0 (card {y. y \<in> v0 \<and> y < x2}) = x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pick v0 (card {y \<in> v0. y < x2}) = x2
[PROOF STEP]
using pick_card_in_set x2
[PROOF STATE]
proof (prove)
using this:
?i \<in> ?I \<Longrightarrow> pick ?I (card {a \<in> ?I. a < ?i}) = ?i
x2 \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. pick v0 (card {y \<in> v0. y < x2}) = x2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pick v0 (card {y \<in> v0. y < x2}) = x2

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
pick v0 (card {y \<in> v0. y < x1}) = pick v0 (card {y \<in> v0. y < x2})
pick v0 (card {y \<in> v0. y < x1}) = x1
pick v0 (card {y \<in> v0. y < x2}) = x2
[PROOF STEP]
have "x1 = x2"
[PROOF STATE]
proof (prove)
using this:
pick v0 (card {y \<in> v0. y < x1}) = pick v0 (card {y \<in> v0. y < x2})
pick v0 (card {y \<in> v0. y < x1}) = x1
pick v0 (card {y \<in> v0. y < x2}) = x2

goal (1 subgoal):
 1. x1 = x2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = x2

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x1.2 \<in> {0..<M} \<inter> v0; ?x2.2 \<in> {0..<M} \<inter> v0; f ?x1.2 = f ?x2.2\<rbrakk> \<Longrightarrow> ?x1.2 = ?x2.2

goal (2 subgoals):
 1. inj_on f ({0..<M} \<inter> v0)
 2. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x1.2 \<in> {0..<M} \<inter> v0; ?x2.2 \<in> {0..<M} \<inter> v0; f ?x1.2 = f ?x2.2\<rbrakk> \<Longrightarrow> ?x1.2 = ?x2.2
[PROOF STEP]
show "inj_on f ?dom"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x1.2 \<in> {0..<M} \<inter> v0; ?x2.2 \<in> {0..<M} \<inter> v0; f ?x1.2 = f ?x2.2\<rbrakk> \<Longrightarrow> ?x1.2 = ?x2.2

goal (1 subgoal):
 1. inj_on f ({0..<M} \<inter> v0)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x1.2 \<in> {0..<M} \<inter> v0; ?x2.2 \<in> {0..<M} \<inter> v0; f ?x1.2 = f ?x2.2\<rbrakk> \<Longrightarrow> ?x1.2 = ?x2.2

goal (1 subgoal):
 1. \<forall>x\<in>{0..<M} \<inter> v0. \<forall>y\<in>{0..<M} \<inter> v0. f x = f y \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on f ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
inj_on f ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
assume x: "x \<in> ?dom"
[PROOF STATE]
proof (state)
this:
x \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0..<M} \<inter> v0
[PROOF STEP]
have "(y \<in> v0 \<and> y < x) = (y \<in> ?dom \<and> y < x)" for y
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. (y \<in> v0 \<and> y < x) = (y \<in> {0..<M} \<inter> v0 \<and> y < x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<M} \<inter> v0
x \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. (y \<in> v0 \<and> y < x) = (y \<in> {0..<M} \<inter> v0 \<and> y < x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(?y \<in> v0 \<and> ?y < x) = (?y \<in> {0..<M} \<inter> v0 \<and> ?y < x)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?y \<in> v0 \<and> ?y < x) = (?y \<in> {0..<M} \<inter> v0 \<and> ?y < x)
[PROOF STEP]
have "card {y. y \<in> v0 \<and> y < x} = card {y. y \<in> ?dom \<and> y < x}"
[PROOF STATE]
proof (prove)
using this:
(?y \<in> v0 \<and> ?y < x) = (?y \<in> {0..<M} \<inter> v0 \<and> ?y < x)

goal (1 subgoal):
 1. card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
have "card {y. y \<in> ?dom \<and> y < x} < card ?dom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)
[PROOF STEP]
using x lt_set_card_lt[of ?dom]
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..<M} \<inter> v0
\<lbrakk>finite ({0..<M} \<inter> v0); ?x \<in> {0..<M} \<inter> v0\<rbrakk> \<Longrightarrow> card {y \<in> {0..<M} \<inter> v0. y < ?x} < card ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}
card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)
[PROOF STEP]
have "f x \<in> ?ran"
[PROOF STATE]
proof (prove)
using this:
card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}
card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f x \<in> {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
card {y \<in> v0. y < x} = card {y \<in> {0..<M} \<inter> v0. y < x}
card {y \<in> {0..<M} \<inter> v0. y < x} < card ({0..<M} \<inter> v0)
f ?x = card {y \<in> v0. y < ?x}

goal (1 subgoal):
 1. f x \<in> {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x \<in> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {0..<M} \<inter> v0 \<Longrightarrow> f ?x2 \<in> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2 \<in> {0..<M} \<inter> v0 \<Longrightarrow> f ?x2 \<in> {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
have sub: "(f ` ?dom) \<subseteq> ?ran"
[PROOF STATE]
proof (prove)
using this:
?x2 \<in> {0..<M} \<inter> v0 \<Longrightarrow> f ?x2 \<in> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) \<subseteq> {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` ({0..<M} \<inter> v0) \<subseteq> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f ` ({0..<M} \<inter> v0) \<subseteq> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
assume y: "y \<in> ?ran"
[PROOF STATE]
proof (state)
this:
y \<in> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
have yle: "y < card ?dom"
[PROOF STATE]
proof (prove)
using this:
y \<in> {0..<card ({0..<M} \<inter> v0)}

goal (1 subgoal):
 1. y < card ({0..<M} \<inter> v0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y < card ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y < card ({0..<M} \<inter> v0)
[PROOF STEP]
have pyindom: "pick ?dom y \<in> ?dom"
[PROOF STATE]
proof (prove)
using this:
y < card ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0
[PROOF STEP]
using pick_in_set_le[of y ?dom]
[PROOF STATE]
proof (prove)
using this:
y < card ({0..<M} \<inter> v0)
y < card ({0..<M} \<inter> v0) \<Longrightarrow> pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0
[PROOF STEP]
have "pick ?dom y < M"
[PROOF STATE]
proof (prove)
using this:
pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0

goal (1 subgoal):
 1. pick ({0..<M} \<inter> v0) y < M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pick ({0..<M} \<inter> v0) y < M

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
pick ({0..<M} \<inter> v0) y < M
[PROOF STEP]
have "\<And>z. (z < pick ?dom y \<Longrightarrow> z \<in> v0 = (z \<in> ?dom))"
[PROOF STATE]
proof (prove)
using this:
pick ({0..<M} \<inter> v0) y < M

goal (1 subgoal):
 1. \<And>z. z < pick ({0..<M} \<inter> v0) y \<Longrightarrow> (z \<in> v0) = (z \<in> {0..<M} \<inter> v0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?z < pick ({0..<M} \<inter> v0) y \<Longrightarrow> (?z \<in> v0) = (?z \<in> {0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?z < pick ({0..<M} \<inter> v0) y \<Longrightarrow> (?z \<in> v0) = (?z \<in> {0..<M} \<inter> v0)
[PROOF STEP]
have "{z. z \<in> v0 \<and> z < pick ?dom y} = {z. z \<in> ?dom \<and> z < pick ?dom y}"
[PROOF STATE]
proof (prove)
using this:
?z < pick ({0..<M} \<inter> v0) y \<Longrightarrow> (?z \<in> v0) = (?z \<in> {0..<M} \<inter> v0)

goal (1 subgoal):
 1. {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}
[PROOF STEP]
have "card {z. z \<in> v0 \<and> z < pick ?dom y} = card {z. z \<in> ?dom \<and> z < pick ?dom y}"
[PROOF STATE]
proof (prove)
using this:
{z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}

goal (1 subgoal):
 1. card {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = card {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = card {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = card {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}
[PROOF STEP]
have "f (pick ?dom y) = y"
[PROOF STATE]
proof (prove)
using this:
card {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = card {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}

goal (1 subgoal):
 1. f (pick ({0..<M} \<inter> v0) y) = y
[PROOF STEP]
using card_pick_le[OF yle] assms
[PROOF STATE]
proof (prove)
using this:
card {z \<in> v0. z < pick ({0..<M} \<inter> v0) y} = card {z \<in> {0..<M} \<inter> v0. z < pick ({0..<M} \<inter> v0) y}
card {a \<in> {0..<M} \<inter> v0. a < pick ({0..<M} \<inter> v0) y} = y
f ?x = card {y \<in> v0. y < ?x}

goal (1 subgoal):
 1. f (pick ({0..<M} \<inter> v0) y) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (pick ({0..<M} \<inter> v0) y) = y

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
with pyindom
[PROOF STATE]
proof (chain)
picking this:
pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0
f (pick ({0..<M} \<inter> v0) y) = y
[PROOF STEP]
have "\<exists>x\<in>?dom. f x = y"
[PROOF STATE]
proof (prove)
using this:
pick ({0..<M} \<inter> v0) y \<in> {0..<M} \<inter> v0
f (pick ({0..<M} \<inter> v0) y) = y

goal (1 subgoal):
 1. \<exists>x\<in>{0..<M} \<inter> v0. f x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{0..<M} \<inter> v0. f x = y

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?y2 \<in> {0..<card ({0..<M} \<inter> v0)} \<Longrightarrow> \<exists>x\<in>{0..<M} \<inter> v0. f x = ?y2

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y2 \<in> {0..<card ({0..<M} \<inter> v0)} \<Longrightarrow> \<exists>x\<in>{0..<M} \<inter> v0. f x = ?y2
[PROOF STEP]
have sup: "?ran \<subseteq> (f ` ?dom)"
[PROOF STATE]
proof (prove)
using this:
?y2 \<in> {0..<card ({0..<M} \<inter> v0)} \<Longrightarrow> \<exists>x\<in>{0..<M} \<inter> v0. f x = ?y2

goal (1 subgoal):
 1. {0..<card ({0..<M} \<inter> v0)} \<subseteq> f ` ({0..<M} \<inter> v0)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{0..<card ({0..<M} \<inter> v0)} \<subseteq> f ` ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
show "(f ` ?dom) = ?ran"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
using sub sup
[PROOF STATE]
proof (prove)
using this:
f ` ({0..<M} \<inter> v0) \<subseteq> {0..<card ({0..<M} \<inter> v0)}
{0..<card ({0..<M} \<inter> v0)} \<subseteq> f ` ({0..<M} \<inter> v0)

goal (1 subgoal):
 1. f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` ({0..<M} \<inter> v0) = {0..<card ({0..<M} \<inter> v0)}

goal:
No subgoals!
[PROOF STEP]
qed