[STATEMENT]
lemma inverse_mat_base_case_R:
  shows "inverts_mat (mat_of_rows_list 3  [[1/2, -1/2, 1/2], [0, 1, 0], [1/2, -1/2, -1/2]]::rat mat) (mat_of_rows_list 3 [[1,1,1], [0,1,0], [1,0,-1]]::rat mat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat (mat_of_rows_list 3 [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) (mat_of_rows_list 3 [[1, 1, 1], [0, 1, 0], [1, 0, - 1]])
[PROOF STEP]
unfolding inverts_mat_def mat_of_rows_list_def mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y) * mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)) = dim_row (1\<^sub>m (dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)))) \<and> dim_col (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y) * mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)) = dim_col (1\<^sub>m (dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)))) \<and> (\<forall>i j. i < dim_row (1\<^sub>m (dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)))) \<longrightarrow> j < dim_col (1\<^sub>m (dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y)))) \<longrightarrow> (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y) * mat (length [[1, 1, 1], [0, 1, 0], [1, 0, - 1]]) 3 (\<lambda>(i, y). [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! y)) $$ (i, j) = 1\<^sub>m (dim_row (mat (length [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]]) 3 (\<lambda>(i, y). [[1 / 2, - 1 / 2, 1 / 2], [0, 1, 0], [1 / 2, - 1 / 2, - 1 / 2]] ! i ! y))) $$ (i, j))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j < Suc (Suc (Suc 0)) \<Longrightarrow> vec 3 ((!) ([[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! j)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! j) = 1
 2. \<And>i j. \<lbrakk>i < Suc (Suc (Suc 0)); i \<noteq> j; j < Suc (Suc (Suc 0))\<rbrakk> \<Longrightarrow> vec 3 ((!) ([[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! j) = 0
[PROOF STEP]
unfolding less_three
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>j. j = 0 \<or> j = 1 \<or> j = 2 \<Longrightarrow> vec 3 ((!) ([[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! j)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! j) = 1
 2. \<And>i j. \<lbrakk>i = 0 \<or> i = 1 \<or> i = 2; i \<noteq> j; j = 0 \<or> j = 1 \<or> j = 2\<rbrakk> \<Longrightarrow> vec 3 ((!) ([[1 / 2, - (1 / 2), 1 / 2], [0, 1, 0], [1 / 2, - (1 / 2), - (1 / 2)]] ! i)) \<bullet> vec (Suc (Suc (Suc 0))) (\<lambda>i. [[1, 1, 1], [0, 1, 0], [1, 0, - 1]] ! i ! j) = 0
[PROOF STEP]
by (auto simp add: scalar_prod_def)


[STATEMENT]
lemma le_right_combine_matrix:
  assumes
  "f 0 0 = 0"
  "\<forall>a b c. a <= b \<longrightarrow> f a c <= f b c"
  "A <= B"
  shows
  "combine_matrix f A C <= combine_matrix f B C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. combine_matrix f A C \<le> combine_matrix f B C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f (0::'b) (0::'c) = (0::'a)
\<forall>a b c. a \<le> b \<longrightarrow> f a c \<le> f b c
A \<le> B

goal (1 subgoal):
 1. combine_matrix f A C \<le> combine_matrix f B C
[PROOF STEP]
by (simp add: le_matrix_def)


[STATEMENT]
lemma (in Order) compare_minimum_elements:"\<lbrakk>S \<subseteq> carrier D; T \<subseteq> carrier D;
      S \<subseteq> T; minimum_elem D S s; minimum_elem D T t \<rbrakk> \<Longrightarrow> t \<preceq> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> carrier D; T \<subseteq> carrier D; S \<subseteq> T; minimum_elem D S s; minimum_elem D T t\<rbrakk> \<Longrightarrow> t \<preceq> s
[PROOF STEP]
apply (frule minimum_elem_mem[of "S" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> carrier D; T \<subseteq> carrier D; S \<subseteq> T; minimum_elem D S s; minimum_elem D T t; s \<in> S\<rbrakk> \<Longrightarrow> t \<preceq> s
[PROOF STEP]
apply (frule subsetD[of "S" "T" "s"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<subseteq> carrier D; T \<subseteq> carrier D; S \<subseteq> T; minimum_elem D S s; minimum_elem D T t; s \<in> S; s \<in> T\<rbrakk> \<Longrightarrow> t \<preceq> s
[PROOF STEP]
apply (simp add:minimum_elem_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma GreaterThan_bounded_induct:
     "!!l::nat. \<forall>m \<in> lessThan l.
                 F \<in> (A \<inter> f-`{m}) LeadsTo ((A \<inter> f-`(greaterThan m)) \<union> B)
      ==> F \<in> A LeadsTo ((A \<inter> (f-`(atLeast l))) \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B \<Longrightarrow> F \<in> A \<longmapsto>w A \<inter> f -` {l..} \<union> B
[PROOF STEP]
apply (rule_tac f = f and f1 = "%k. l - k"
       in wf_less_than [THEN wf_inv_image, THEN LeadsTo_wf_induct])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B \<Longrightarrow> \<forall>m. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` (inv_image less_than ((-) l))\<inverse> `` {m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (simp add: Image_singleton, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l m. \<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (case_tac "m<l")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>l m. \<lbrakk>\<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B; m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
 2. \<And>l m. \<lbrakk>\<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B; \<not> m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (blast intro: LeadsTo_weaken_R diff_less_mono2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>l m. \<lbrakk>\<forall>m\<in>{..<l}. F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> f -` {m<..} \<union> B; \<not> m < l\<rbrakk> \<Longrightarrow> F \<in> A \<inter> f -` {m} \<longmapsto>w A \<inter> {y. l - f y < l - m} \<union> (A \<inter> f -` {l..} \<union> B)
[PROOF STEP]
apply (blast intro: not_le_imp_less subset_imp_LeadsTo)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cut_greater_image: "
  \<lbrakk> strict_mono_on f A; I \<subseteq> A; n \<in> A \<rbrakk> \<Longrightarrow>
  (f ` I) \<down>> f n = f ` (I \<down>> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>SetInterval2.strict_mono_on f A; I \<subseteq> A; n \<in> A\<rbrakk> \<Longrightarrow> (f ` I) \<down>> f n = f ` I \<down>> n
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>SetInterval2.strict_mono_on f A; I \<subseteq> A; n \<in> A\<rbrakk> \<Longrightarrow> (x \<in> (f ` I) \<down>> f n) = (x \<in> f ` I \<down>> n)
[PROOF STEP]
apply (simp add: image_iff Bex_def cut_greater_mem_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>SetInterval2.strict_mono_on f A; I \<subseteq> A; n \<in> A\<rbrakk> \<Longrightarrow> ((\<exists>xa. xa \<in> I \<and> x = f xa) \<and> f n < x) = (\<exists>xa. xa \<in> I \<and> n < xa \<and> x = f xa)
[PROOF STEP]
apply (unfold strict_mono_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; I \<subseteq> A; n \<in> A\<rbrakk> \<Longrightarrow> ((\<exists>xa. xa \<in> I \<and> x = f xa) \<and> f n < x) = (\<exists>xa. xa \<in> I \<and> n < xa \<and> x = f xa)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; I \<subseteq> A; n \<in> A; (\<exists>xa. xa \<in> I \<and> x = f xa) \<and> f n < x\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> I \<and> n < xa \<and> x = f xa
 2. \<And>x. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; I \<subseteq> A; n \<in> A; \<exists>xa. xa \<in> I \<and> n < xa \<and> x = f xa\<rbrakk> \<Longrightarrow> (\<exists>xa. xa \<in> I \<and> x = f xa) \<and> f n < x
[PROOF STEP]
apply (metis not_less_iff_gr_or_eq rev_subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>a\<in>A. \<forall>b\<in>A. a < b \<longrightarrow> f a < f b; I \<subseteq> A; n \<in> A; \<exists>xa. xa \<in> I \<and> n < xa \<and> x = f xa\<rbrakk> \<Longrightarrow> (\<exists>xa. xa \<in> I \<and> x = f xa) \<and> f n < x
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dim_eq_card_independent: "independent B \<Longrightarrow> dim B = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent B \<Longrightarrow> dim B = card B
[PROOF STEP]
by (rule dim_eq_card[OF refl])


[STATEMENT]
lemma p_ge_18: "p \<ge> 18"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 18 \<le> p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 18 \<le> p
[PROOF STEP]
have "p \<ge> 19"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 19 \<le> p
[PROOF STEP]
by (metis p_def prime_above_lower_bound max.bounded_iff)
[PROOF STATE]
proof (state)
this:
19 \<le> p

goal (1 subgoal):
 1. 18 \<le> p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
19 \<le> p

goal (1 subgoal):
 1. 18 \<le> p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
18 \<le> p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_empty: "M -s {} = M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M -s {} = M
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># M. x \<notin> {}#} = M
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma (in domain) mult_divides:
  assumes "a \<in> carrier R" "b \<in> carrier R" "c \<in> carrier R - { \<zero> }"
  shows "(c \<otimes> a) divides (c \<otimes> b) \<Longrightarrow> a divides b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<otimes> a divides c \<otimes> b \<Longrightarrow> a divides b
[PROOF STEP]
using assms m_assoc[of c]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
c \<in> carrier R - {\<zero>}
\<lbrakk>c \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> c \<otimes> ?y \<otimes> ?z = c \<otimes> (?y \<otimes> ?z)

goal (1 subgoal):
 1. c \<otimes> a divides c \<otimes> b \<Longrightarrow> a divides b
[PROOF STEP]
unfolding factor_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
c \<in> carrier R - {\<zero>}
\<lbrakk>c \<in> carrier R; ?y \<in> carrier R; ?z \<in> carrier R\<rbrakk> \<Longrightarrow> c \<otimes> ?y \<otimes> ?z = c \<otimes> (?y \<otimes> ?z)

goal (1 subgoal):
 1. \<exists>ca\<in>carrier R. c \<otimes> b = c \<otimes> a \<otimes> ca \<Longrightarrow> \<exists>c\<in>carrier R. b = a \<otimes> c
[PROOF STEP]
by (simp add: m_lcancel)


[STATEMENT]
lemma invertible_implies_rref_id:
  fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
  assumes inv_A: "invertible A"
  shows "Gauss_Jordan A = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan A = mat (1::'a)
[PROOF STEP]
using id_upt_k_Gauss_Jordan[OF inv_A, of "nrows (Gauss_Jordan A)"]
[PROOF STATE]
proof (prove)
using this:
id_upt_k (Gauss_Jordan A) (nrows (Gauss_Jordan A))

goal (1 subgoal):
 1. Gauss_Jordan A = mat (1::'a)
[PROOF STEP]
using id_upt_nrows_mat_1
[PROOF STATE]
proof (prove)
using this:
id_upt_k (Gauss_Jordan A) (nrows (Gauss_Jordan A))
id_upt_k ?A (nrows ?A) \<Longrightarrow> ?A = mat (1::?'a)

goal (1 subgoal):
 1. Gauss_Jordan A = mat (1::'a)
[PROOF STEP]
by fast


[STATEMENT]
lemma list_not_empty:
  "\<exists>a. a\<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A
[PROOF STEP]
apply (induct "n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list 0 A
 2. \<And>n. \<lbrakk>\<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. xs \<in> list (Suc n) A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<exists>a. a \<in> A \<Longrightarrow> \<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. xs \<in> list (Suc n) A
[PROOF STEP]
apply (simp add: in_list_Suc_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<exists>xs. xs \<in> list n A; \<exists>a. a \<in> A\<rbrakk> \<Longrightarrow> \<exists>xs. \<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mod_ring_uminus64: "(mod_ring_rel64 ===> mod_ring_rel64) (uminus_p64 pp) uminus"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64) (uminus_p64 pp) uminus
[PROOF STEP]
using urel64_uminus mod_ring_uminus
[PROOF STATE]
proof (prove)
using this:
urel64 ?x ?y \<Longrightarrow> urel64 (uminus_p64 pp ?x) (uminus_p p ?y)
(mod_ring_rel ===> mod_ring_rel) (uminus_p p) uminus

goal (1 subgoal):
 1. (mod_ring_rel64 ===> mod_ring_rel64) (uminus_p64 pp) uminus
[PROOF STEP]
unfolding mod_ring_rel64_def rel_fun_def
[PROOF STATE]
proof (prove)
using this:
urel64 ?x ?y \<Longrightarrow> urel64 (uminus_p64 pp ?x) (uminus_p p ?y)
\<forall>x y. mod_ring_rel x y \<longrightarrow> mod_ring_rel (uminus_p p x) (- y)

goal (1 subgoal):
 1. \<forall>x y. (\<exists>z. urel64 x z \<and> mod_ring_rel z y) \<longrightarrow> (\<exists>z. urel64 (uminus_p64 pp x) z \<and> mod_ring_rel z (- y))
[PROOF STEP]
by blast


[STATEMENT]
lemma positive_iff_normalized_vec:
  "positive A \<longleftrightarrow>
    A \<in> carrier_mat (dim_col A) (dim_col A) \<and>
    (\<forall>v. (dim_vec v = dim_col A \<and> vec_norm v = 1) \<longrightarrow> inner_prod v (A *\<^sub>v v) \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive A = (A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)))
[PROOF STEP]
proof (rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. positive A \<Longrightarrow> A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
 2. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
assume "positive A"
[PROOF STATE]
proof (state)
this:
positive A

goal (2 subgoals):
 1. positive A \<Longrightarrow> A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
 2. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
positive A
[PROOF STEP]
show "A \<in> carrier_mat (dim_col A) (dim_col A) \<and>
    (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))"
[PROOF STATE]
proof (prove)
using this:
positive A

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
[PROOF STEP]
unfolding positive_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
define n where "n = dim_col A"
[PROOF STATE]
proof (state)
this:
n = dim_col A

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
assume "A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))"
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
[PROOF STEP]
have A: "A \<in> carrier_mat (dim_col A) (dim_col A)" and geq0: "\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) &&& \<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat (dim_col A) (dim_col A)
\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat (dim_col A) (dim_col A)
\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
have dimA: "A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_col A) (dim_col A)
\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
using n_def[symmetric]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat (dim_col A) (dim_col A)
\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
dim_col A = n

goal (1 subgoal):
 1. A \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
assume dimv: "(v::complex vec) \<in> carrier_vec n"
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
have "0 \<le> inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
proof (cases "v = 0\<^sub>v n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v = 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
 2. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v = 0\<^sub>v n

goal (2 subgoals):
 1. v = 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
 2. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v = 0\<^sub>v n
[PROOF STEP]
show "0 \<le> inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
using this:
v = 0\<^sub>v n

goal (1 subgoal):
 1. 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
using dimA
[PROOF STATE]
proof (prove)
using this:
v = 0\<^sub>v n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<noteq> 0\<^sub>v n
[PROOF STEP]
have 1: "vec_norm v > 0"
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. 0 < vec_norm v
[PROOF STEP]
using vec_norm_ge_0 dimv
[PROOF STATE]
proof (prove)
using this:
v \<noteq> 0\<^sub>v n
\<lbrakk>?v \<in> carrier_vec ?n; ?v \<noteq> 0\<^sub>v ?n\<rbrakk> \<Longrightarrow> 0 < vec_norm ?v
v \<in> carrier_vec n

goal (1 subgoal):
 1. 0 < vec_norm v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < vec_norm v

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < vec_norm v
[PROOF STEP]
have cnv: "cnj (vec_norm v) = vec_norm v"
[PROOF STATE]
proof (prove)
using this:
0 < vec_norm v

goal (1 subgoal):
 1. cnj (vec_norm v) = vec_norm v
[PROOF STEP]
using Reals_cnj_iff complex_is_Real_iff less_complex_def
[PROOF STATE]
proof (prove)
using this:
0 < vec_norm v
(?z \<in> \<real>) = (cnj ?z = ?z)
(?z \<in> \<real>) = (Im ?z = 0)
(?x < ?y) = (Re ?x < Re ?y \<and> Im ?x = Im ?y)

goal (1 subgoal):
 1. cnj (vec_norm v) = vec_norm v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cnj (vec_norm v) = vec_norm v

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
define w where "w = vec_normalize v"
[PROOF STATE]
proof (state)
this:
w = vec_normalize v

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w = vec_normalize v
[PROOF STEP]
have dimw: "w \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
w = vec_normalize v

goal (1 subgoal):
 1. w \<in> carrier_vec n
[PROOF STEP]
using dimv
[PROOF STATE]
proof (prove)
using this:
w = vec_normalize v
v \<in> carrier_vec n

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

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
have nvw: "v = vec_norm v \<cdot>\<^sub>v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = vec_norm v \<cdot>\<^sub>v w
[PROOF STEP]
using w_def vec_eq_norm_smult_normalized
[PROOF STATE]
proof (prove)
using this:
w = vec_normalize v
?v = vec_norm ?v \<cdot>\<^sub>v vec_normalize ?v

goal (1 subgoal):
 1. v = vec_norm v \<cdot>\<^sub>v w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = vec_norm v \<cdot>\<^sub>v w

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
have "vec_norm w = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_norm w = 1
[PROOF STEP]
using normalized_vec_norm[OF dimv False] vec_norm_def w_def
[PROOF STATE]
proof (prove)
using this:
inner_prod (vec_normalize v) (vec_normalize v) = 1
vec_norm ?v \<equiv> csqrt (inner_prod ?v ?v)
w = vec_normalize v

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

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vec_norm w = 1
[PROOF STEP]
have 2: "0 \<le> inner_prod w (A *\<^sub>v w)"
[PROOF STATE]
proof (prove)
using this:
vec_norm w = 1

goal (1 subgoal):
 1. 0 \<le> inner_prod w (A *\<^sub>v w)
[PROOF STEP]
using geq0 dimw dimA
[PROOF STATE]
proof (prove)
using this:
vec_norm w = 1
\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
w \<in> carrier_vec n
A \<in> carrier_mat n n

goal (1 subgoal):
 1. 0 \<le> inner_prod w (A *\<^sub>v w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod w (A *\<^sub>v w)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
have "inner_prod v (A *\<^sub>v v) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
using dimA dimv dimw
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod v (A *\<^sub>v v) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
apply (subst (1 2) nvw)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n n; v \<in> carrier_vec n; w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> inner_prod (vec_norm v \<cdot>\<^sub>v w) (A *\<^sub>v (vec_norm v \<cdot>\<^sub>v w)) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
apply (subst mult_mat_vec, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n n; v \<in> carrier_vec n; w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> inner_prod (vec_norm v \<cdot>\<^sub>v w) (vec_norm v \<cdot>\<^sub>v (A *\<^sub>v w)) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
apply (subst scalar_prod_smult_left[of "(A *\<^sub>v w)" "conjugate (vec_norm v \<cdot>\<^sub>v w)" "vec_norm v"], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n n; v \<in> carrier_vec n; w \<in> carrier_vec n\<rbrakk> \<Longrightarrow> vec_norm v * inner_prod (vec_norm v \<cdot>\<^sub>v w) (A *\<^sub>v w) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
apply (simp add: conjugate_smult_vec cnv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v v) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inner_prod v (A *\<^sub>v v) = vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
have "\<dots> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
0 < vec_norm v
0 \<le> inner_prod w (A *\<^sub>v w)

goal (1 subgoal):
 1. 0 \<le> vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> vec_norm v * vec_norm v * inner_prod w (A *\<^sub>v w)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n \<Longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
show "0 \<le> inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod v (A *\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?v2 \<in> carrier_vec n \<Longrightarrow> 0 \<le> inner_prod ?v2 (A *\<^sub>v ?v2)

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?v2 \<in> carrier_vec n \<Longrightarrow> 0 \<le> inner_prod ?v2 (A *\<^sub>v ?v2)
[PROOF STEP]
have geq: "\<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)"
[PROOF STATE]
proof (prove)
using this:
?v2 \<in> carrier_vec n \<Longrightarrow> 0 \<le> inner_prod ?v2 (A *\<^sub>v ?v2)

goal (1 subgoal):
 1. \<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
using dimA
[PROOF STATE]
proof (prove)
using this:
?v2 \<in> carrier_vec n \<Longrightarrow> 0 \<le> inner_prod ?v2 (A *\<^sub>v ?v2)
A \<in> carrier_mat n n

goal (1 subgoal):
 1. \<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)

goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<and> vec_norm v = 1 \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v)) \<Longrightarrow> positive A
[PROOF STEP]
show "positive A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. positive A
[PROOF STEP]
unfolding positive_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat (dim_col A) (dim_col A) \<and> (\<forall>v. dim_vec v = dim_col A \<longrightarrow> 0 \<le> inner_prod v (A *\<^sub>v v))
[PROOF STEP]
by (rule, simp add: A, rule geq)
[PROOF STATE]
proof (state)
this:
positive A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_insert_fset_iff [simp]:
  shows "card_fset (insert_fset x S) = (if x |\<in>| S then card_fset S else Suc (card_fset S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card_fset (insert_fset x S) = (if x |\<in>| S then card_fset S else Suc (card_fset S))
[PROOF STEP]
by (descending) (simp add: insert_absorb)


[STATEMENT]
lemma le_name_code[code]:
  "Name (x # xs) \<le> Name [] \<longleftrightarrow> False"
  "Name [] \<le> Name (x # xs) \<longleftrightarrow> True"
  "Name (x # xs) \<le> Name (y # ys) \<longleftrightarrow> (of_char x::nat) < of_char y \<or> x = y \<and> Name xs \<le> Name ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Name (x # xs) \<le> Name []) = False &&& (Name [] \<le> Name (x # xs)) = True &&& (Name (x # xs) \<le> Name (y # ys)) = (of_char x < of_char y \<or> x = y \<and> Name xs \<le> Name ys)
[PROOF STEP]
unfolding less_eq_name_def less_name_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((as_string (Name (x # xs)), as_string (Name [])) \<in> lexord {(u, v). of_char u < of_char v} \<or> Name (x # xs) = Name []) = False &&& ((as_string (Name []), as_string (Name (x # xs))) \<in> lexord {(u, v). of_char u < of_char v} \<or> Name [] = Name (x # xs)) = True &&& ((as_string (Name (x # xs)), as_string (Name (y # ys))) \<in> lexord {(u, v). of_char u < of_char v} \<or> Name (x # xs) = Name (y # ys)) = (of_char x < of_char y \<or> x = y \<and> ((as_string (Name xs), as_string (Name ys)) \<in> lexord {(u, v). of_char u < of_char v} \<or> Name xs = Name ys))
[PROOF STEP]
by auto