[STATEMENT]
lemma independent_preimage_matrix_vector_mult:
fixes P::"'a::{field}^'n^'n"
assumes ind_B: "vec.independent (((*v) P)` B)" and inv_P: "invertible P"
shows "vec.independent B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
have "vec.independent (((*v) (matrix_inv P))` (((*v) P)` B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent ((*v) (matrix_inv P) ` (*v) P ` B)
[PROOF STEP]
proof (rule independent_image_matrix_vector_mult)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vec.independent ((*v) P ` B)
 2. invertible (matrix_inv P)
[PROOF STEP]
show "vec.independent ((*v) P ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent ((*v) P ` B)
[PROOF STEP]
using ind_B
[PROOF STATE]
proof (prove)
using this:
vec.independent ((*v) P ` B)

goal (1 subgoal):
 1. vec.independent ((*v) P ` B)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
vec.independent ((*v) P ` B)

goal (1 subgoal):
 1. invertible (matrix_inv P)
[PROOF STEP]
show "invertible (matrix_inv P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (matrix_inv P)
[PROOF STEP]
by (metis matrix_inv_left matrix_inv_right inv_P invertible_def)
[PROOF STATE]
proof (state)
this:
invertible (matrix_inv P)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
vec.independent ((*v) (matrix_inv P) ` (*v) P ` B)

goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec.independent ((*v) (matrix_inv P) ` (*v) P ` B)

goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
have "((*v) (matrix_inv P))` (((*v) P)` B) = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*v) (matrix_inv P) ` (*v) P ` B = B
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xb. xb \<in> B \<Longrightarrow> matrix_inv P *v (P *v xb) \<in> B
 2. \<And>x. x \<in> B \<Longrightarrow> x \<in> (*v) (matrix_inv P) ` (*v) P ` B
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xb. xb \<in> B \<Longrightarrow> matrix_inv P *v (P *v xb) \<in> B
 2. \<And>x. x \<in> B \<Longrightarrow> x \<in> (*v) (matrix_inv P) ` (*v) P ` B
[PROOF STEP]
assume x: "x \<in> B"
[PROOF STATE]
proof (state)
this:
x \<in> B

goal (2 subgoals):
 1. \<And>xb. xb \<in> B \<Longrightarrow> matrix_inv P *v (P *v xb) \<in> B
 2. \<And>x. x \<in> B \<Longrightarrow> x \<in> (*v) (matrix_inv P) ` (*v) P ` B
[PROOF STEP]
show "matrix_inv P *v (P *v x) \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_inv P *v (P *v x) \<in> B
[PROOF STEP]
by (metis (full_types) x inv_P matrix_inv_left matrix_vector_mul_assoc matrix_vector_mul_lid)
[PROOF STATE]
proof (state)
this:
matrix_inv P *v (P *v x) \<in> B

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> x \<in> (*v) (matrix_inv P) ` (*v) P ` B
[PROOF STEP]
thus "x \<in> (*v) (matrix_inv P) ` (*v) P ` B"
[PROOF STATE]
proof (prove)
using this:
matrix_inv P *v (P *v x) \<in> B

goal (1 subgoal):
 1. x \<in> (*v) (matrix_inv P) ` (*v) P ` B
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
using this:
matrix_inv P *v (P *v x) \<in> B

goal (1 subgoal):
 1. x \<in> {y. \<exists>x\<in>{y. \<exists>x\<in>B. y = P *v x}. y = matrix_inv P *v x}
[PROOF STEP]
by (auto, metis  inv_P matrix_inv_left matrix_vector_mul_assoc matrix_vector_mul_lid)
[PROOF STATE]
proof (state)
this:
x \<in> (*v) (matrix_inv P) ` (*v) P ` B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(*v) (matrix_inv P) ` (*v) P ` B = B

goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vec.independent ((*v) (matrix_inv P) ` (*v) P ` B)
(*v) (matrix_inv P) ` (*v) P ` B = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec.independent ((*v) (matrix_inv P) ` (*v) P ` B)
(*v) (matrix_inv P) ` (*v) P ` B = B

goal (1 subgoal):
 1. vec.independent B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.independent B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIMSEQ_le_const2: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. X n \<le> a \<Longrightarrow> x \<le> a"
  for a x :: "'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow> x; \<exists>N. \<forall>n\<ge>N. X n \<le> a\<rbrakk> \<Longrightarrow> x \<le> a
[PROOF STEP]
by (rule LIMSEQ_le[of X x "\<lambda>n. a"]) auto


[STATEMENT]
lemma cart_flip: "(\<lambda>p. f (snd p) (fst p)) ` (B \<times> A) = (\<lambda>p. f (fst p) (snd p)) ` (A \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. f (snd p) (fst p)) ` (B \<times> A) = (\<lambda>p. f (fst p) (snd p)) ` (A \<times> B)
[PROOF STEP]
by (metis cart_flip_aux fset_to_im)


[STATEMENT]
lemma naturally_isomorphic_symmetric:
  assumes "naturally_isomorphic A B F G"
  shows "naturally_isomorphic A B G F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
obtain \<phi> where \<phi>: "natural_isomorphism A B F G \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<phi>. natural_isomorphism A B F G \<phi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms naturally_isomorphic_def
[PROOF STATE]
proof (prove)
using this:
naturally_isomorphic A B F G
naturally_isomorphic ?A ?B ?F ?G = (\<exists>\<tau>. natural_isomorphism ?A ?B ?F ?G \<tau>)

goal (1 subgoal):
 1. (\<And>\<phi>. natural_isomorphism A B F G \<phi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
natural_isomorphism A B F G \<phi>

goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
interpret \<phi>: natural_isomorphism A B F G \<phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natural_isomorphism A B F G \<phi>
[PROOF STEP]
using \<phi>
[PROOF STATE]
proof (prove)
using this:
natural_isomorphism A B F G \<phi>

goal (1 subgoal):
 1. natural_isomorphism A B F G \<phi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
interpret \<psi>: inverse_transformation A B F G \<phi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_transformation A B F G \<phi>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
have "natural_isomorphism A B G F \<psi>.map"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. natural_isomorphism A B G F \<psi>.map
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
natural_isomorphism A B G F \<psi>.map

goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
natural_isomorphism A B G F \<psi>.map

goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
using naturally_isomorphic_def
[PROOF STATE]
proof (prove)
using this:
natural_isomorphism A B G F \<psi>.map
naturally_isomorphic ?A ?B ?F ?G = (\<exists>\<tau>. natural_isomorphism ?A ?B ?F ?G \<tau>)

goal (1 subgoal):
 1. naturally_isomorphic A B G F
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
naturally_isomorphic A B G F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pps_to_list_nth_leI:
  assumes "j \<le> i" and "i < card S"
  shows "(pps_to_list S) ! i \<preceq>\<^sub>t (pps_to_list S) ! j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
proof (cases "j = i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j = i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
 2. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
j = i

goal (2 subgoals):
 1. j = i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
 2. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
by (simp add: True)
[PROOF STATE]
proof (state)
this:
pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j

goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
j \<noteq> i

goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
j \<le> i
j \<noteq> i
[PROOF STEP]
have "j < i"
[PROOF STATE]
proof (prove)
using this:
j \<le> i
j \<noteq> i

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

goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
let ?ts = "pps_to_list S"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
from pps_to_list_sorted_wrt \<open>j < i\<close>
[PROOF STATE]
proof (chain)
picking this:
sorted_wrt (\<succ>\<^sub>t) (pps_to_list ?S)
j < i
[PROOF STEP]
have "(\<prec>\<^sub>t)\<inverse>\<inverse> (?ts ! j) (?ts ! i)"
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (\<succ>\<^sub>t) (pps_to_list ?S)
j < i

goal (1 subgoal):
 1. pps_to_list S ! j \<succ>\<^sub>t pps_to_list S ! i
[PROOF STEP]
proof (rule sorted_wrt_nth_less)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i < length (pps_to_list S)
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
i < card S
[PROOF STEP]
show "i < length ?ts"
[PROOF STATE]
proof (prove)
using this:
i < card S

goal (1 subgoal):
 1. i < length (pps_to_list S)
[PROOF STEP]
by (simp only: length_pps_to_list)
[PROOF STATE]
proof (state)
this:
i < length (pps_to_list S)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
pps_to_list S ! j \<succ>\<^sub>t pps_to_list S ! i

goal (1 subgoal):
 1. j \<noteq> i \<Longrightarrow> pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
pps_to_list S ! j \<succ>\<^sub>t pps_to_list S ! i

goal (1 subgoal):
 1. pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pps_to_list S ! i \<preceq>\<^sub>t pps_to_list S ! j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gcd_mult_right_left_cancel:
  "gcd a (c * b) = gcd a b" if "coprime a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a (c * b) = gcd a b
[PROOF STEP]
using that gcd_mult_left_left_cancel [of a c b]
[PROOF STATE]
proof (prove)
using this:
coprime a c
coprime a c \<Longrightarrow> gcd (c * b) a = gcd b a

goal (1 subgoal):
 1. gcd a (c * b) = gcd a b
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma prop_nth_sdrop:
  assumes "\<forall> i\<ge>j. P (\<omega> !! i)"
  shows "\<forall> i. P (sdrop j \<omega> !! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. P (sdrop j \<omega> !! i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<ge>j. P (\<omega> !! i)

goal (1 subgoal):
 1. \<forall>i. P (sdrop j \<omega> !! i)
[PROOF STEP]
by (induction j arbitrary: \<omega>) fastforce+


[STATEMENT]
lemma Under_Above_Galois:
"\<lbrakk>B \<le> Field r; C \<le> Field r\<rbrakk> \<Longrightarrow> (B \<le> Above r C) = (C \<le> Under r B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> Field r; C \<subseteq> Field r\<rbrakk> \<Longrightarrow> (B \<subseteq> Above r C) = (C \<subseteq> Under r B)
[PROOF STEP]
by(unfold Above_def Under_def, blast)


[STATEMENT]
lemma sup_dense:
  assumes "dense_rel x"
      and "dense_rel y"
    shows "dense_rel (x \<squnion> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
have "x \<le> x * x \<and> y \<le> y * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dense_rel x \<and> dense_rel y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dense_rel x
dense_rel y

goal (1 subgoal):
 1. dense_rel x \<and> dense_rel y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dense_rel x \<and> dense_rel y

goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
hence "x \<le> (x \<squnion> y) * (x \<squnion> y) \<and> y \<le> (x \<squnion> y) * (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
dense_rel x \<and> dense_rel y

goal (1 subgoal):
 1. x \<le> (x \<squnion> y) * (x \<squnion> y) \<and> y \<le> (x \<squnion> y) * (x \<squnion> y)
[PROOF STEP]
by (meson dense_sup_closed order_trans sup.cobounded1 sup.cobounded2)
[PROOF STATE]
proof (state)
this:
x \<le> (x \<squnion> y) * (x \<squnion> y) \<and> y \<le> (x \<squnion> y) * (x \<squnion> y)

goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
hence "x \<squnion> y \<le> (x \<squnion> y) * (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
x \<le> (x \<squnion> y) * (x \<squnion> y) \<and> y \<le> (x \<squnion> y) * (x \<squnion> y)

goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dense_rel (x \<squnion> y)

goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
thus "dense_rel (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
dense_rel (x \<squnion> y)

goal (1 subgoal):
 1. dense_rel (x \<squnion> y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dense_rel (x \<squnion> y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma comparator_nat_term_compare_inv: "comparator (nat_term_compare_inv to)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (nat_term_compare_inv to)
[PROOF STEP]
unfolding nat_term_compare_inv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (\<lambda>x y. nat_term_compare to y x)
[PROOF STEP]
using comparator_nat_term_compare
[PROOF STATE]
proof (prove)
using this:
comparator (nat_term_compare ?to)

goal (1 subgoal):
 1. comparator (\<lambda>x y. nat_term_compare to y x)
[PROOF STEP]
by (rule comparator_converse)


[STATEMENT]
lemma less_eq_bfunI[intro]: "(\<And>x. apply_bfun f x \<le> apply_bfun g x) \<Longrightarrow> f \<le> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. apply_bfun f x \<le> apply_bfun g x) \<Longrightarrow> f \<le> g
[PROOF STEP]
unfolding less_eq_bfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. apply_bfun f x \<le> apply_bfun g x) \<Longrightarrow> \<forall>x. apply_bfun f x \<le> apply_bfun g x
[PROOF STEP]
by auto


[STATEMENT]
lemma unitary_mat_mat [intro]:
  assumes "unitary M"
  shows "inverts_mat (M\<^sup>\<dagger>) M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat M\<^sup>\<dagger> M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary M

goal (1 subgoal):
 1. inverts_mat M\<^sup>\<dagger> M
[PROOF STEP]
by (simp add: unitary_def inverts_mat_def)


[STATEMENT]
lemma quotient_of_eq: "quotient_of (Fract a b) = (p, q) \<Longrightarrow> Fract p q = Fract a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_of (Fract a b) = (p, q) \<Longrightarrow> Fract p q = Fract a b
[PROOF STEP]
by (simp add: quotient_of_Fract normalize_eq)


[STATEMENT]
lemma llexord_LCons_LCons [simp]:
  "llexord r (LCons x xs) (LCons y ys) \<longleftrightarrow> (x = y \<and> llexord r xs ys \<or> r x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llexord r (LCons x xs) (LCons y ys) = (x = y \<and> llexord r xs ys \<or> r x y)
[PROOF STEP]
by(auto intro: llexord.intros(1,2) elim: llexord.cases)


[STATEMENT]
lemma foldl_assoc:
  assumes "\<And>x y z. f (f x y) z = f x (f y z)"
  shows "foldl f (f a b) xs = f a (foldl f b xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl f (f a b) xs = f a (foldl f b xs)
[PROOF STEP]
proof (induct xs arbitrary: a b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. foldl f (f a b) [] = f a (foldl f b [])
 2. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
fix a b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. foldl f (f a b) [] = f a (foldl f b [])
 2. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
show "foldl f (f a b) [] = f a (foldl f b [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl f (f a b) [] = f a (foldl f b [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl f (f a b) [] = f a (foldl f b [])

goal (1 subgoal):
 1. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
fix a b x xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
assume "\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)"
[PROOF STATE]
proof (state)
this:
foldl f (f ?a ?b) xs = f ?a (foldl f ?b xs)

goal (1 subgoal):
 1. \<And>a xs aa b. (\<And>a b. foldl f (f a b) xs = f a (foldl f b xs)) \<Longrightarrow> foldl f (f aa b) (a # xs) = f aa (foldl f b (a # xs))
[PROOF STEP]
from assms[of a b x] this[of a "f b x"]
[PROOF STATE]
proof (chain)
picking this:
f (f a b) x = f a (f b x)
foldl f (f a (f b x)) xs = f a (foldl f (f b x) xs)
[PROOF STEP]
show "foldl f (f a b) (x # xs) = f a (foldl f b (x # xs))"
[PROOF STATE]
proof (prove)
using this:
f (f a b) x = f a (f b x)
foldl f (f a (f b x)) xs = f a (foldl f (f b x) xs)

goal (1 subgoal):
 1. foldl f (f a b) (x # xs) = f a (foldl f b (x # xs))
[PROOF STEP]
unfolding foldl_Cons
[PROOF STATE]
proof (prove)
using this:
f (f a b) x = f a (f b x)
foldl f (f a (f b x)) xs = f a (foldl f (f b x) xs)

goal (1 subgoal):
 1. foldl f (f (f a b) x) xs = f a (foldl f (f b x) xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl f (f a b) (x # xs) = f a (foldl f b (x # xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_normalize:
  assumes "x \<noteq> 0"
  shows "norm (normalize x) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (Projections.normalize x) = 1
[PROOF STEP]
by (simp add: normalize_def assms)


[STATEMENT]
lemma SATAxiomBounded:"SATAxiom (sequent gamma) ==> bounded (tree subs gamma)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SATAxiom (sequent gamma) \<Longrightarrow> bounded (tree subs gamma)
[PROOF STEP]
apply(frule SATAxiomTerminal)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SATAxiom (sequent gamma); terminal subs gamma\<rbrakk> \<Longrightarrow> bounded (tree subs gamma)
[PROOF STEP]
apply(subst treeEquation)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SATAxiom (sequent gamma); terminal subs gamma\<rbrakk> \<Longrightarrow> bounded (insert (0, gamma) (\<Union>delta\<in>subs gamma. incLevel ` tree subs delta))
[PROOF STEP]
apply(simp add: subs_def proofTree_def terminal_def founded_def bounded_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SATAxiom (sequent gamma) \<Longrightarrow> \<exists>N. boundedBy N {(0, gamma)}
[PROOF STEP]
apply(force simp add: boundedByInsert boundedByEmpty)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in linorder_topology) at_left_eq:
  "y < x \<Longrightarrow> at_left x = (INF a\<in>{..< x}. principal {a <..< x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> at_left x = (INF a\<in>{..<x}. principal {a<..<x})
[PROOF STEP]
by (subst at_within_order)
     (auto simp: greaterThan_Int_greaterThan greaterThanLessThan_eq[symmetric] min.absorb2 INF_constant
           intro!: INF_lower2 inf_absorb2)


[STATEMENT]
lemma coeff_poly_x_mult_y:
  shows "coeff (poly_x_mult_y p) i = monom (coeff p i) i" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
proof(cases "degree p < i")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
case i: False
[PROOF STATE]
proof (state)
this:
\<not> degree p < i

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
have "?l = sum (\<lambda>j. if j = i then (monom (coeff p j) j) else 0) {..degree p}"
   (is "_ = sum ?f ?A")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (poly_x_mult_y p) i = (\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0)
[PROOF STEP]
by (simp add: poly_x_mult_y_def coeff_sum)
[PROOF STATE]
proof (state)
this:
coeff (poly_x_mult_y p) i = (\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coeff (poly_x_mult_y p) i = (\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
have "... = sum ?f {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0) = (\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0)
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
\<not> degree p < i

goal (1 subgoal):
 1. (\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0) = (\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0)
[PROOF STEP]
by (intro sum.mono_neutral_right, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0) = (\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<le>degree p. if j = i then monom (coeff p j) j else 0) = (\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
have "... = ?f i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0) = (if i = i then monom (coeff p i) i else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0) = (if i = i then monom (coeff p i) i else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{i}. if j = i then monom (coeff p j) j else 0) = (if i = i then monom (coeff p i) i else 0)

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
have "... = ?r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i = i then monom (coeff p i) i else 0) = monom (coeff p i) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if i = i then monom (coeff p i) i else 0) = monom (coeff p i) i

goal (2 subgoals):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
 2. \<not> degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coeff (poly_x_mult_y p) i = monom (coeff p i) i

goal (1 subgoal):
 1. coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
coeff (poly_x_mult_y p) i = monom (coeff p i) i

goal (1 subgoal):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
degree p < i

goal (1 subgoal):
 1. degree p < i \<Longrightarrow> coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree p < i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree p < i

goal (1 subgoal):
 1. coeff (poly_x_mult_y p) i = monom (coeff p i) i
[PROOF STEP]
by (auto simp: poly_x_mult_y_def coeff_eq_0 coeff_sum)
[PROOF STATE]
proof (state)
this:
coeff (poly_x_mult_y p) i = monom (coeff p i) i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma last_nth_length:
assumes "x \<noteq> []"
shows    "x ! ((length x) - Suc 0) = last x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ! (length x - Suc 0) = last x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> []

goal (1 subgoal):
 1. x ! (length x - Suc 0) = last x
[PROOF STEP]
by (metis One_nat_def last_conv_nth)


[STATEMENT]
lemma Sup_less_assertion [simp]: "(!!w . p w \<in> assertion) \<Longrightarrow> Sup_less p w \<in> assertion"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>w. p w \<in> assertion) \<Longrightarrow> Sup_less p w \<in> assertion
[PROOF STEP]
by (unfold Sup_less_def, rule Sup_assertion, auto)


[STATEMENT]
lemma wf_tuple_tabulate_Some: "wf_tuple n A (tabulate f 0 n) \<Longrightarrow> x \<in> A \<Longrightarrow> x < n \<Longrightarrow> \<exists>y. f x = Some y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_tuple n A (tabulate f 0 n); x \<in> A; x < n\<rbrakk> \<Longrightarrow> \<exists>y. f x = Some y
[PROOF STEP]
unfolding wf_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length (tabulate f 0 n) = n \<and> (\<forall>i<n. (tabulate f 0 n ! i = None) = (i \<notin> A)); x \<in> A; x < n\<rbrakk> \<Longrightarrow> \<exists>y. f x = Some y
[PROOF STEP]
by auto


[STATEMENT]
lemma bag_finite: "t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> finite (bag t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> finite (bag t)
[PROOF STEP]
using bags_in_V finite_subset finite_vertex_set
[PROOF STATE]
proof (prove)
using this:
?t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> bag ?t \<subseteq> V
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A
finite V

goal (1 subgoal):
 1. t \<in> V\<^bsub>T\<^esub> \<Longrightarrow> finite (bag t)
[PROOF STEP]
by blast


[STATEMENT]
theorem equivalence_relational_denotational: "(v \<in> E e \<rho>) = (\<rho> \<turnstile> e \<Rightarrow> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v \<in> E e \<rho>) = \<rho> \<turnstile> e \<Rightarrow> v
[PROOF STEP]
using denot_implies_rel rel_implies_denot
[PROOF STATE]
proof (prove)
using this:
?v \<in> E ?e ?\<rho> \<Longrightarrow> ?\<rho> \<turnstile> ?e \<Rightarrow> ?v
?\<rho> \<turnstile> ?e \<Rightarrow> ?v \<Longrightarrow> ?v \<in> E ?e ?\<rho>

goal (1 subgoal):
 1. (v \<in> E e \<rho>) = \<rho> \<turnstile> e \<Rightarrow> v
[PROOF STEP]
by blast


[STATEMENT]
lemma moebius_pt_comp_inv_left [simp]:
  shows "moebius_pt (moebius_inv M) (moebius_pt M z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) (moebius_pt M z) = z
[PROOF STEP]
by (subst moebius_pt_comp[symmetric], simp)


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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reciprocal_reciprocal:
  fixes P :: "'a::{field,ring_char_0} poly"
  assumes hP: "degree P \<le> p"
  shows "reciprocal_poly p (reciprocal_poly p P) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reciprocal_poly p (reciprocal_poly p P) = P
[PROOF STEP]
proof (rule poly_eq_by_eval)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
show "poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
 2. \<not> ?P \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
assume "x = 0"
[PROOF STATE]
proof (state)
this:
x = (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
 2. \<not> ?P \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
thus "poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x"
[PROOF STATE]
proof (prove)
using this:
x = (0::'a)

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
using hP
[PROOF STATE]
proof (prove)
using this:
x = (0::'a)
degree P \<le> p

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
by (auto simp: poly_0_coeff_0 coeff_reciprocal degree_reciprocal)
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x

goal (1 subgoal):
 1. x \<noteq> (0::'a) \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> (0::'a) \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
assume hx: "x \<noteq> 0"
[PROOF STATE]
proof (state)
this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. x \<noteq> (0::'a) \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
hence "poly (reciprocal_poly p (reciprocal_poly p P)) x
        = x ^ p * (inverse x ^ p * poly P x)"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = x ^ p * (inverse x ^ p * poly P x)
[PROOF STEP]
using hP
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)
degree P \<le> p

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = x ^ p * (inverse x ^ p * poly P x)
[PROOF STEP]
by (auto simp: poly_reciprocal degree_reciprocal)
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = x ^ p * (inverse x ^ p * poly P x)

goal (1 subgoal):
 1. x \<noteq> (0::'a) \<Longrightarrow> poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
thus "poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x"
[PROOF STATE]
proof (prove)
using this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = x ^ p * (inverse x ^ p * poly P x)

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
using hP hx left_right_inverse_power right_inverse
[PROOF STATE]
proof (prove)
using this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = x ^ p * (inverse x ^ p * poly P x)
degree P \<le> p
x \<noteq> (0::'a)
?x * ?y = (1::?'a) \<Longrightarrow> ?x ^ ?n * ?y ^ ?n = (1::?'a)
?a \<noteq> (0::?'a) \<Longrightarrow> ?a * inverse ?a = (1::?'a)

goal (1 subgoal):
 1. poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
poly (reciprocal_poly p (reciprocal_poly p P)) x = poly P x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_uk_eq:
  fixes A::"real^'n::{mod_type}^'m::{mod_type}"
  assumes r: "rank A = ncols A"
  shows "norm (column k ((Gram_Schmidt_matrix A))) = ((column k (fst(QR_decomposition A))) \<bullet> (column k A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
let ?uk="column k ((Gram_Schmidt_matrix A))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
let ?qk="column k (fst(QR_decomposition A))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
let ?ak="(column k A)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have sum_rw: "(?uk \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> ?ak / (x \<bullet> x)) *\<^sub>R x)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
have "(?uk \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> ?ak / (x \<bullet> x)) *\<^sub>R x))
      = ((\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. ?uk \<bullet> ((x \<bullet> ?ak / (x \<bullet> x)) *\<^sub>R x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)
[PROOF STEP]
unfolding inner_sum_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (y \<bullet> column k A / (y \<bullet> y)) *\<^sub>R y) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
have "... = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. ((x \<bullet> ?ak / (x \<bullet> x)) * (?uk \<bullet> x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x))
[PROOF STEP]
unfolding inner_scaleR_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x)) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x))

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. column k (Gram_Schmidt_matrix A) \<bullet> (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x))

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x)) = 0
[PROOF STEP]
proof (rule sum.neutral, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x i. i < k \<Longrightarrow> column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0
[PROOF STEP]
fix x i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x i. i < k \<Longrightarrow> column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0
[PROOF STEP]
assume "i<k"
[PROOF STATE]
proof (state)
this:
i < k

goal (1 subgoal):
 1. \<And>x i. i < k \<Longrightarrow> column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0
[PROOF STEP]
hence "?uk \<bullet> column i (Gram_Schmidt_matrix A) = 0"
[PROOF STATE]
proof (prove)
using this:
i < k

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A) = 0
[PROOF STEP]
by (metis less_irrefl r scaleR_columns_Gram_Schmidt_matrix)
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A) = 0

goal (1 subgoal):
 1. \<And>x i. i < k \<Longrightarrow> column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0
[PROOF STEP]
thus "column i (Gram_Schmidt_matrix A) \<bullet> ?ak / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) *
        (?uk \<bullet> column i (Gram_Schmidt_matrix A)) = 0"
[PROOF STATE]
proof (prove)
using this:
column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A) = 0

goal (1 subgoal):
 1. column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
column i (Gram_Schmidt_matrix A) \<bullet> column k A / (column i (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column i (Gram_Schmidt_matrix A)) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. x \<bullet> column k A / (x \<bullet> x) * (column k (Gram_Schmidt_matrix A) \<bullet> x)) = 0

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0

goal (1 subgoal):
 1. column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x) = 0

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "?qk \<bullet> ?ak = ((1/(norm ?uk)) *\<^sub>R ?uk) \<bullet> ?ak"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (fst (QR_decomposition A)) \<bullet> column k A = (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A
[PROOF STEP]
unfolding qk_uk_norm
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. column k (fst (QR_decomposition A)) \<bullet> column k A = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
column k (fst (QR_decomposition A)) \<bullet> column k A = (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
column k (fst (QR_decomposition A)) \<bullet> column k A = (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "... = (1/(norm ?uk)) * (?uk \<bullet> ?ak)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A)
[PROOF STEP]
unfolding inner_scaleR_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A)

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1 / norm (column k (Gram_Schmidt_matrix A))) *\<^sub>R column k (Gram_Schmidt_matrix A) \<bullet> column k A = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A)

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "... =
    (1/(norm ?uk)) * (?uk \<bullet> (?uk + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> ?ak / (x \<bullet> x)) *\<^sub>R x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)))
[PROOF STEP]
using column_Gram_Schmidt_matrix2[of k A]
[PROOF STATE]
proof (prove)
using this:
column k A = column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)

goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k A) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "... = (1/(norm ?uk)) * ((?uk \<bullet> ?uk) + (?uk \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> ?ak / (x \<bullet> x)) *\<^sub>R x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))
[PROOF STEP]
unfolding inner_add_right
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> (column k (Gram_Schmidt_matrix A) + (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "... = (1/(norm ?uk)) * (?uk \<bullet> ?uk)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A))
[PROOF STEP]
unfolding sum_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + 0) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A) + column k (Gram_Schmidt_matrix A) \<bullet> (\<Sum>x\<in>{column i (Gram_Schmidt_matrix A) |i. i < k}. (x \<bullet> column k A / (x \<bullet> x)) *\<^sub>R x)) = 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
have "... = norm ?uk"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A)) = norm (column k (Gram_Schmidt_matrix A))
[PROOF STEP]
by (metis abs_of_nonneg divide_eq_imp div_by_0 inner_commute inner_ge_zero inner_real_def
      norm_mult_vec real_inner_1_right real_norm_def times_divide_eq_right)
[PROOF STATE]
proof (state)
this:
1 / norm (column k (Gram_Schmidt_matrix A)) * (column k (Gram_Schmidt_matrix A) \<bullet> column k (Gram_Schmidt_matrix A)) = norm (column k (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
column k (fst (QR_decomposition A)) \<bullet> column k A = norm (column k (Gram_Schmidt_matrix A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
column k (fst (QR_decomposition A)) \<bullet> column k A = norm (column k (Gram_Schmidt_matrix A))

goal (1 subgoal):
 1. norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm (column k (Gram_Schmidt_matrix A)) = column k (fst (QR_decomposition A)) \<bullet> column k A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monos_compose [intro]:
     assumes "mono m" and "mono m'" and "seq m' m"
     shows "mono (m' \<cdot> m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.mono (m' \<cdot> m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.mono (m' \<cdot> m)
[PROOF STEP]
have "inj_on (\<lambda>f. (m' \<cdot> m) \<cdot> f) {f. seq (m' \<cdot> m) f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on ((\<cdot>) (m' \<cdot> m)) {f. seq (m' \<cdot> m) f}
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{f. seq (m' \<cdot> m) f}. \<forall>y\<in>{f. seq (m' \<cdot> m) f}. (m' \<cdot> m) \<cdot> x = (m' \<cdot> m) \<cdot> y \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
local.mono m
local.mono m'
seq m' m

goal (1 subgoal):
 1. \<forall>x\<in>{f. seq (m' \<cdot> m) f}. \<forall>y\<in>{f. seq (m' \<cdot> m) f}. (m' \<cdot> m) \<cdot> x = (m' \<cdot> m) \<cdot> y \<longrightarrow> x = y
[PROOF STEP]
by (metis CollectD seqE monoE comp_assoc)
[PROOF STATE]
proof (state)
this:
inj_on ((\<cdot>) (m' \<cdot> m)) {f. seq (m' \<cdot> m) f}

goal (1 subgoal):
 1. local.mono (m' \<cdot> m)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on ((\<cdot>) (m' \<cdot> m)) {f. seq (m' \<cdot> m) f}

goal (1 subgoal):
 1. local.mono (m' \<cdot> m)
[PROOF STEP]
using assms(3) mono_def
[PROOF STATE]
proof (prove)
using this:
inj_on ((\<cdot>) (m' \<cdot> m)) {f. seq (m' \<cdot> m) f}
seq m' m
local.mono ?f = (arr ?f \<and> inj_on ((\<cdot>) ?f) {g. seq ?f g})

goal (1 subgoal):
 1. local.mono (m' \<cdot> m)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
local.mono (m' \<cdot> m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_insert:
  "sorted(inorder t) \<Longrightarrow> inorder(insert x t) = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (RBT_Set.insert x t) = ins_list x (Tree2.inorder t)
[PROOF STEP]
by (simp add: insert_def inorder_ins inorder_paint)


[STATEMENT]
lemma kernel_padl:
  assumes dD: "d \<in> mat_kernel (D :: 'a :: field mat)"
      and A: "A \<in> carrier_mat nr1 nc1"
      and C: "C \<in> carrier_mat nr2 nc1"
      and D: "D \<in> carrier_mat nr2 nc2"
  shows "padl nc1 d \<in> mat_kernel (four_block_mat A (0\<^sub>m nr1 nc2) C D)" (is "_ \<in> mat_kernel ?ABCD")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> mat_kernel (four_block_mat A (0\<^sub>m nr1 nc2) C D)
[PROOF STEP]
unfolding mat_kernel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> {v \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D)). four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v v = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))}
[PROOF STEP]
proof (rule, intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
 2. four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d) = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
have [simp]: "dim_row A = nr1" "dim_row D = nr2" "dim_row ?ABCD = nr1 + nr2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = nr1 &&& dim_row D = nr2 &&& dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D) = nr1 + nr2
[PROOF STEP]
using A D
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr1 nc1
D \<in> carrier_mat nr2 nc2

goal (1 subgoal):
 1. dim_row A = nr1 &&& dim_row D = nr2 &&& dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D) = nr1 + nr2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row A = nr1
dim_row D = nr2
dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D) = nr1 + nr2

goal (2 subgoals):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
 2. four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d) = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
have d: "d : carrier_vec nc2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> carrier_vec nc2
[PROOF STEP]
using mat_kernel_carrier[OF D] dD
[PROOF STATE]
proof (prove)
using this:
mat_kernel D \<subseteq> carrier_vec nc2
d \<in> mat_kernel D

goal (1 subgoal):
 1. d \<in> carrier_vec nc2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d \<in> carrier_vec nc2

goal (2 subgoals):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
 2. four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d) = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
show "?ABCD *\<^sub>v padl nc1 d = 0\<^sub>v (dim_row ?ABCD)" (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d) = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
assume i: "i < dim_vec ?r"
[PROOF STATE]
proof (state)
this:
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
hence "?l $ i = row ?ABCD i \<bullet> padl nc1 d"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (1 subgoal):
 1. (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d)

goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d)

goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
proof (cases "i < nr1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i < nr1

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
let ?B = "0\<^sub>m nr1 nc2"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have rows: "row A i : carrier_vec nc1" "row ?B i : carrier_vec nc2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row A i \<in> carrier_vec nc1 &&& row (0\<^sub>m nr1 nc2) i \<in> carrier_vec nc2
[PROOF STEP]
using A True
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr1 nc1
i < nr1

goal (1 subgoal):
 1. row A i \<in> carrier_vec nc1 &&& row (0\<^sub>m nr1 nc2) i \<in> carrier_vec nc2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row A i \<in> carrier_vec nc1
row (0\<^sub>m nr1 nc2) i \<in> carrier_vec nc2

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row ?ABCD i = row A i @\<^sub>v row ?B i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i
[PROOF STEP]
using row_four_block_mat(1)[OF A _ C D True]
[PROOF STATE]
proof (prove)
using this:
?B \<in> carrier_mat nr1 nc2 \<Longrightarrow> row (four_block_mat A ?B C D) i = row A i @\<^sub>v row ?B i

goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "... \<bullet> padl nc1 d = row A i \<bullet> 0\<^sub>v nc1 + row ?B i \<bullet> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row A i \<bullet> 0\<^sub>v nc1 + row (0\<^sub>m nr1 nc2) i \<bullet> d
[PROOF STEP]
using scalar_prod_append[OF rows] d
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w1.0 \<in> carrier_vec nc1; ?w2.0 \<in> carrier_vec nc2\<rbrakk> \<Longrightarrow> (row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i) \<bullet> (?w1.0 @\<^sub>v ?w2.0) = row A i \<bullet> ?w1.0 + row (0\<^sub>m nr1 nc2) i \<bullet> ?w2.0
d \<in> carrier_vec nc2

goal (1 subgoal):
 1. (row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row A i \<bullet> 0\<^sub>v nc1 + row (0\<^sub>m nr1 nc2) i \<bullet> d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row A i \<bullet> 0\<^sub>v nc1 + row (0\<^sub>m nr1 nc2) i \<bullet> d

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(row A i @\<^sub>v row (0\<^sub>m nr1 nc2) i) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row A i \<bullet> 0\<^sub>v nc1 + row (0\<^sub>m nr1 nc2) i \<bullet> d

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row A i \<bullet> 0\<^sub>v nc1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row A i \<bullet> 0\<^sub>v nc1 = (0::'a)
[PROOF STEP]
using A True
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr1 nc1
i < nr1

goal (1 subgoal):
 1. row A i \<bullet> 0\<^sub>v nc1 = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row A i \<bullet> 0\<^sub>v nc1 = (0::'a)

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row A i \<bullet> 0\<^sub>v nc1 = (0::'a)

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row ?B i \<bullet> d = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (0\<^sub>m nr1 nc2) i \<bullet> d = (0::'a)
[PROOF STEP]
using True d
[PROOF STATE]
proof (prove)
using this:
i < nr1
d \<in> carrier_vec nc2

goal (1 subgoal):
 1. row (0\<^sub>m nr1 nc2) i \<bullet> d = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row (0\<^sub>m nr1 nc2) i \<bullet> d = (0::'a)

goal (2 subgoals):
 1. i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
 2. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a) + (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a) + (0::'a)

goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> i < nr1

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
let ?i = "i - nr1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have rows:
            "row C ?i : carrier_vec nc1" "row D ?i : carrier_vec nc2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row C (i - nr1) \<in> carrier_vec nc1 &&& row D (i - nr1) \<in> carrier_vec nc2
[PROOF STEP]
using C D i False A
[PROOF STATE]
proof (prove)
using this:
C \<in> carrier_mat nr2 nc1
D \<in> carrier_mat nr2 nc2
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
\<not> i < nr1
A \<in> carrier_mat nr1 nc1

goal (1 subgoal):
 1. row C (i - nr1) \<in> carrier_vec nc1 &&& row D (i - nr1) \<in> carrier_vec nc2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row C (i - nr1) \<in> carrier_vec nc1
row D (i - nr1) \<in> carrier_vec nc2

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row ?ABCD i = row C ?i @\<^sub>v row D ?i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
using row_four_block_mat(2)[OF A _ C D False] i A D
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat nr1 nc2; i < nr1 + nr2\<rbrakk> \<Longrightarrow> row (four_block_mat A ?B C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
A \<in> carrier_mat nr1 nc1
D \<in> carrier_mat nr2 nc2

goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i = row C (i - nr1) @\<^sub>v row D (i - nr1)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "... \<bullet> padl nc1 d = row C ?i \<bullet> 0\<^sub>v nc1 + row D ?i \<bullet> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (row C (i - nr1) @\<^sub>v row D (i - nr1)) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row C (i - nr1) \<bullet> 0\<^sub>v nc1 + row D (i - nr1) \<bullet> d
[PROOF STEP]
using scalar_prod_append[OF rows] d
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w1.0 \<in> carrier_vec nc1; ?w2.0 \<in> carrier_vec nc2\<rbrakk> \<Longrightarrow> (row C (i - nr1) @\<^sub>v row D (i - nr1)) \<bullet> (?w1.0 @\<^sub>v ?w2.0) = row C (i - nr1) \<bullet> ?w1.0 + row D (i - nr1) \<bullet> ?w2.0
d \<in> carrier_vec nc2

goal (1 subgoal):
 1. (row C (i - nr1) @\<^sub>v row D (i - nr1)) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row C (i - nr1) \<bullet> 0\<^sub>v nc1 + row D (i - nr1) \<bullet> d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(row C (i - nr1) @\<^sub>v row D (i - nr1)) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row C (i - nr1) \<bullet> 0\<^sub>v nc1 + row D (i - nr1) \<bullet> d

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(row C (i - nr1) @\<^sub>v row D (i - nr1)) \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = row C (i - nr1) \<bullet> 0\<^sub>v nc1 + row D (i - nr1) \<bullet> d

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row C ?i \<bullet> 0\<^sub>v nc1 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row C (i - nr1) \<bullet> 0\<^sub>v nc1 = (0::'a)
[PROOF STEP]
using False A C i
[PROOF STATE]
proof (prove)
using this:
\<not> i < nr1
A \<in> carrier_mat nr1 nc1
C \<in> carrier_mat nr2 nc1
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (1 subgoal):
 1. row C (i - nr1) \<bullet> 0\<^sub>v nc1 = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row C (i - nr1) \<bullet> 0\<^sub>v nc1 = (0::'a)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row C (i - nr1) \<bullet> 0\<^sub>v nc1 = (0::'a)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "row D ?i \<bullet> d = (D *\<^sub>v d) $ ?i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row D (i - nr1) \<bullet> d = (D *\<^sub>v d) $ (i - nr1)
[PROOF STEP]
using D d False i
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat nr2 nc2
d \<in> carrier_vec nc2
\<not> i < nr1
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (1 subgoal):
 1. row D (i - nr1) \<bullet> d = (D *\<^sub>v d) $ (i - nr1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row D (i - nr1) \<bullet> d = (D *\<^sub>v d) $ (i - nr1)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row D (i - nr1) \<bullet> d = (D *\<^sub>v d) $ (i - nr1)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (D *\<^sub>v d) $ (i - nr1) = (0::'a)
[PROOF STEP]
using mat_kernelD[OF D dD]
[PROOF STATE]
proof (prove)
using this:
d \<in> carrier_vec nc2
D *\<^sub>v d = 0\<^sub>v nr2

goal (1 subgoal):
 1. (D *\<^sub>v d) $ (i - nr1) = (0::'a)
[PROOF STEP]
using False i
[PROOF STATE]
proof (prove)
using this:
d \<in> carrier_vec nc2
D *\<^sub>v d = 0\<^sub>v nr2
\<not> i < nr1
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (1 subgoal):
 1. (D *\<^sub>v d) $ (i - nr1) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(D *\<^sub>v d) $ (i - nr1) = (0::'a)

goal (1 subgoal):
 1. \<not> i < nr1 \<Longrightarrow> row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a) + (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a) + (0::'a)

goal (1 subgoal):
 1. row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row (four_block_mat A (0\<^sub>m nr1 nc2) C D) i \<bullet> (0\<^sub>v nc1 @\<^sub>v d) = (0::'a)

goal (2 subgoals):
 1. \<And>i. i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))) \<Longrightarrow> (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
 2. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = (0::'a)
[PROOF STEP]
show "?l $ i = ?r $ i"
[PROOF STATE]
proof (prove)
using this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = (0::'a)

goal (1 subgoal):
 1. (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = (0::'a)
i < dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))

goal (1 subgoal):
 1. (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) $ i = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)) $ i

goal (1 subgoal):
 1. dim_vec (four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d)) = dim_vec (0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D)))
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
four_block_mat A (0\<^sub>m nr1 nc2) C D *\<^sub>v (0\<^sub>v nc1 @\<^sub>v d) = 0\<^sub>v (dim_row (four_block_mat A (0\<^sub>m nr1 nc2) C D))

goal (1 subgoal):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
show "padl nc1 d : carrier_vec (dim_col ?ABCD)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
using d A D
[PROOF STATE]
proof (prove)
using this:
d \<in> carrier_vec nc2
A \<in> carrier_mat nr1 nc1
D \<in> carrier_mat nr2 nc2

goal (1 subgoal):
 1. 0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nc1 @\<^sub>v d \<in> carrier_vec (dim_col (four_block_mat A (0\<^sub>m nr1 nc2) C D))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hcomplex_hcnj_zero_iff [iff]: "\<And>z. hcnj z = 0 \<longleftrightarrow> z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. (hcnj z = 0) = (z = 0)
[PROOF STEP]
by transfer (rule complex_cnj_zero_iff)


[STATEMENT]
lemma successively_append_iff:
  "successively P (xs @ ys) \<longleftrightarrow>
     successively P xs \<and> successively P ys \<and>
     (xs = [] \<or> ys = [] \<or> P (last xs) (hd ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. successively P (xs @ ys) = (successively P xs \<and> successively P ys \<and> (xs = [] \<or> ys = [] \<or> P (last xs) (hd ys)))
[PROOF STEP]
by (induction xs) (auto simp: successively_Cons)


[STATEMENT]
lemma (in aGroup) pOp_cancel_r:"\<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A;               a \<plusminus> c =  b \<plusminus> c \<rbrakk> \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A; a \<plusminus> c = b \<plusminus> c\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by (simp add:ag_pOp_commute pOp_cancel_l)