[STATEMENT]
lemma matrix_change_of_basis_works:
  fixes X::"'a::{field}^'n^'n" and Y::"'a^'n^'n"
  assumes basis_X: "is_basis (set_of_vector X)"
  and basis_Y: "is_basis (set_of_vector Y)"
  shows "(matrix_change_of_basis X Y) *v (coord X v) = (coord Y v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_change_of_basis X Y *v coord X v = coord Y v
[PROOF STEP]
proof (unfold matrix_mult_sum matrix_change_of_basis_def column_def coord_def, vector, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
obtain f where f: "(\<Sum>x\<in>UNIV. f x *s Y $ x) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. (\<Sum>x\<in>UNIV. f x *s Y $ x) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_UNIV[OF basis_Y]
[PROOF STATE]
proof (prove)
using this:
UNIV = {x. \<exists>g. (\<Sum>i\<in>UNIV. g i *s Y $ i) = x}

goal (1 subgoal):
 1. (\<And>f. (\<Sum>x\<in>UNIV. f x *s Y $ x) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = v

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
obtain g where g: "(\<Sum>x\<in>UNIV. g x *s X $ x) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. (\<Sum>x\<in>UNIV. g x *s X $ x) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_UNIV[OF basis_X]
[PROOF STATE]
proof (prove)
using this:
UNIV = {x. \<exists>g. (\<Sum>i\<in>UNIV. g i *s X $ i) = x}

goal (1 subgoal):
 1. (\<And>g. (\<Sum>x\<in>UNIV. g x *s X $ x) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. g x *s X $ x) = v

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
define t where "t x = (THE f. X $ x= (\<Sum>a\<in>UNIV. f a *s Y $ a))" for x
[PROOF STATE]
proof (state)
this:
t ?x = (THE f. X $ ?x = (\<Sum>a\<in>UNIV. f a *s Y $ a))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
define w where "w i = (\<Sum>x\<in>UNIV. g x * t x i)" for i
[PROOF STATE]
proof (state)
this:
w ?i = (\<Sum>x\<in>UNIV. g x * t x ?i)

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have the_f:"(THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) = f
[PROOF STEP]
proof (rule the_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)
 2. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
show "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = v

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)

goal (1 subgoal):
 1. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
fix fa
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
assume "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i)"
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i)

goal (1 subgoal):
 1. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
hence "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i)

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i
[PROOF STEP]
unfolding sum_component
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i)

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. (fa x *s Y $ x) $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i

goal (1 subgoal):
 1. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
hence fa: " v = (\<Sum>x\<in>UNIV. fa x *s Y $ x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i

goal (1 subgoal):
 1. v = (\<Sum>x\<in>UNIV. fa x *s Y $ x)
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s Y $ x) $ i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v = (\<Sum>x\<in>UNIV. fa x *s Y $ x)

goal (1 subgoal):
 1. \<And>fa. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * Y $ x $ i) \<Longrightarrow> fa = f
[PROOF STEP]
show "fa = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fa = f
[PROOF STEP]
using basis_combination_unique[OF basis_Y] fa f
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. ?g i *s Y $ i) = (\<Sum>i\<in>UNIV. ?f i *s Y $ i) \<Longrightarrow> ?f = ?g
v = (\<Sum>x\<in>UNIV. fa x *s Y $ x)
(\<Sum>x\<in>UNIV. f x *s Y $ x) = v

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) = f

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have the_g: "(THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) = g
[PROOF STEP]
proof (rule the_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. g x * X $ x $ i)
 2. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
show "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. g x * X $ x $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. g x * X $ x $ i)
[PROOF STEP]
using g
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. g x *s X $ x) = v

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. g x * X $ x $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. g x * X $ x $ i)

goal (1 subgoal):
 1. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
fix fa
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
assume "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * X $ x $ i)"
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * X $ x $ i)

goal (1 subgoal):
 1. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
hence "\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * X $ x $ i)

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i
[PROOF STEP]
unfolding sum_component
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x * X $ x $ i)

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. (fa x *s X $ x) $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i

goal (1 subgoal):
 1. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
hence fa: " v = (\<Sum>x\<in>UNIV. fa x *s X $ x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i

goal (1 subgoal):
 1. v = (\<Sum>x\<in>UNIV. fa x *s X $ x)
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i

goal (1 subgoal):
 1. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. fa x *s X $ x) $ i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
v = (\<Sum>x\<in>UNIV. fa x *s X $ x)

goal (1 subgoal):
 1. \<And>f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i) \<Longrightarrow> f = g
[PROOF STEP]
show "fa = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fa = g
[PROOF STEP]
using basis_combination_unique[OF basis_X] fa g
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. ?g i *s X $ i) = (\<Sum>i\<in>UNIV. ?f i *s X $ i) \<Longrightarrow> ?f = ?g
v = (\<Sum>x\<in>UNIV. fa x *s X $ x)
(\<Sum>x\<in>UNIV. g x *s X $ x) = v

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) = g

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have "(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>x\<in>UNIV. g x *s X $ x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>x\<in>UNIV. g x *s X $ x)
[PROOF STEP]
unfolding f g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = v
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>x\<in>UNIV. g x *s X $ x)

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>x\<in>UNIV. g x *s X $ x)

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have "... = (\<Sum>x\<in>UNIV. g x *s (sum  (\<lambda>i. (t x i) *s Y $ i) UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x *s X $ x) = (\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i))
[PROOF STEP]
unfolding t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x *s X $ x) = (\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i))
[PROOF STEP]
proof (rule sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. UNIV = UNIV
 2. \<And>x. x \<in> UNIV \<Longrightarrow> g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. UNIV = UNIV
 2. \<And>x. x \<in> UNIV \<Longrightarrow> g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)
[PROOF STEP]
obtain h where h: "(\<Sum>a\<in>UNIV. h a *s Y $ a) = X$x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. (\<Sum>a\<in>UNIV. h a *s Y $ a) = X $ x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_UNIV[OF basis_Y]
[PROOF STATE]
proof (prove)
using this:
UNIV = {x. \<exists>g. (\<Sum>i\<in>UNIV. g i *s Y $ i) = x}

goal (1 subgoal):
 1. (\<And>h. (\<Sum>a\<in>UNIV. h a *s Y $ a) = X $ x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>a\<in>UNIV. h a *s Y $ a) = X $ x

goal (2 subgoals):
 1. UNIV = UNIV
 2. \<And>x. x \<in> UNIV \<Longrightarrow> g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)
[PROOF STEP]
have the_h: "(THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a))=h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) = h
[PROOF STEP]
proof (rule the_equality)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. X $ x = (\<Sum>a\<in>UNIV. h a *s Y $ a)
 2. \<And>f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a) \<Longrightarrow> f = h
[PROOF STEP]
show " X $ x = (\<Sum>a\<in>UNIV. h a *s Y $ a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X $ x = (\<Sum>a\<in>UNIV. h a *s Y $ a)
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
(\<Sum>a\<in>UNIV. h a *s Y $ a) = X $ x

goal (1 subgoal):
 1. X $ x = (\<Sum>a\<in>UNIV. h a *s Y $ a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X $ x = (\<Sum>a\<in>UNIV. h a *s Y $ a)

goal (1 subgoal):
 1. \<And>f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a) \<Longrightarrow> f = h
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a) \<Longrightarrow> f = h
[PROOF STEP]
assume f: "X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)"
[PROOF STATE]
proof (state)
this:
X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)

goal (1 subgoal):
 1. \<And>f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a) \<Longrightarrow> f = h
[PROOF STEP]
show "f = h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = h
[PROOF STEP]
using basis_combination_unique[OF basis_Y] f h
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. ?g i *s Y $ i) = (\<Sum>i\<in>UNIV. ?f i *s Y $ i) \<Longrightarrow> ?f = ?g
X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)
(\<Sum>a\<in>UNIV. h a *s Y $ a) = X $ x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) = h

goal (2 subgoals):
 1. UNIV = UNIV
 2. \<And>x. x \<in> UNIV \<Longrightarrow> g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)
[PROOF STEP]
show " g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)
[PROOF STEP]
unfolding the_h h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g x *s X $ x = g x *s X $ x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
g x *s X $ x = g x *s (\<Sum>i\<in>UNIV. (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i *s Y $ i)

goal (1 subgoal):
 1. UNIV = UNIV
[PROOF STEP]
qed rule
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. g x *s X $ x) = (\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. g x *s X $ x) = (\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have "... = (\<Sum>x\<in>UNIV. (sum  (\<lambda>i. g x *s ((t x i) *s Y $ i)) UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i)) = (\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i))
[PROOF STEP]
unfolding vec.scale_sum_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. \<Sum>xa\<in>UNIV. g x *s (t x xa *s Y $ xa)) = (\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i)) = (\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. g x *s (\<Sum>i\<in>UNIV. t x i *s Y $ i)) = (\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have "... = (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i))
[PROOF STEP]
by (rule sum.swap)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. \<Sum>i\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i))

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
have "... =  (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)
[PROOF STEP]
unfolding vec.scale_sum_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. \<Sum>a\<in>UNIV. g a * t a i *s Y $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. \<Sum>x\<in>UNIV. g x *s (t x i *s Y $ i)) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)
[PROOF STEP]
have "(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i) "
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)

goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
hence "f=w"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)

goal (1 subgoal):
 1. f = w
[PROOF STEP]
using basis_combination_unique[OF basis_Y]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)
(\<Sum>i\<in>UNIV. ?g i *s Y $ i) = (\<Sum>i\<in>UNIV. ?f i *s Y $ i) \<Longrightarrow> ?f = ?g

goal (1 subgoal):
 1. f = w
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>UNIV. f x *s Y $ x) = (\<Sum>i\<in>UNIV. (\<Sum>x\<in>UNIV. g x * t x i) *s Y $ i)
(\<Sum>i\<in>UNIV. ?g i *s Y $ i) = (\<Sum>i\<in>UNIV. ?f i *s Y $ i) \<Longrightarrow> ?f = ?g

goal (1 subgoal):
 1. f = (\<lambda>i. \<Sum>x\<in>UNIV. g x * t x i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = w

goal (1 subgoal):
 1. \<And>i. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
thus "(\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) =
    (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i"
[PROOF STATE]
proof (prove)
using this:
f = w

goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i
[PROOF STEP]
unfolding the_f the_g
[PROOF STATE]
proof (prove)
using this:
f = w

goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = f i
[PROOF STEP]
unfolding w_def t_def
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>i. \<Sum>x\<in>UNIV. g x * (THE f. X $ x = (\<Sum>a\<in>UNIV. f a *s Y $ a)) i)

goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = f i
[PROOF STEP]
unfolding vec_eq_iff
[PROOF STATE]
proof (prove)
using this:
f = (\<lambda>i. \<Sum>x\<in>UNIV. g x * (THE f. \<forall>i. X $ x $ i = (\<Sum>a\<in>UNIV. f a *s Y $ a) $ i) i)

goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = f i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>UNIV. (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * X $ x $ i)) x * (THE f. \<forall>i. X $ x $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i) = (THE f. \<forall>i. v $ i = (\<Sum>x\<in>UNIV. f x * Y $ x $ i)) i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_eq_0_iff_dvd: "poly p c = 0 \<longleftrightarrow> [:- c, 1:] dvd p"
  (is "?lhs \<longleftrightarrow> ?rhs")
  for c :: "'a::comm_ring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly p c = (0::'a)) = ([:- c, 1::'a:] dvd p)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly p c = (0::'a) \<Longrightarrow> [:- c, 1::'a:] dvd p
 2. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
poly p c = (0::'a)

goal (2 subgoals):
 1. poly p c = (0::'a) \<Longrightarrow> [:- c, 1::'a:] dvd p
 2. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
with synthetic_div_correct' [of c p]
[PROOF STATE]
proof (chain)
picking this:
[:- c, 1::'a:] * synthetic_div p c + [:poly p c:] = p
poly p c = (0::'a)
[PROOF STEP]
have "p = [:-c, 1:] * synthetic_div p c"
[PROOF STATE]
proof (prove)
using this:
[:- c, 1::'a:] * synthetic_div p c + [:poly p c:] = p
poly p c = (0::'a)

goal (1 subgoal):
 1. p = [:- c, 1::'a:] * synthetic_div p c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = [:- c, 1::'a:] * synthetic_div p c

goal (2 subgoals):
 1. poly p c = (0::'a) \<Longrightarrow> [:- c, 1::'a:] dvd p
 2. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:- c, 1::'a:] * synthetic_div p c
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
p = [:- c, 1::'a:] * synthetic_div p c

goal (1 subgoal):
 1. [:- c, 1::'a:] dvd p
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
[:- c, 1::'a:] dvd p

goal (1 subgoal):
 1. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
[:- c, 1::'a:] dvd p

goal (1 subgoal):
 1. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[:- c, 1::'a:] dvd p
[PROOF STEP]
obtain k where "p = [:-c, 1:] * k"
[PROOF STATE]
proof (prove)
using this:
[:- c, 1::'a:] dvd p

goal (1 subgoal):
 1. (\<And>k. p = [:- c, 1::'a:] * k \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule dvdE)
[PROOF STATE]
proof (state)
this:
p = [:- c, 1::'a:] * k

goal (1 subgoal):
 1. [:- c, 1::'a:] dvd p \<Longrightarrow> poly p c = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = [:- c, 1::'a:] * k
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
p = [:- c, 1::'a:] * k

goal (1 subgoal):
 1. poly p c = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly p c = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma commute_multiples_identity:
  assumes A: "(A::'a::comm_ring_1 mat) \<in> carrier_mat n n"
  shows "A * (k \<cdot>\<^sub>m (1\<^sub>m n)) = (k \<cdot>\<^sub>m (1\<^sub>m n)) * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A
[PROOF STEP]
have "(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1 else 0)))
    = (\<Sum>ia = 0..<n. k * (if i = ia then 1 else 0) * A $$ (ia, j))" (is "?lhs=?rhs")
    if i: "i<n" and j: "j<n" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
let ?f = "\<lambda>ia. A $$ (i, ia) * (k * (if ia = j then 1 else 0))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
let ?g = "\<lambda>ia. k * (if i = ia then 1 else 0) * A $$ (ia, j)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have rw0: "(\<Sum>ia \<in> ({0..<n}-{j}). ?f ia) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (0::'a)
[PROOF STEP]
by (rule sum.neutral, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (0::'a)

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have rw0': "(\<Sum>ia \<in> ({0..<n}-{i}). ?g ia) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j)) = (0::'a)
[PROOF STEP]
by (rule sum.neutral, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j)) = (0::'a)

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have "?lhs = ?f j + (\<Sum>ia \<in> ({0..<n}-{j}). ?f ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a))))
[PROOF STEP]
by (smt atLeast0LessThan finite_atLeastLessThan lessThan_iff sum.remove j)
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a))))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a))))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have "... = A $$ (i, j) * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * k
[PROOF STEP]
using rw0
[PROOF STATE]
proof (prove)
using this:
(\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (0::'a)

goal (1 subgoal):
 1. A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * k

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $$ (i, j) * (k * (if j = j then 1::'a else (0::'a))) + (\<Sum>ia\<in>{0..<n} - {j}. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = A $$ (i, j) * k

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have "... = ?g i + (\<Sum>ia \<in> ({0..<n}-{i}). ?g ia)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, j) * k = k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
using rw0'
[PROOF STATE]
proof (prove)
using this:
(\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j)) = (0::'a)

goal (1 subgoal):
 1. A $$ (i, j) * k = k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (i, j) * k = k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $$ (i, j) * k = k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j)) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
by (smt atLeast0LessThan finite_atLeastLessThan lessThan_iff sum.remove i)
[PROOF STATE]
proof (state)
this:
k * (if i = i then 1::'a else (0::'a)) * A $$ (i, j) + (\<Sum>ia\<in>{0..<n} - {i}. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j)) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))

goal (1 subgoal):
 1. (\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>ia = 0..<n. A $$ (i, ia) * (k * (if ia = j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if i = ia then 1::'a else (0::'a)) * A $$ (ia, j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < n; ?j < n\<rbrakk> \<Longrightarrow> (\<Sum>ia = 0..<n. A $$ (?i, ia) * (k * (if ia = ?j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if ?i = ia then 1::'a else (0::'a)) * A $$ (ia, ?j))

goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < n; ?j < n\<rbrakk> \<Longrightarrow> (\<Sum>ia = 0..<n. A $$ (?i, ia) * (k * (if ia = ?j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if ?i = ia then 1::'a else (0::'a)) * A $$ (ia, ?j))

goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < n; ?j < n\<rbrakk> \<Longrightarrow> (\<Sum>ia = 0..<n. A $$ (?i, ia) * (k * (if ia = ?j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if ?i = ia then 1::'a else (0::'a)) * A $$ (ia, ?j))
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A
[PROOF STEP]
unfolding times_mat_def scalar_prod_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < n; ?j < n\<rbrakk> \<Longrightarrow> (\<Sum>ia = 0..<n. A $$ (?i, ia) * (k * (if ia = ?j then 1::'a else (0::'a)))) = (\<Sum>ia = 0..<n. k * (if ?i = ia then 1::'a else (0::'a)) * A $$ (ia, ?j))
A \<in> carrier_mat n n

goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col (k \<cdot>\<^sub>m 1\<^sub>m n)) (\<lambda>(i, j). \<Sum>ia = 0..<dim_vec (col (k \<cdot>\<^sub>m 1\<^sub>m n) j). Matrix.row A i $v ia * col (k \<cdot>\<^sub>m 1\<^sub>m n) j $v ia) = Matrix.mat (dim_row (k \<cdot>\<^sub>m 1\<^sub>m n)) (dim_col A) (\<lambda>(i, j). \<Sum>ia = 0..<dim_vec (col A j). Matrix.row (k \<cdot>\<^sub>m 1\<^sub>m n) i $v ia * col A j $v ia)
[PROOF STEP]
by auto (rule eq_matI, auto, smt sum.cong)
[PROOF STATE]
proof (state)
this:
A * (k \<cdot>\<^sub>m 1\<^sub>m n) = k \<cdot>\<^sub>m 1\<^sub>m n * A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma successively_remdups_adj_iff:
  "(\<And>x. x \<in> set xs \<Longrightarrow> P x x) \<Longrightarrow>
  successively P (remdups_adj xs) \<longleftrightarrow> successively P xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> P x x) \<Longrightarrow> successively P (remdups_adj xs) = successively P xs
[PROOF STEP]
by (induction xs rule: remdups_adj.induct)(auto simp: successively_Cons)


[STATEMENT]
lemma arith_mod_nzero:
  fixes i :: nat
  assumes "i < n" and "0 < i"
  shows "0 < (n * t + i) mod n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < (n * t + i) mod n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < n
0 < i

goal (1 subgoal):
 1. 0 < (n * t + i) mod n
[PROOF STEP]
by simp


[STATEMENT]
lemma nat_cut_ge_finite_iff: "finite (I \<down>\<ge> (t::nat)) = finite I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (I \<down>\<ge> t) = finite I
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (I \<down>\<ge> t) \<Longrightarrow> finite I
 2. finite I \<Longrightarrow> finite (I \<down>\<ge> t)
[PROOF STEP]
apply (subst cut_less_cut_ge_ident[of t, OF order_refl, symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite (I \<down>\<ge> t) \<Longrightarrow> finite (I \<down>< t \<union> I \<down>\<ge> t)
 2. finite I \<Longrightarrow> finite (I \<down>\<ge> t)
[PROOF STEP]
apply (simp add: nat_cut_less_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> finite (I \<down>\<ge> t)
[PROOF STEP]
apply (simp add: cut_ge_finite)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma float_add:
  "float (a1, e1) + float (a2, e2) =
  (if e1<=e2 then float (a1+a2*2^(nat(e2-e1)), e1) else float (a1*2^(nat (e1-e2))+a2, e2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. float (a1, e1) + float (a2, e2) = (if e1 \<le> e2 then float (a1 + a2 * 2 ^ nat (e2 - e1), e1) else float (a1 * 2 ^ nat (e1 - e2) + a2, e2))
[PROOF STEP]
by (simp add: float_def algebra_simps powr_realpow[symmetric] powr_diff)


[STATEMENT]
lemma depth_append [simp]: "depth (append t1 t2) = depth t1 + depth t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. depth (Binary_Tree.append t1 t2) = depth t1 + depth t2
[PROOF STEP]
apply (induct t1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. depth (Binary_Tree.append Lf t2) = depth Lf + depth t2
 2. \<And>x1 t11 t12. \<lbrakk>depth (Binary_Tree.append t11 t2) = depth t11 + depth t2; depth (Binary_Tree.append t12 t2) = depth t12 + depth t2\<rbrakk> \<Longrightarrow> depth (Binary_Tree.append (Br x1 t11 t12) t2) = depth (Br x1 t11 t12) + depth t2
[PROOF STEP]
apply (metis append.simps(1) depth.simps(1) plus_nat.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 t11 t12. \<lbrakk>depth (Binary_Tree.append t11 t2) = depth t11 + depth t2; depth (Binary_Tree.append t12 t2) = depth t12 + depth t2\<rbrakk> \<Longrightarrow> depth (Binary_Tree.append (Br x1 t11 t12) t2) = depth (Br x1 t11 t12) + depth t2
[PROOF STEP]
by simp


[STATEMENT]
lemma basis_left_null_space_iarrays_eq:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
shows "basis_left_null_space_iarrays (matrix_to_iarray A) = basis_null_space_iarrays (transpose_iarray (matrix_to_iarray A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_left_null_space_iarrays (matrix_to_iarray A) = basis_null_space_iarrays (transpose_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding basis_left_null_space_iarrays_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (let GJ = Gauss_Jordan_iarrays_PA (matrix_to_iarray A); rank_A = length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd GJ))) in set (map (\<lambda>i. row_iarray i (fst GJ)) [rank_A..<nrows_iarray (matrix_to_iarray A)])) = basis_null_space_iarrays (transpose_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding basis_null_space_iarrays_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (transpose_iarray (transpose_iarray (matrix_to_iarray A)))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (transpose_iarray (transpose_iarray (matrix_to_iarray A)))))))..<ncols_iarray (transpose_iarray (matrix_to_iarray A))])
[PROOF STEP]
unfolding matrix_to_iarray_transpose[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose (Finite_Cartesian_Product.transpose A)))))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray (Finite_Cartesian_Product.transpose (Finite_Cartesian_Product.transpose A)))))))..<ncols_iarray (matrix_to_iarray (Finite_Cartesian_Product.transpose A))])
[PROOF STEP]
unfolding transpose_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols_iarray (matrix_to_iarray (Finite_Cartesian_Product.transpose A))])
[PROOF STEP]
unfolding matrix_to_iarray_ncols[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<ncols (Finite_Cartesian_Product.transpose A)])
[PROOF STEP]
unfolding ncols_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows A])
[PROOF STEP]
unfolding matrix_to_iarray_nrows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)]) = set (map (\<lambda>i. row_iarray i (fst (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))) [length (filter (\<lambda>x. \<not> is_zero_iarray x) (IArray.list_of (snd (Gauss_Jordan_iarrays_PA (matrix_to_iarray A)))))..<nrows_iarray (matrix_to_iarray A)])
[PROOF STEP]
..


[STATEMENT]
lemma vector_eq_affinity:
    "(m::'a::field) \<noteq> 0 ==> (y = m *s x + c \<longleftrightarrow> inverse(m) *s y + -(inverse(m) *s c) = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<noteq> (0::'a) \<Longrightarrow> (y = m *s x + c) = (inverse m *s y + - (inverse m *s c) = x)
[PROOF STEP]
using vector_affinity_eq[where m=m and x=x and y=y and c=c]
[PROOF STATE]
proof (prove)
using this:
m \<noteq> (0::'a) \<Longrightarrow> (m *s x + c = y) = (x = inverse m *s y + - (inverse m *s c))

goal (1 subgoal):
 1. m \<noteq> (0::'a) \<Longrightarrow> (y = m *s x + c) = (inverse m *s y + - (inverse m *s c) = x)
[PROOF STEP]
by metis


[STATEMENT]
lemma tensor_butterfly[simp]: "tensor_op (butterfly \<psi> \<psi>') (butterfly \<phi> \<phi>') = butterfly (tensor_ell2 \<psi> \<phi>) (tensor_ell2 \<psi>' \<phi>')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butterfly \<psi> \<psi>' \<otimes>\<^sub>o butterfly \<phi> \<phi>' = butterfly (\<psi> \<otimes>\<^sub>s \<phi>) (\<psi>' \<otimes>\<^sub>s \<phi>')
[PROOF STEP]
apply (rule equal_ket, rename_tac x, case_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x a b. x = (a, b) \<Longrightarrow> (butterfly \<psi> \<psi>' \<otimes>\<^sub>o butterfly \<phi> \<phi>') *\<^sub>V ket x = butterfly (\<psi> \<otimes>\<^sub>s \<phi>) (\<psi>' \<otimes>\<^sub>s \<phi>') *\<^sub>V ket x
[PROOF STEP]
by (simp flip: tensor_ell2_ket add: tensor_op_ell2 butterfly_def
      cblinfun_apply_cblinfun_compose tensor_ell2_scaleC1 tensor_ell2_scaleC2)


[STATEMENT]
lemma Re_interval_times: "Re_interval (A * B) = Re_interval A * Re_interval B - Im_interval A * Im_interval B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re_interval (A * B) = Re_interval A * Re_interval B - Im_interval A * Im_interval B
[PROOF STEP]
by (cases A; cases B, auto)


[STATEMENT]
lemma Re_sgn:
  assumes "is_real R"
  shows "Re (sgn R) = sgn (Re R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (sgn R) = sgn (Re R)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real R

goal (1 subgoal):
 1. Re (sgn R) = sgn (Re R)
[PROOF STEP]
by (metis Re_sgn complex_of_real_Re norm_of_real real_sgn_eq)


[STATEMENT]
lemma add_not_tfin: "0 \<le> a \<Longrightarrow> a \<in> tfin \<Longrightarrow> a \<le> c \<Longrightarrow> c \<in> tfin \<Longrightarrow> 0 \<le> b \<Longrightarrow> b \<notin> tfin \<Longrightarrow> c < a + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) \<le> a; a \<in> tfin; a \<le> c; c \<in> tfin; (0::'a) \<le> b; b \<notin> tfin\<rbrakk> \<Longrightarrow> c < a + b
[PROOF STEP]
by (metis add_0_left local.add_mono_comm timestamp_tfin_le_not_tfin dual_order.order_iff_strict dual_order.strict_trans1)


[STATEMENT]
lemma prod_prime_eq:
  assumes "finite A" "finite B" "\<And>x. x \<in> A \<Longrightarrow> prime (x::nat)" "\<And>x. x \<in> B \<Longrightarrow> prime x" "\<Prod>A = \<Prod>B"
  shows   "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
?x \<in> A \<Longrightarrow> prime ?x
?x \<in> B \<Longrightarrow> prime ?x
\<Prod>A = \<Prod>B

goal (1 subgoal):
 1. A = B
[PROOF STEP]
by (intro equalityI prod_prime_subset) simp_all


[STATEMENT]
lemma powser_uniform_limit:
  fixes a :: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}"
  assumes "r < conv_radius a"
  shows "uniform_limit (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i) (\<lambda>x. suminf (\<lambda>i. a i * (x - \<xi>) ^ i)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniform_limit (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i) (\<lambda>x. \<Sum>i. a i * (x - \<xi>) ^ i) sequentially
[PROOF STEP]
using powser_uniformly_convergent [OF assms]
[PROOF STATE]
proof (prove)
using this:
uniformly_convergent_on (cball ?\<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - ?\<xi>) ^ i)

goal (1 subgoal):
 1. uniform_limit (cball \<xi> r) (\<lambda>n x. \<Sum>i<n. a i * (x - \<xi>) ^ i) (\<lambda>x. \<Sum>i. a i * (x - \<xi>) ^ i) sequentially
[PROOF STEP]
by (simp add: Uniform_Limit.uniformly_convergent_uniform_limit_iff Series.suminf_eq_lim)


[STATEMENT]
lemma times_invertible_eq_zero:
  fixes x :: "real^'n" and A :: "real^'n^'n"
  assumes "invertible A" and "x v* A = 0"
  shows "x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = 0
[PROOF STEP]
using transpose_invertible assms invertible_times_eq_zero
[PROOF STATE]
proof (prove)
using this:
invertible ?A \<Longrightarrow> invertible (Finite_Cartesian_Product.transpose ?A)
invertible A
x v* A = 0
\<lbrakk>invertible ?A; ?A *v ?x = 0\<rbrakk> \<Longrightarrow> ?x = 0

goal (1 subgoal):
 1. x = 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma gcd'_greatest:
  assumes "is_gcd gcd'" and "l dvd a" and "l dvd b"
  shows "l dvd gcd' a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l dvd gcd' a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_gcd gcd'
l dvd a
l dvd b

goal (1 subgoal):
 1. l dvd gcd' a b
[PROOF STEP]
unfolding is_gcd_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. gcd' a b dvd a \<and> gcd' a b dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd gcd' a b)
l dvd a
l dvd b

goal (1 subgoal):
 1. l dvd gcd' a b
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_term_compare_conv: "nat_term_compare to = key_compare (key_order_of_nat_term_order to)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_term_compare to = key_compare (key_order_of_nat_term_order to)
[PROOF STEP]
unfolding key_order_of_nat_term_order_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_term_compare to = key_compare (Abs_key_order (nat_term_compare to))
[PROOF STEP]
by (rule sym, rule Abs_key_order_inverse, simp add: comparator_nat_term_compare)


[STATEMENT]
lemma mat_extension_add:
  assumes "m1 \<in> carrier_mat d1 d1"
    and "m2 \<in> carrier_mat d1 d1"
  shows "mat_extension (m1 + m2) = mat_extension m1 + mat_extension m2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_extension (m1 + m2) = mat_extension m1 + mat_extension m2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m1 \<in> carrier_mat d1 d1
m2 \<in> carrier_mat d1 d1

goal (1 subgoal):
 1. mat_extension (m1 + m2) = mat_extension m1 + mat_extension m2
[PROOF STEP]
by (simp add: mat_extension_def tensor_mat_add1)


[STATEMENT]
lemma path_weight_split[simp]:
    "(path_weight (p1@p2)::'w::monoid_add) = path_weight p1 + path_weight p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_weight (p1 @ p2) = path_weight p1 + path_weight p2
[PROOF STEP]
unfolding path_weight_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (fst \<circ> snd) (p1 @ p2)) = sum_list (map (fst \<circ> snd) p1) + sum_list (map (fst \<circ> snd) p2)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma bigtheta_pow_eq_set_pow: "\<Theta>[F](\<lambda>x. f x ^ n) = bigtheta_pow F (\<Theta>[F](f)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Theta>[F](\<lambda>x. f x ^ n) = bigtheta_pow F \<Theta>[F](f) n
[PROOF STEP]
by (induction n) (simp_all add: bigtheta_mult_eq_set_mult)


[STATEMENT]
lemma lemma_2_9_i:
  "b \<in> supremum A \<Longrightarrow> a * b \<in> supremum ((*) a ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> supremum A \<Longrightarrow> a * b \<in> supremum ((*) a ` A)
[PROOF STEP]
apply (simp add: supremum_def upper_bound_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. x \<le> b) \<and> (\<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x) \<Longrightarrow> (\<forall>x\<in>A. a * x \<le> a * b) \<and> (\<forall>x. (\<forall>xa\<in>A. a * xa \<le> x) \<longrightarrow> a * b \<le> x)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; x \<in> A\<rbrakk> \<Longrightarrow> a * x \<le> a * b
 2. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; \<forall>xa\<in>A. a * xa \<le> x\<rbrakk> \<Longrightarrow> a * b \<le> x
[PROOF STEP]
apply (simp add: mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x\<in>A. x \<le> b; \<forall>x. (\<forall>xa\<in>A. xa \<le> x) \<longrightarrow> b \<le> x; \<forall>xa\<in>A. a * xa \<le> x\<rbrakk> \<Longrightarrow> a * b \<le> x
[PROOF STEP]
by (simp add: right_residual)


[STATEMENT]
lemma inj_map_map_comp[simp]:
  assumes a1: "inj_map f" and a2: "inj_map g"
  shows "inj_map (f \<circ>\<^sub>m g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_map (f \<circ>\<^sub>m g)
[PROOF STEP]
using a1 a2
[PROOF STATE]
proof (prove)
using this:
inj_map f
inj_map g

goal (1 subgoal):
 1. inj_map (f \<circ>\<^sub>m g)
[PROOF STEP]
unfolding inj_map_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. f x = f y \<and> f x \<noteq> None \<longrightarrow> x = y
\<forall>x y. g x = g y \<and> g x \<noteq> None \<longrightarrow> x = y

goal (1 subgoal):
 1. \<forall>x y. (f \<circ>\<^sub>m g) x = (f \<circ>\<^sub>m g) y \<and> (f \<circ>\<^sub>m g) x \<noteq> None \<longrightarrow> x = y
[PROOF STEP]
by (metis (mono_tags, lifting) map_comp_def option.case_eq_if option.expand)


[STATEMENT]
lemma fps_conv_radius_inverse_pos:
  fixes f :: "'a :: {banach, real_normed_field} fps"
  assumes "fps_nth f 0 \<noteq> 0" and "fps_conv_radius f > 0"
  shows   "fps_conv_radius (inverse f) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
let ?c = "fps_nth f 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
have "fps_conv_radius (inverse f) = fps_conv_radius (fps_const ?c * inverse f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_conv_radius (inverse f) = fps_conv_radius (fps_const (fps_nth f 0) * inverse f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fps_nth f 0 \<noteq> (0::'a)
0 < fps_conv_radius f

goal (1 subgoal):
 1. fps_conv_radius (inverse f) = fps_conv_radius (fps_const (fps_nth f 0) * inverse f)
[PROOF STEP]
by (subst fps_conv_radius_cmult_left) auto
[PROOF STATE]
proof (state)
this:
fps_conv_radius (inverse f) = fps_conv_radius (fps_const (fps_nth f 0) * inverse f)

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_conv_radius (inverse f) = fps_conv_radius (fps_const (fps_nth f 0) * inverse f)

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
have "fps_const ?c * inverse f = inverse (fps_const (inverse ?c) * f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_const (fps_nth f 0) * inverse f = inverse (fps_const (inverse (fps_nth f 0)) * f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fps_nth f 0 \<noteq> (0::'a)
0 < fps_conv_radius f

goal (1 subgoal):
 1. fps_const (fps_nth f 0) * inverse f = inverse (fps_const (inverse (fps_nth f 0)) * f)
[PROOF STEP]
by (simp add: fps_inverse_mult fps_const_inverse)
[PROOF STATE]
proof (state)
this:
fps_const (fps_nth f 0) * inverse f = inverse (fps_const (inverse (fps_nth f 0)) * f)

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_const (fps_nth f 0) * inverse f = inverse (fps_const (inverse (fps_nth f 0)) * f)

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
have "fps_conv_radius \<dots> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse (fps_const (inverse (fps_nth f 0)) * f))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
fps_nth f 0 \<noteq> (0::'a)
0 < fps_conv_radius f

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse (fps_const (inverse (fps_nth f 0)) * f))
[PROOF STEP]
by (intro fps_conv_radius_inverse_pos_aux)
       (auto simp: fps_conv_radius_cmult_left)
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius (inverse (fps_const (inverse (fps_nth f 0)) * f))

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < fps_conv_radius (inverse f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius (inverse f)

goal (1 subgoal):
 1. 0 < fps_conv_radius (inverse f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius (inverse f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pochhammer_prod_rev: "pochhammer a n = prod (\<lambda>i. a + of_nat (n - i)) {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer a n = (\<Prod>i = 1..n. a + of_nat (n - i))
[PROOF STEP]
using prod.atLeastLessThan_rev_at_least_Suc_atMost [of "\<lambda>i. a + of_nat i" 0 n]
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<n. a + of_nat i) = (\<Prod>i = Suc 0..n. a + of_nat (n + 0 - i))

goal (1 subgoal):
 1. pochhammer a n = (\<Prod>i = 1..n. a + of_nat (n - i))
[PROOF STEP]
by (simp add: pochhammer_prod)


[STATEMENT]
lemma connected_frontier_simple:
  fixes S :: "'a :: euclidean_space set"
  assumes "connected S" "connected(- S)" shows "connected(frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (frontier S)
[PROOF STEP]
unfolding frontier_closures
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (closure S \<inter> closure (- S))
[PROOF STEP]
by (rule unicoherentD [OF unicoherent_UNIV]; simp add: assms connected_imp_connected_closure flip: closure_Un)


[STATEMENT]
lemma mod_mod_power_cancel:
  fixes m n p:: nat
  assumes "m \<le> n"
  shows "p mod 2^n mod 2^m = p mod 2^m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p mod 2 ^ n mod 2 ^ m = p mod 2 ^ m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. p mod 2 ^ n mod 2 ^ m = p mod 2 ^ m
[PROOF STEP]
by (simp add: dvd_power_le mod_mod_cancel)


[STATEMENT]
lemma listsetI:
  "length ys = length xs \<Longrightarrow> (\<And>i. i < length xs \<Longrightarrow> ys ! i \<in> xs ! i) \<Longrightarrow> ys \<in> listset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length ys = length xs; \<And>i. i < length xs \<Longrightarrow> ys ! i \<in> xs ! i\<rbrakk> \<Longrightarrow> ys \<in> listset xs
[PROOF STEP]
by (induct ys xs rule: list_induct2)
     (simp_all, smt Suc_mono list.sel(3) mem_Collect_eq nth_Cons_0 nth_tl set_Cons_def zero_less_Suc)


[STATEMENT]
lemma system_if_mat_kernel:
assumes sq_Q: "dim_row Q = dim_col Q" and v: "dim_row Q = dim_vec v"
shows "(transpose_mat Q *\<^sub>v v = v) \<longleftrightarrow> v \<in> mat_kernel (transpose_mat (Q - (1\<^sub>m (dim_row Q))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
have "(transpose_mat Q *\<^sub>v v = v) = ((transpose_mat Q - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v))
[PROOF STEP]
using assms system_iff
[PROOF STATE]
proof (prove)
using this:
dim_row Q = dim_col Q
dim_row Q = dim_vec v
\<lbrakk>dim_row ?Q = dim_col ?Q; dim_row ?Q = dim_vec ?v\<rbrakk> \<Longrightarrow> (?Q\<^sup>T *\<^sub>v ?v = ?v) = ((?Q\<^sup>T - 1\<^sub>m (dim_row ?Q)) *\<^sub>v ?v = 0\<^sub>v (dim_vec ?v))

goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(Q\<^sup>T *\<^sub>v v = v) = ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v))

goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(Q\<^sup>T *\<^sub>v v = v) = ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v))

goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
have "... = (v \<in> mat_kernel (transpose_mat (Q - (1\<^sub>m (dim_row Q)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v)) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
unfolding mat_kernel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v)) = (v \<in> {v \<in> carrier_vec (dim_col (Q - 1\<^sub>m (dim_row Q))\<^sup>T). (Q - 1\<^sub>m (dim_row Q))\<^sup>T *\<^sub>v v = 0\<^sub>v (dim_row (Q - 1\<^sub>m (dim_row Q))\<^sup>T)})
[PROOF STEP]
unfolding transpose_minus_1[OF sq_Q]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v)) = (v \<in> {v \<in> carrier_vec (dim_col (Q\<^sup>T - 1\<^sub>m (dim_row Q))). (Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_row (Q\<^sup>T - 1\<^sub>m (dim_row Q)))})
[PROOF STEP]
unfolding v
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Q\<^sup>T - 1\<^sub>m (dim_vec v)) *\<^sub>v v = 0\<^sub>v (dim_vec v)) = (v \<in> {va \<in> carrier_vec (dim_col (Q\<^sup>T - 1\<^sub>m (dim_vec v))). (Q\<^sup>T - 1\<^sub>m (dim_vec v)) *\<^sub>v va = 0\<^sub>v (dim_row (Q\<^sup>T - 1\<^sub>m (dim_vec v)))})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((Q\<^sup>T - 1\<^sub>m (dim_row Q)) *\<^sub>v v = 0\<^sub>v (dim_vec v)) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)

goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)

goal (1 subgoal):
 1. (Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(Q\<^sup>T *\<^sub>v v = v) = (v \<in> mat_kernel (Q - 1\<^sub>m (dim_row Q))\<^sup>T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem eval_fps_deriv:
  assumes "norm z < fps_conv_radius f"
  shows   "eval_fps (fps_deriv f) z = deriv (eval_fps f) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fps (fps_deriv f) z = deriv (eval_fps f) z
[PROOF STEP]
by (intro DERIV_imp_deriv [symmetric] has_field_derivative_eval_fps assms)


[STATEMENT]
lemma fmrel_trans:
  "(\<And>x y z. x \<in> fmran' xm \<Longrightarrow> P x y \<Longrightarrow> Q y z \<Longrightarrow> R x z) \<Longrightarrow>
   fmrel P xm ym \<Longrightarrow> fmrel Q ym zm \<Longrightarrow> fmrel R xm zm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y z. \<lbrakk>x \<in> fmran' xm; P x y; Q y z\<rbrakk> \<Longrightarrow> R x z; fmrel P xm ym; fmrel Q ym zm\<rbrakk> \<Longrightarrow> fmrel R xm zm
[PROOF STEP]
unfolding fmrel_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y z. \<lbrakk>x \<in> fmran' xm; P x y; Q y z\<rbrakk> \<Longrightarrow> R x z; \<forall>x. rel_option P (fmlookup xm x) (fmlookup ym x); \<forall>x. rel_option Q (fmlookup ym x) (fmlookup zm x)\<rbrakk> \<Longrightarrow> \<forall>x. rel_option R (fmlookup xm x) (fmlookup zm x)
[PROOF STEP]
by (metis fmdomE fmdom_notD fmran'I option.rel_inject(2) option.rel_sel)


[STATEMENT]
lemma monic_mult:
  fixes p q :: "'a :: idom poly"
  assumes "monic p" "monic q"
  shows "monic (p * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (p * q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monic (p * q)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
monic p
monic q
[PROOF STEP]
have nz: "p \<noteq> 0" "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
monic p
monic q

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

goal (1 subgoal):
 1. monic (p * q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (p * q)
[PROOF STEP]
unfolding degree_mult_eq[OF nz] coeff_mult_degree_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (1::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
monic p
monic q

goal (1 subgoal):
 1. lead_coeff p * lead_coeff q = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
monic (p * q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_zip_map2: "set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` set xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` set xs
[PROOF STEP]
have "set (zip (map id xs) (map f xs)) = (\<lambda>x. (id x, f x)) ` (set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (zip (map id xs) (map f xs)) = (\<lambda>x. (id x, f x)) ` set xs
[PROOF STEP]
by (rule set_zip_map)
[PROOF STATE]
proof (state)
this:
set (zip (map id xs) (map f xs)) = (\<lambda>x. (id x, f x)) ` set xs

goal (1 subgoal):
 1. set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` set xs
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set (zip (map id xs) (map f xs)) = (\<lambda>x. (id x, f x)) ` set xs

goal (1 subgoal):
 1. set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` set xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (zip xs (map f xs)) = (\<lambda>x. (x, f x)) ` set xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_cone_carrier: "A \<subseteq> carrier_vec n \<Longrightarrow> finite_cone A \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> carrier_vec n \<Longrightarrow> finite_cone A \<subseteq> carrier_vec n
[PROOF STEP]
unfolding finite_cone_def nonneg_lincomb_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> carrier_vec n \<Longrightarrow> {b. \<exists>c. lincomb c (if finite A then A else {}) = b \<and> c ` (if finite A then A else {}) \<subseteq> Collect ((\<le>) (0::'a))} \<subseteq> carrier_vec n
[PROOF STEP]
by auto


[STATEMENT]
lemma divide_powr_uminus: "a / b powr c = a * b powr (- c)"
  for a b c :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a / b powr c = a * b powr - c
[PROOF STEP]
by (simp add: powr_minus_divide)


[STATEMENT]
lemma (in CRR_market_viable) lbk_effect_compute:
shows "(\<Sum> w\<in> range (pseudo_proj_True matur). (prod (prob_component pr w) {0..<matur}) *
      (discounted_value r (\<lambda>m. (lbk_option matur)) matur w)) =
      (\<Sum> y\<in> (gener_bool_list matur). lprob_comp pr y * (det_discount r matur) *
      (Max ((\<lambda>i. (lgeom_proc u d init (take i y)))`{0 .. matur}) - (lgeom_proc u d init y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>w\<in>range (pseudo_proj_True matur). prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w) = (\<Sum>y\<in>gener_bool_list matur. lprob_comp pr y * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i y)) - lgeom_proc u d init y))
[PROOF STEP]
proof (rule pseudo_range_stake)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
have "prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w =
    lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w
[PROOF STEP]
using lprob_comp_stake
[PROOF STATE]
proof (prove)
using this:
prod (prob_component ?pr ?w) {0..<?matur} = lprob_comp ?pr (stake ?matur ?w)

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
have "... = lprob_comp pr (stake matur w) *
    (det_discount r matur) * (Max ((\<lambda>i. (lgeom_proc u d init (take i (stake matur w))))`{0 .. matur}) -
      (lgeom_proc u d init (stake matur w)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
using disc_lbk_option_lgeom
[PROOF STATE]
proof (prove)
using this:
discounted_value r (\<lambda>m. lbk_option ?T) ?T ?w = det_discount r ?T * ((MAX i\<in>{0..?T}. lgeom_proc u d init (take i (stake ?T ?w))) - lgeom_proc u d init (stake ?T ?w))

goal (1 subgoal):
 1. lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lprob_comp pr (stake matur w) * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))

goal (1 subgoal):
 1. \<And>w. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
show "prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w =
    lprob_comp pr (stake matur w) *
    (det_discount r matur) * (Max ((\<lambda>i. (lgeom_proc u d init (take i (stake matur w))))`{0 .. matur}) -
      (lgeom_proc u d init (stake matur w)))"
[PROOF STATE]
proof (prove)
using this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))

goal (1 subgoal):
 1. prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod (prob_component pr w) {0..<matur} * discounted_value r (\<lambda>m. lbk_option matur) matur w = lprob_comp pr (stake matur w) * det_discount r matur * ((MAX i\<in>{0..matur}. lgeom_proc u d init (take i (stake matur w))) - lgeom_proc u d init (stake matur w))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gHom: "\<lbrakk>Group F; Group G; f \<in> gHom F G ; x \<in> carrier F;
           y \<in> carrier F\<rbrakk>  \<Longrightarrow> f (x \<cdot>\<^bsub>F\<^esub> y) = (f x) \<cdot>\<^bsub>G\<^esub> (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; x \<in> carrier F; y \<in> carrier F\<rbrakk> \<Longrightarrow> f (x \<cdot>\<^bsub>F\<^esub> y) = f x \<cdot>\<^bsub>G\<^esub> f y
[PROOF STEP]
apply (simp add: gHom_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integral_component_lbound:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "f integrable_on cbox a b"
    and "\<forall>x\<in>cbox a b. B \<le> f(x)\<bullet>k"
    and "k \<in> Basis"
  shows "B * content (cbox a b) \<le> (integral(cbox a b) f)\<bullet>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * content (cbox a b) \<le> integral (cbox a b) f \<bullet> k
[PROOF STEP]
using assms has_integral_component_lbound
[PROOF STATE]
proof (prove)
using this:
f integrable_on cbox a b
\<forall>x\<in>cbox a b. B \<le> f x \<bullet> k
k \<in> Basis
\<lbrakk>(?f has_integral ?i) (cbox ?a ?b); \<forall>x\<in>cbox ?a ?b. ?B \<le> ?f x \<bullet> ?k; ?k \<in> Basis\<rbrakk> \<Longrightarrow> ?B * content (cbox ?a ?b) \<le> ?i \<bullet> ?k

goal (1 subgoal):
 1. B * content (cbox a b) \<le> integral (cbox a b) f \<bullet> k
[PROOF STEP]
by blast


[STATEMENT]
lemma UNIV_uprod: "UNIV = (\<lambda>x. Upair x x) ` UNIV \<union> (\<lambda>(x, y). Upair x y) ` Sigma UNIV (\<lambda>x. UNIV - {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = range (\<lambda>x. Upair x x) \<union> (\<lambda>(x, y). Upair x y) ` (SIGMA x:UNIV. UNIV - {x})
[PROOF STEP]
apply(rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> UNIV) = (x \<in> range (\<lambda>x. Upair x x) \<union> (\<lambda>(x, y). Upair x y) ` (SIGMA x:UNIV. UNIV - {x}))
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> UNIV) = (x \<in> range (\<lambda>x. Upair x x) \<union> (\<lambda>(x, y). Upair x y) ` (SIGMA x:UNIV. UNIV - {x}))
[PROOF STEP]
by(cases x) auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma weight_enforce_spmf:
  "weight_spmf (enforce_spmf P p) = weight_spmf p - measure (measure_spmf p) {x. \<not> P x}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
have "?lhs = LINT x|measure_spmf p. indicator {x. P x} x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = integral\<^sup>L (measure_spmf p) (indicat_real {x. P x})
[PROOF STEP]
by(auto simp add: enforce_spmf_alt_def weight_bind_spmf o_def simp del: Bochner_Integration.integral_indicator intro!: Bochner_Integration.integral_cong split: split_indicator)
[PROOF STATE]
proof (state)
this:
weight_spmf (enforce_spmf P p) = integral\<^sup>L (measure_spmf p) (indicat_real {x. P x})

goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
weight_spmf (enforce_spmf P p) = integral\<^sup>L (measure_spmf p) (indicat_real {x. P x})

goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
have "\<dots> = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (measure_spmf p) (indicat_real {x. P x}) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
by(subst measure_spmf.finite_measure_Diff[symmetric])(auto simp add: space_measure_spmf intro!: arg_cong2[where f=measure])
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (measure_spmf p) (indicat_real {x. P x}) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}

goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}

goal (1 subgoal):
 1. weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
weight_spmf (enforce_spmf P p) = weight_spmf p - Sigma_Algebra.measure (measure_spmf p) {x. \<not> P x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invertible_take_cols_rank:
  fixes A::"'a mat"
  assumes "invertible_mat A"
  assumes "A \<in> carrier_mat n n"
  assumes "distinct inds"
  shows "rank (take_cols A inds) = length (filter ((>) n) inds)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
have " A = A * 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A * 1\<^sub>m n
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A = A * 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = A * 1\<^sub>m n

goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = A * 1\<^sub>m n
[PROOF STEP]
have "take_cols A inds = A * take_cols (1\<^sub>m n) inds"
[PROOF STATE]
proof (prove)
using this:
A = A * 1\<^sub>m n

goal (1 subgoal):
 1. take_cols A inds = A * take_cols (1\<^sub>m n) inds
[PROOF STEP]
by (metis assms(2) one_carrier_mat take_cols_mat_mul)
[PROOF STATE]
proof (state)
this:
take_cols A inds = A * take_cols (1\<^sub>m n) inds

goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_cols A inds = A * take_cols (1\<^sub>m n) inds
[PROOF STEP]
have "rank (take_cols A inds) = rank (take_cols (1\<^sub>m n) inds)"
[PROOF STATE]
proof (prove)
using this:
take_cols A inds = A * take_cols (1\<^sub>m n) inds

goal (1 subgoal):
 1. rank (take_cols A inds) = rank (take_cols (1\<^sub>m n) inds)
[PROOF STEP]
by (metis assms(1) assms(2) conjugatable_vec_space.rank_mul_left_invertible_mat one_carrier_mat take_cols_carrier_mat)
[PROOF STATE]
proof (state)
this:
rank (take_cols A inds) = rank (take_cols (1\<^sub>m n) inds)

goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
rank (take_cols A inds) = rank (take_cols (1\<^sub>m n) inds)

goal (1 subgoal):
 1. rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)
[PROOF STEP]
by (simp add: assms(3) conjugatable_vec_space.rank_take_cols)
[PROOF STATE]
proof (state)
this:
rank (take_cols A inds) = length (filter (\<lambda>y. y < n) inds)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inter_scene_space_foldrs:
  assumes "set xs \<subseteq> set Vars" "set ys \<subseteq> set Vars"
  shows "\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda> x. x \<in> set xs \<inter> set ys) Vars)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = - (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = - (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys)
[PROOF STEP]
by (simp add: inf_scene_def)
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = - (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = - (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "... = - (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys) = - (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars))
[PROOF STEP]
by (simp add: uminus_vars_other_vars assms)
[PROOF STATE]
proof (state)
this:
- (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys) = - (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars))

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (- \<Squnion>\<^sub>S xs \<squnion>\<^sub>S - \<Squnion>\<^sub>S ys) = - (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars))

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "... = - \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars)) = - \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)
[PROOF STEP]
by (simp add: union_scene_space_foldrs assms)
[PROOF STATE]
proof (state)
this:
- (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars)) = - \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- (\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars) \<squnion>\<^sub>S \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set ys) Vars)) = - \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "... =  \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars)
[PROOF STEP]
by (subst uminus_vars_other_vars, simp_all)
[PROOF STATE]
proof (state)
this:
- \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "... = \<Squnion>\<^sub>S (filter (\<lambda> x. x \<in> set xs \<inter> set ys) Vars)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
have "\<And>x. x \<in> set Vars \<Longrightarrow> ((x \<in> set Vars \<longrightarrow> x \<in> set xs) \<and> (x \<in> set Vars \<longrightarrow> x \<in> set ys)) = (x \<in> set xs \<and> x \<in> set ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> set Vars \<Longrightarrow> ((x \<in> set Vars \<longrightarrow> x \<in> set xs) \<and> (x \<in> set Vars \<longrightarrow> x \<in> set ys)) = (x \<in> set xs \<and> x \<in> set ys)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> set Vars \<Longrightarrow> ((?x \<in> set Vars \<longrightarrow> ?x \<in> set xs) \<and> (?x \<in> set Vars \<longrightarrow> ?x \<in> set ys)) = (?x \<in> set xs \<and> ?x \<in> set ys)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> set Vars \<Longrightarrow> ((?x \<in> set Vars \<longrightarrow> ?x \<in> set xs) \<and> (?x \<in> set Vars \<longrightarrow> ?x \<in> set ys)) = (?x \<in> set xs \<and> ?x \<in> set ys)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
by (simp cong: arg_cong[where f="\<Squnion>\<^sub>S"] filter_cong add: assms)
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S (filter (\<lambda>x. x \<notin> set (filter (\<lambda>x. x \<notin> set xs) Vars @ filter (\<lambda>x. x \<notin> set ys) Vars)) Vars) = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)

goal (1 subgoal):
 1. \<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S xs \<sqinter>\<^sub>S \<Squnion>\<^sub>S ys = \<Squnion>\<^sub>S (filter (\<lambda>x. x \<in> set xs \<inter> set ys) Vars)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_zero_iff_pprt_id: "0 \<le> a \<longleftrightarrow> pprt a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) \<le> a) = (pprt a = a)
[PROOF STEP]
unfolding le_iff_sup
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sup (0::'a) a = a) = (pprt a = a)
[PROOF STEP]
by (simp add: pprt_def sup_commute)


[STATEMENT]
lemma absolutely_integrable_mult_Dirichlet_kernel_reflected_part:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x" and "d \<le> pi"
  shows "(\<lambda>x. Dirichlet_kernel n x * f(t+x)) absolutely_integrable_on {0..d}"
        "(\<lambda>x. Dirichlet_kernel n x * f(t-x)) absolutely_integrable_on {0..d}"
        "(\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {0..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {0..d} &&& (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {0..d} &&& (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {0..d}
[PROOF STEP]
using absolutely_integrable_mult_Dirichlet_kernel_reflected [OF f periodic, of n] \<open>d \<le> pi\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. Dirichlet_kernel n x * f (?t + x)) absolutely_integrable_on {- pi..pi}
(\<lambda>x. Dirichlet_kernel n x * f (?t - x)) absolutely_integrable_on {- pi..pi}
(\<lambda>x. Dirichlet_kernel n x * ?c) absolutely_integrable_on {- pi..pi}
d \<le> pi

goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {0..d} &&& (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {0..d} &&& (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {0..d}
[PROOF STEP]
by (force intro: absolutely_integrable_on_subinterval)+


[STATEMENT]
lemma (in domain) subring_polynomial_pow_division:
  assumes "subring K R" and "p \<in> carrier (K[X])" and "(n::nat) \<le> m"
  shows "(p [^]\<^bsub>K[X]\<^esub> n) divides\<^bsub>K[X]\<^esub> (p [^]\<^bsub>K[X]\<^esub> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p [^]\<^bsub>K [X]\<^esub> n divides\<^bsub>K [X]\<^esub> p [^]\<^bsub>K [X]\<^esub> m
[PROOF STEP]
using domain.polynomial_pow_division[OF subring_is_domain, of K p n m] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subring K R; p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>)); n \<le> m\<rbrakk> \<Longrightarrow> p [^]\<^bsub>poly_ring (R\<lparr>carrier := K\<rparr>)\<^esub> n pdivides\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub> p [^]\<^bsub>poly_ring (R\<lparr>carrier := K\<rparr>)\<^esub> m
subring K R
p \<in> carrier (K [X])
n \<le> m

goal (1 subgoal):
 1. p [^]\<^bsub>K [X]\<^esub> n divides\<^bsub>K [X]\<^esub> p [^]\<^bsub>K [X]\<^esub> m
[PROOF STEP]
unfolding univ_poly_consistent[OF assms(1)] pdivides_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subring K R; p \<in> carrier (carrier (R\<lparr>carrier := K\<rparr>) [X]); n \<le> m\<rbrakk> \<Longrightarrow> p [^]\<^bsub>carrier (R\<lparr>carrier := K\<rparr>) [X]\<^esub> n divides\<^bsub>carrier (R\<lparr>carrier := K\<rparr>) [X]\<^esub> p [^]\<^bsub>carrier (R\<lparr>carrier := K\<rparr>) [X]\<^esub> m
subring K R
p \<in> carrier (K [X])
n \<le> m

goal (1 subgoal):
 1. p [^]\<^bsub>K [X]\<^esub> n divides\<^bsub>K [X]\<^esub> p [^]\<^bsub>K [X]\<^esub> m
[PROOF STEP]
by simp


[STATEMENT]
lemma DERIV_tan [simp]: "cos x \<noteq> 0 \<Longrightarrow> DERIV tan x :> inverse ((cos x)\<^sup>2)"
  for x :: "'a::{real_normed_field,banach}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x \<noteq> (0::'a) \<Longrightarrow> (tan has_field_derivative inverse ((cos x)\<^sup>2)) (at x)
[PROOF STEP]
unfolding tan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos x \<noteq> (0::'a) \<Longrightarrow> ((\<lambda>x. sin x / cos x) has_field_derivative inverse ((cos x)\<^sup>2)) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros, simp add: divide_inverse power2_eq_square)


[STATEMENT]
lemma b_non_zero_imp_v_non_zero: "\<b> > 0 \<Longrightarrow> \<v> > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<b> \<Longrightarrow> 0 < \<v>
[PROOF STEP]
using block_set_nempty_imp_points finite_sets
[PROOF STATE]
proof (prove)
using this:
\<B> \<noteq> {#} \<Longrightarrow> \<V> \<noteq> {}
finite \<V>

goal (1 subgoal):
 1. 0 < \<b> \<Longrightarrow> 0 < \<v>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma proper_iff:
  "proper f \<longleftrightarrow> ((\<forall>x. f x \<noteq> -\<infinity>) \<and> (\<exists>x. f x \<noteq> \<infinity>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proper f = ((\<forall>x. f x \<noteq> - \<infinity>) \<and> (\<exists>x. f x \<noteq> \<infinity>))
[PROOF STEP]
unfolding proper_def proper_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>x\<in>UNIV. f x \<noteq> - \<infinity>) \<and> (\<exists>x\<in>UNIV. f x \<noteq> \<infinity>)) = ((\<forall>x. f x \<noteq> - \<infinity>) \<and> (\<exists>x. f x \<noteq> \<infinity>))
[PROOF STEP]
by auto


[STATEMENT]
lemma monomial_rel_order_map:
  \<open>(x, a, b) \<in> monomial_rel \<Longrightarrow>
       (y, aa, bb) \<in> monomial_rel \<Longrightarrow>
       fst x \<le> fst y \<longleftrightarrow> a \<le> aa\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, a, b) \<in> monomial_rel; (y, aa, bb) \<in> monomial_rel\<rbrakk> \<Longrightarrow> (fst x \<le> fst y) = (a \<le> aa)
[PROOF STEP]
apply (cases x; cases y)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ab ba aaa baa. \<lbrakk>(x, a, b) \<in> monomial_rel; (y, aa, bb) \<in> monomial_rel; x = (ab, ba); y = (aaa, baa)\<rbrakk> \<Longrightarrow> (fst x \<le> fst y) = (a \<le> aa)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ab aaa. \<lbrakk>(ab, a) \<in> monom_rel; (aaa, aa) \<in> monom_rel; x = (ab, b); y = (aaa, bb); ab \<le> aaa\<rbrakk> \<Longrightarrow> a \<le> aa
 2. \<And>ab aaa. \<lbrakk>(ab, a) \<in> monom_rel; (aaa, aa) \<in> monom_rel; x = (ab, b); y = (aaa, bb); a \<le> aa\<rbrakk> \<Longrightarrow> ab \<le> aaa
[PROOF STEP]
using list_rel_list_rel_order_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?a, ?b) \<in> monom_rel; (?a', ?b') \<in> monom_rel\<rbrakk> \<Longrightarrow> (?a < ?a') = (?b < ?b')

goal (2 subgoals):
 1. \<And>ab aaa. \<lbrakk>(ab, a) \<in> monom_rel; (aaa, aa) \<in> monom_rel; x = (ab, b); y = (aaa, bb); ab \<le> aaa\<rbrakk> \<Longrightarrow> a \<le> aa
 2. \<And>ab aaa. \<lbrakk>(ab, a) \<in> monom_rel; (aaa, aa) \<in> monom_rel; x = (ab, b); y = (aaa, bb); a \<le> aa\<rbrakk> \<Longrightarrow> ab \<le> aaa
[PROOF STEP]
by fastforce+


[STATEMENT]
lemma irreducible_smult [simp]:
  fixes c :: "'a :: field"
  shows "irreducible (smult c p) \<longleftrightarrow> irreducible p \<and> c \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreducible (smult c p) = (irreducible p \<and> c \<noteq> (0::'a))
[PROOF STEP]
using irreducible_mult_unit_left[of "[:c:]", simplified]
[PROOF STATE]
proof (prove)
using this:
True

goal (1 subgoal):
 1. irreducible (smult c p) = (irreducible p \<and> c \<noteq> (0::'a))
[PROOF STEP]
by force