src/HOL/Analysis/Cartesian_Euclidean_Space.thy
 changeset 68833 fde093888c16 parent 68077 ee8c13ae81e9 child 69064 5840724b1d71
```     1.1 --- a/src/HOL/Analysis/Cartesian_Euclidean_Space.thy	Mon Aug 27 22:58:36 2018 +0200
1.2 +++ b/src/HOL/Analysis/Cartesian_Euclidean_Space.thy	Tue Aug 28 13:28:39 2018 +0100
1.3 @@ -2,19 +2,19 @@
1.4     Some material by Jose DivasÃ³n, Tim Makarios and L C Paulson
1.5  *)
1.6
1.7 -section \<open>Instantiates the finite Cartesian product of Euclidean spaces as a Euclidean space\<close>
1.8 +section%important \<open>Instantiates the finite Cartesian product of Euclidean spaces as a Euclidean space\<close>
1.9
1.10  theory Cartesian_Euclidean_Space
1.11  imports Cartesian_Space Derivative
1.12  begin
1.13
1.14 -lemma subspace_special_hyperplane: "subspace {x. x \$ k = 0}"
1.15 +lemma%unimportant subspace_special_hyperplane: "subspace {x. x \$ k = 0}"
1.17
1.18 -lemma sum_mult_product:
1.19 +lemma%important sum_mult_product:
1.20    "sum h {..<A * B :: nat} = (\<Sum>i\<in>{..<A}. \<Sum>j\<in>{..<B}. h (j + i * B))"
1.21    unfolding sum_nat_group[of h B A, unfolded atLeast0LessThan, symmetric]
1.22 -proof (rule sum.cong, simp, rule sum.reindex_cong)
1.23 +proof%unimportant (rule sum.cong, simp, rule sum.reindex_cong)
1.24    fix i
1.25    show "inj_on (\<lambda>j. j + i * B) {..<B}" by (auto intro!: inj_onI)
1.26    show "{i * B..<i * B + B} = (\<lambda>j. j + i * B) ` {..<B}"
1.27 @@ -25,32 +25,32 @@
1.28    qed simp
1.29  qed simp
1.30
1.31 -lemma interval_cbox_cart: "{a::real^'n..b} = cbox a b"
1.32 +lemma%unimportant interval_cbox_cart: "{a::real^'n..b} = cbox a b"
1.33    by (auto simp add: less_eq_vec_def mem_box Basis_vec_def inner_axis)
1.34
1.35 -lemma differentiable_vec:
1.36 +lemma%unimportant differentiable_vec:
1.37    fixes S :: "'a::euclidean_space set"
1.38    shows "vec differentiable_on S"
1.39    by (simp add: linear_linear bounded_linear_imp_differentiable_on)
1.40
1.41 -lemma continuous_vec [continuous_intros]:
1.42 +lemma%unimportant continuous_vec [continuous_intros]:
1.43    fixes x :: "'a::euclidean_space"
1.44    shows "isCont vec x"
1.45    apply (clarsimp simp add: continuous_def LIM_def dist_vec_def L2_set_def)
1.46    apply (rule_tac x="r / sqrt (real CARD('b))" in exI)
1.47    by (simp add: mult.commute pos_less_divide_eq real_sqrt_mult)
1.48
1.49 -lemma box_vec_eq_empty [simp]:
1.50 +lemma%unimportant box_vec_eq_empty [simp]:
1.51    shows "cbox (vec a) (vec b) = {} \<longleftrightarrow> cbox a b = {}"
1.52          "box (vec a) (vec b) = {} \<longleftrightarrow> box a b = {}"
1.53    by (auto simp: Basis_vec_def mem_box box_eq_empty inner_axis)
1.54
1.55 -subsection\<open>Closures and interiors of halfspaces\<close>
1.56 +subsection%important\<open>Closures and interiors of halfspaces\<close>
1.57
1.58 -lemma interior_halfspace_le [simp]:
1.59 +lemma%important interior_halfspace_le [simp]:
1.60    assumes "a \<noteq> 0"
1.61      shows "interior {x. a \<bullet> x \<le> b} = {x. a \<bullet> x < b}"
1.62 -proof -
1.63 +proof%unimportant -
1.64    have *: "a \<bullet> x < b" if x: "x \<in> S" and S: "S \<subseteq> {x. a \<bullet> x \<le> b}" and "open S" for S x
1.65    proof -
1.66      obtain e where "e>0" and e: "cball x e \<subseteq> S"
1.67 @@ -70,15 +70,15 @@
1.68      by (rule interior_unique) (auto simp: open_halfspace_lt *)
1.69  qed
1.70
1.71 -lemma interior_halfspace_ge [simp]:
1.72 +lemma%unimportant interior_halfspace_ge [simp]:
1.73     "a \<noteq> 0 \<Longrightarrow> interior {x. a \<bullet> x \<ge> b} = {x. a \<bullet> x > b}"
1.74  using interior_halfspace_le [of "-a" "-b"] by simp
1.75
1.76 -lemma interior_halfspace_component_le [simp]:
1.77 +lemma%important interior_halfspace_component_le [simp]:
1.78       "interior {x. x\$k \<le> a} = {x :: (real^'n). x\$k < a}" (is "?LE")
1.79    and interior_halfspace_component_ge [simp]:
1.80       "interior {x. x\$k \<ge> a} = {x :: (real^'n). x\$k > a}" (is "?GE")
1.81 -proof -
1.82 +proof%unimportant -
1.83    have "axis k (1::real) \<noteq> 0"
1.84      by (simp add: axis_def vec_eq_iff)
1.85    moreover have "axis k (1::real) \<bullet> x = x\$k" for x
1.86 @@ -88,7 +88,7 @@
1.87            interior_halfspace_ge [of "axis k (1::real)" a] by auto
1.88  qed
1.89
1.90 -lemma closure_halfspace_lt [simp]:
1.91 +lemma%unimportant closure_halfspace_lt [simp]:
1.92    assumes "a \<noteq> 0"
1.93      shows "closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}"
1.94  proof -
1.95 @@ -99,15 +99,15 @@
1.96      by (force simp: closure_interior)
1.97  qed
1.98
1.99 -lemma closure_halfspace_gt [simp]:
1.100 +lemma%unimportant closure_halfspace_gt [simp]:
1.101     "a \<noteq> 0 \<Longrightarrow> closure {x. a \<bullet> x > b} = {x. a \<bullet> x \<ge> b}"
1.102  using closure_halfspace_lt [of "-a" "-b"] by simp
1.103
1.104 -lemma closure_halfspace_component_lt [simp]:
1.105 +lemma%important closure_halfspace_component_lt [simp]:
1.106       "closure {x. x\$k < a} = {x :: (real^'n). x\$k \<le> a}" (is "?LE")
1.107    and closure_halfspace_component_gt [simp]:
1.108       "closure {x. x\$k > a} = {x :: (real^'n). x\$k \<ge> a}" (is "?GE")
1.109 -proof -
1.110 +proof%unimportant -
1.111    have "axis k (1::real) \<noteq> 0"
1.112      by (simp add: axis_def vec_eq_iff)
1.113    moreover have "axis k (1::real) \<bullet> x = x\$k" for x
1.114 @@ -117,17 +117,17 @@
1.115            closure_halfspace_gt [of "axis k (1::real)" a] by auto
1.116  qed
1.117
1.118 -lemma interior_hyperplane [simp]:
1.119 +lemma%unimportant interior_hyperplane [simp]:
1.120    assumes "a \<noteq> 0"
1.121      shows "interior {x. a \<bullet> x = b} = {}"
1.122 -proof -
1.123 +proof%unimportant -
1.124    have [simp]: "{x. a \<bullet> x = b} = {x. a \<bullet> x \<le> b} \<inter> {x. a \<bullet> x \<ge> b}"
1.125      by (force simp:)
1.126    then show ?thesis
1.127      by (auto simp: assms)
1.128  qed
1.129
1.130 -lemma frontier_halfspace_le:
1.131 +lemma%unimportant frontier_halfspace_le:
1.132    assumes "a \<noteq> 0 \<or> b \<noteq> 0"
1.133      shows "frontier {x. a \<bullet> x \<le> b} = {x. a \<bullet> x = b}"
1.134  proof (cases "a = 0")
1.135 @@ -137,7 +137,7 @@
1.136      by (force simp: frontier_def closed_halfspace_le)
1.137  qed
1.138
1.139 -lemma frontier_halfspace_ge:
1.140 +lemma%unimportant frontier_halfspace_ge:
1.141    assumes "a \<noteq> 0 \<or> b \<noteq> 0"
1.142      shows "frontier {x. a \<bullet> x \<ge> b} = {x. a \<bullet> x = b}"
1.143  proof (cases "a = 0")
1.144 @@ -147,7 +147,7 @@
1.145      by (force simp: frontier_def closed_halfspace_ge)
1.146  qed
1.147
1.148 -lemma frontier_halfspace_lt:
1.149 +lemma%unimportant frontier_halfspace_lt:
1.150    assumes "a \<noteq> 0 \<or> b \<noteq> 0"
1.151      shows "frontier {x. a \<bullet> x < b} = {x. a \<bullet> x = b}"
1.152  proof (cases "a = 0")
1.153 @@ -157,19 +157,19 @@
1.154      by (force simp: frontier_def interior_open open_halfspace_lt)
1.155  qed
1.156
1.157 -lemma frontier_halfspace_gt:
1.158 +lemma%important frontier_halfspace_gt:
1.159    assumes "a \<noteq> 0 \<or> b \<noteq> 0"
1.160      shows "frontier {x. a \<bullet> x > b} = {x. a \<bullet> x = b}"
1.161 -proof (cases "a = 0")
1.162 +proof%unimportant (cases "a = 0")
1.163    case True with assms show ?thesis by simp
1.164  next
1.165    case False then show ?thesis
1.166      by (force simp: frontier_def interior_open open_halfspace_gt)
1.167  qed
1.168
1.169 -lemma interior_standard_hyperplane:
1.170 +lemma%important interior_standard_hyperplane:
1.171     "interior {x :: (real^'n). x\$k = a} = {}"
1.172 -proof -
1.173 +proof%unimportant -
1.174    have "axis k (1::real) \<noteq> 0"
1.175      by (simp add: axis_def vec_eq_iff)
1.176    moreover have "axis k (1::real) \<bullet> x = x\$k" for x
1.177 @@ -179,20 +179,20 @@
1.178      by force
1.179  qed
1.180
1.181 -lemma matrix_mult_transpose_dot_column:
1.182 +lemma%unimportant matrix_mult_transpose_dot_column:
1.183    shows "transpose A ** A = (\<chi> i j. inner (column i A) (column j A))"
1.184    by (simp add: matrix_matrix_mult_def vec_eq_iff transpose_def column_def inner_vec_def)
1.185
1.186 -lemma matrix_mult_transpose_dot_row:
1.187 +lemma%unimportant matrix_mult_transpose_dot_row:
1.188    shows "A ** transpose A = (\<chi> i j. inner (row i A) (row j A))"
1.189    by (simp add: matrix_matrix_mult_def vec_eq_iff transpose_def row_def inner_vec_def)
1.190
1.191  text\<open>Two sometimes fruitful ways of looking at matrix-vector multiplication.\<close>
1.192
1.193 -lemma matrix_mult_dot: "A *v x = (\<chi> i. inner (A\$i) x)"
1.194 +lemma%important matrix_mult_dot: "A *v x = (\<chi> i. inner (A\$i) x)"
1.195    by (simp add: matrix_vector_mult_def inner_vec_def)
1.196
1.197 -lemma adjoint_matrix: "adjoint(\<lambda>x. (A::real^'n^'m) *v x) = (\<lambda>x. transpose A *v x)"
1.198 +lemma%unimportant adjoint_matrix: "adjoint(\<lambda>x. (A::real^'n^'m) *v x) = (\<lambda>x. transpose A *v x)"
1.200    apply (simp add: transpose_def inner_vec_def matrix_vector_mult_def
1.201      sum_distrib_right sum_distrib_left)
1.202 @@ -200,9 +200,9 @@
1.204    done
1.205
1.206 -lemma matrix_adjoint: assumes lf: "linear (f :: real^'n \<Rightarrow> real ^'m)"
1.207 +lemma%important matrix_adjoint: assumes lf: "linear (f :: real^'n \<Rightarrow> real ^'m)"
1.208    shows "matrix(adjoint f) = transpose(matrix f)"
1.209 -proof -
1.210 +proof%unimportant -
1.213    also have "\<dots> = transpose(matrix f)"
1.214 @@ -212,17 +212,17 @@
1.215    finally show ?thesis .
1.216  qed
1.217
1.218 -lemma matrix_vector_mul_bounded_linear[intro, simp]: "bounded_linear (( *v) A)" for A :: "'a::{euclidean_space,real_algebra_1}^'n^'m"
1.219 +lemma%unimportant matrix_vector_mul_bounded_linear[intro, simp]: "bounded_linear (( *v) A)" for A :: "'a::{euclidean_space,real_algebra_1}^'n^'m"
1.220    using matrix_vector_mul_linear[of A]
1.221    by (simp add: linear_conv_bounded_linear linear_matrix_vector_mul_eq)
1.222
1.223 -lemma
1.224 +lemma%unimportant (* FIX ME needs name*)
1.225    fixes A :: "'a::{euclidean_space,real_algebra_1}^'n^'m"
1.226    shows matrix_vector_mult_linear_continuous_at [continuous_intros]: "isCont (( *v) A) z"
1.227      and matrix_vector_mult_linear_continuous_on [continuous_intros]: "continuous_on S (( *v) A)"
1.228    by (simp_all add: linear_continuous_at linear_continuous_on)
1.229
1.230 -lemma scalar_invertible:
1.231 +lemma%unimportant scalar_invertible:
1.232    fixes A :: "('a::real_algebra_1)^'m^'n"
1.233    assumes "k \<noteq> 0" and "invertible A"
1.234    shows "invertible (k *\<^sub>R A)"
1.235 @@ -236,50 +236,50 @@
1.236      unfolding invertible_def by auto
1.237  qed
1.238
1.239 -lemma scalar_invertible_iff:
1.240 +lemma%unimportant scalar_invertible_iff:
1.241    fixes A :: "('a::real_algebra_1)^'m^'n"
1.242    assumes "k \<noteq> 0" and "invertible A"
1.243    shows "invertible (k *\<^sub>R A) \<longleftrightarrow> k \<noteq> 0 \<and> invertible A"
1.244    by (simp add: assms scalar_invertible)
1.245
1.246 -lemma vector_transpose_matrix [simp]: "x v* transpose A = A *v x"
1.247 +lemma%unimportant vector_transpose_matrix [simp]: "x v* transpose A = A *v x"
1.248    unfolding transpose_def vector_matrix_mult_def matrix_vector_mult_def
1.249    by simp
1.250
1.251 -lemma transpose_matrix_vector [simp]: "transpose A *v x = x v* A"
1.252 +lemma%unimportant transpose_matrix_vector [simp]: "transpose A *v x = x v* A"
1.253    unfolding transpose_def vector_matrix_mult_def matrix_vector_mult_def
1.254    by simp
1.255
1.256 -lemma vector_scalar_commute:
1.257 +lemma%unimportant vector_scalar_commute:
1.258    fixes A :: "'a::{field}^'m^'n"
1.259    shows "A *v (c *s x) = c *s (A *v x)"
1.260    by (simp add: vector_scalar_mult_def matrix_vector_mult_def mult_ac sum_distrib_left)
1.261
1.262 -lemma scalar_vector_matrix_assoc:
1.263 +lemma%unimportant scalar_vector_matrix_assoc:
1.264    fixes k :: "'a::{field}" and x :: "'a::{field}^'n" and A :: "'a^'m^'n"
1.265    shows "(k *s x) v* A = k *s (x v* A)"
1.266    by (metis transpose_matrix_vector vector_scalar_commute)
1.267
1.268 -lemma vector_matrix_mult_0 [simp]: "0 v* A = 0"
1.269 +lemma%unimportant vector_matrix_mult_0 [simp]: "0 v* A = 0"
1.270    unfolding vector_matrix_mult_def by (simp add: zero_vec_def)
1.271
1.272 -lemma vector_matrix_mult_0_right [simp]: "x v* 0 = 0"
1.273 +lemma%unimportant vector_matrix_mult_0_right [simp]: "x v* 0 = 0"
1.274    unfolding vector_matrix_mult_def by (simp add: zero_vec_def)
1.275
1.276 -lemma vector_matrix_mul_rid [simp]:
1.277 +lemma%unimportant vector_matrix_mul_rid [simp]:
1.278    fixes v :: "('a::semiring_1)^'n"
1.279    shows "v v* mat 1 = v"
1.280    by (metis matrix_vector_mul_lid transpose_mat vector_transpose_matrix)
1.281
1.282 -lemma scaleR_vector_matrix_assoc:
1.283 +lemma%unimportant scaleR_vector_matrix_assoc:
1.284    fixes k :: real and x :: "real^'n" and A :: "real^'m^'n"
1.285    shows "(k *\<^sub>R x) v* A = k *\<^sub>R (x v* A)"
1.286    by (metis matrix_vector_mult_scaleR transpose_matrix_vector)
1.287
1.288 -lemma vector_scaleR_matrix_ac:
1.289 +lemma%important vector_scaleR_matrix_ac:
1.290    fixes k :: real and x :: "real^'n" and A :: "real^'m^'n"
1.291    shows "x v* (k *\<^sub>R A) = k *\<^sub>R (x v* A)"
1.292 -proof -
1.293 +proof%unimportant -
1.294    have "x v* (k *\<^sub>R A) = (k *\<^sub>R x) v* A"
1.295      unfolding vector_matrix_mult_def
1.297 @@ -289,12 +289,12 @@
1.298  qed
1.299
1.300
1.301 -subsection\<open>Some bounds on components etc. relative to operator norm\<close>
1.302 +subsection%important\<open>Some bounds on components etc. relative to operator norm\<close>
1.303
1.304 -lemma norm_column_le_onorm:
1.305 +lemma%important norm_column_le_onorm:
1.306    fixes A :: "real^'n^'m"
1.307    shows "norm(column i A) \<le> onorm(( *v) A)"
1.308 -proof -
1.309 +proof%unimportant -
1.310    have "norm (\<chi> j. A \$ j \$ i) \<le> norm (A *v axis i 1)"
1.311      by (simp add: matrix_mult_dot cart_eq_inner_axis)
1.312    also have "\<dots> \<le> onorm (( *v) A)"
1.313 @@ -304,10 +304,10 @@
1.314      unfolding column_def .
1.315  qed
1.316
1.317 -lemma matrix_component_le_onorm:
1.318 +lemma%important matrix_component_le_onorm:
1.319    fixes A :: "real^'n^'m"
1.320    shows "\<bar>A \$ i \$ j\<bar> \<le> onorm(( *v) A)"
1.321 -proof -
1.322 +proof%unimportant -
1.323    have "\<bar>A \$ i \$ j\<bar> \<le> norm (\<chi> n. (A \$ n \$ j))"
1.324      by (metis (full_types, lifting) component_le_norm_cart vec_lambda_beta)
1.325    also have "\<dots> \<le> onorm (( *v) A)"
1.326 @@ -315,15 +315,15 @@
1.327    finally show ?thesis .
1.328  qed
1.329
1.330 -lemma component_le_onorm:
1.331 +lemma%unimportant component_le_onorm:
1.332    fixes f :: "real^'m \<Rightarrow> real^'n"
1.333    shows "linear f \<Longrightarrow> \<bar>matrix f \$ i \$ j\<bar> \<le> onorm f"
1.334    by (metis linear_matrix_vector_mul_eq matrix_component_le_onorm matrix_vector_mul)
1.335
1.336 -lemma onorm_le_matrix_component_sum:
1.337 +lemma%important onorm_le_matrix_component_sum:
1.338    fixes A :: "real^'n^'m"
1.339    shows "onorm(( *v) A) \<le> (\<Sum>i\<in>UNIV. \<Sum>j\<in>UNIV. \<bar>A \$ i \$ j\<bar>)"
1.340 -proof (rule onorm_le)
1.341 +proof%unimportant (rule onorm_le)
1.342    fix x
1.343    have "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) \$ i\<bar>)"
1.344      by (rule norm_le_l1_cart)
1.345 @@ -342,11 +342,11 @@
1.347  qed
1.348
1.349 -lemma onorm_le_matrix_component:
1.350 +lemma%important onorm_le_matrix_component:
1.351    fixes A :: "real^'n^'m"
1.352    assumes "\<And>i j. abs(A\$i\$j) \<le> B"
1.353    shows "onorm(( *v) A) \<le> real (CARD('m)) * real (CARD('n)) * B"
1.354 -proof (rule onorm_le)
1.355 +proof%unimportant (rule onorm_le)
1.356    fix x :: "real^'n::_"
1.357    have "norm (A *v x) \<le> (\<Sum>i\<in>UNIV. \<bar>(A *v x) \$ i\<bar>)"
1.358      by (rule norm_le_l1_cart)
1.359 @@ -366,11 +366,11 @@
1.360    finally show "norm (A *v x) \<le> CARD('m) * real (CARD('n)) * B * norm x" .
1.361  qed
1.362
1.363 -subsection \<open>lambda skolemization on cartesian products\<close>
1.364 +subsection%important \<open>lambda skolemization on cartesian products\<close>
1.365
1.366 -lemma lambda_skolem: "(\<forall>i. \<exists>x. P i x) \<longleftrightarrow>
1.367 +lemma%important lambda_skolem: "(\<forall>i. \<exists>x. P i x) \<longleftrightarrow>
1.368     (\<exists>x::'a ^ 'n. \<forall>i. P i (x \$ i))" (is "?lhs \<longleftrightarrow> ?rhs")
1.369 -proof -
1.370 +proof%unimportant -
1.371    let ?S = "(UNIV :: 'n set)"
1.372    { assume H: "?rhs"
1.373      then have ?lhs by auto }
1.374 @@ -387,16 +387,16 @@
1.375    ultimately show ?thesis by metis
1.376  qed
1.377
1.378 -lemma rational_approximation:
1.379 +lemma%unimportant rational_approximation:
1.380    assumes "e > 0"
1.381    obtains r::real where "r \<in> \<rat>" "\<bar>r - x\<bar> < e"
1.382    using Rats_dense_in_real [of "x - e/2" "x + e/2"] assms by auto
1.383
1.384 -lemma matrix_rational_approximation:
1.385 +lemma%important matrix_rational_approximation:
1.386    fixes A :: "real^'n^'m"
1.387    assumes "e > 0"
1.388    obtains B where "\<And>i j. B\$i\$j \<in> \<rat>" "onorm(\<lambda>x. (A - B) *v x) < e"
1.389 -proof -
1.390 +proof%unimportant -
1.391    have "\<forall>i j. \<exists>q \<in> \<rat>. \<bar>q - A \$ i \$ j\<bar> < e / (2 * CARD('m) * CARD('n))"
1.392      using assms by (force intro: rational_approximation [of "e / (2 * CARD('m) * CARD('n))"])
1.393    then obtain B where B: "\<And>i j. B\$i\$j \<in> \<rat>" and Bclo: "\<And>i j. \<bar>B\$i\$j - A \$ i \$ j\<bar> < e / (2 * CARD('m) * CARD('n))"
1.394 @@ -413,7 +413,7 @@
1.395    qed (use B in auto)
1.396  qed
1.397
1.398 -lemma vector_sub_project_orthogonal_cart: "(b::real^'n) \<bullet> (x - ((b \<bullet> x) / (b \<bullet> b)) *s b) = 0"
1.399 +lemma%unimportant vector_sub_project_orthogonal_cart: "(b::real^'n) \<bullet> (x - ((b \<bullet> x) / (b \<bullet> b)) *s b) = 0"
1.400    unfolding inner_simps scalar_mult_eq_scaleR by auto
1.401
1.402
1.403 @@ -422,51 +422,51 @@
1.404
1.405  text \<open>Considering an n-element vector as an n-by-1 or 1-by-n matrix.\<close>
1.406
1.407 -definition "rowvector v = (\<chi> i j. (v\$j))"
1.408 +definition%unimportant "rowvector v = (\<chi> i j. (v\$j))"
1.409
1.410 -definition "columnvector v = (\<chi> i j. (v\$i))"
1.411 +definition%unimportant "columnvector v = (\<chi> i j. (v\$i))"
1.412
1.413 -lemma transpose_columnvector: "transpose(columnvector v) = rowvector v"
1.414 +lemma%unimportant transpose_columnvector: "transpose(columnvector v) = rowvector v"
1.415    by (simp add: transpose_def rowvector_def columnvector_def vec_eq_iff)
1.416
1.417 -lemma transpose_rowvector: "transpose(rowvector v) = columnvector v"
1.418 +lemma%unimportant transpose_rowvector: "transpose(rowvector v) = columnvector v"
1.419    by (simp add: transpose_def columnvector_def rowvector_def vec_eq_iff)
1.420
1.421 -lemma dot_rowvector_columnvector: "columnvector (A *v v) = A ** columnvector v"
1.422 +lemma%unimportant dot_rowvector_columnvector: "columnvector (A *v v) = A ** columnvector v"
1.423    by (vector columnvector_def matrix_matrix_mult_def matrix_vector_mult_def)
1.424
1.425 -lemma dot_matrix_product:
1.426 +lemma%unimportant dot_matrix_product:
1.427    "(x::real^'n) \<bullet> y = (((rowvector x ::real^'n^1) ** (columnvector y :: real^1^'n))\$1)\$1"
1.428    by (vector matrix_matrix_mult_def rowvector_def columnvector_def inner_vec_def)
1.429
1.430 -lemma dot_matrix_vector_mul:
1.431 +lemma%unimportant dot_matrix_vector_mul:
1.432    fixes A B :: "real ^'n ^'n" and x y :: "real ^'n"
1.433    shows "(A *v x) \<bullet> (B *v y) =
1.434        (((rowvector x :: real^'n^1) ** ((transpose A ** B) ** (columnvector y :: real ^1^'n)))\$1)\$1"
1.435    unfolding dot_matrix_product transpose_columnvector[symmetric]
1.436      dot_rowvector_columnvector matrix_transpose_mul matrix_mul_assoc ..
1.437
1.438 -lemma infnorm_cart:"infnorm (x::real^'n) = Sup {\<bar>x\$i\<bar> |i. i\<in>UNIV}"
1.439 +lemma%unimportant infnorm_cart:"infnorm (x::real^'n) = Sup {\<bar>x\$i\<bar> |i. i\<in>UNIV}"
1.440    by (simp add: infnorm_def inner_axis Basis_vec_def) (metis (lifting) inner_axis real_inner_1_right)
1.441
1.442 -lemma component_le_infnorm_cart: "\<bar>x\$i\<bar> \<le> infnorm (x::real^'n)"
1.443 +lemma%unimportant component_le_infnorm_cart: "\<bar>x\$i\<bar> \<le> infnorm (x::real^'n)"
1.444    using Basis_le_infnorm[of "axis i 1" x]
1.445    by (simp add: Basis_vec_def axis_eq_axis inner_axis)
1.446
1.447 -lemma continuous_component[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. f x \$ i)"
1.448 +lemma%unimportant continuous_component[continuous_intros]: "continuous F f \<Longrightarrow> continuous F (\<lambda>x. f x \$ i)"
1.449    unfolding continuous_def by (rule tendsto_vec_nth)
1.450
1.451 -lemma continuous_on_component[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. f x \$ i)"
1.452 +lemma%unimportant continuous_on_component[continuous_intros]: "continuous_on s f \<Longrightarrow> continuous_on s (\<lambda>x. f x \$ i)"
1.453    unfolding continuous_on_def by (fast intro: tendsto_vec_nth)
1.454
1.455 -lemma continuous_on_vec_lambda[continuous_intros]:
1.456 +lemma%unimportant continuous_on_vec_lambda[continuous_intros]:
1.457    "(\<And>i. continuous_on S (f i)) \<Longrightarrow> continuous_on S (\<lambda>x. \<chi> i. f i x)"
1.458    unfolding continuous_on_def by (auto intro: tendsto_vec_lambda)
1.459
1.460 -lemma closed_positive_orthant: "closed {x::real^'n. \<forall>i. 0 \<le>x\$i}"
1.461 +lemma%unimportant closed_positive_orthant: "closed {x::real^'n. \<forall>i. 0 \<le>x\$i}"
1.462    by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_const continuous_on_id continuous_on_component)
1.463
1.464 -lemma bounded_component_cart: "bounded s \<Longrightarrow> bounded ((\<lambda>x. x \$ i) ` s)"
1.465 +lemma%unimportant bounded_component_cart: "bounded s \<Longrightarrow> bounded ((\<lambda>x. x \$ i) ` s)"
1.466    unfolding bounded_def
1.467    apply clarify
1.468    apply (rule_tac x="x \$ i" in exI)
1.469 @@ -475,13 +475,13 @@
1.470    apply (rule order_trans [OF dist_vec_nth_le], simp)
1.471    done
1.472
1.473 -lemma compact_lemma_cart:
1.474 +lemma%important compact_lemma_cart:
1.475    fixes f :: "nat \<Rightarrow> 'a::heine_borel ^ 'n"
1.476    assumes f: "bounded (range f)"
1.477    shows "\<exists>l r. strict_mono r \<and>
1.478          (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) \$ i) (l \$ i) < e) sequentially)"
1.479      (is "?th d")
1.480 -proof -
1.481 +proof%unimportant -
1.482    have "\<forall>d' \<subseteq> d. ?th d'"
1.483      by (rule compact_lemma_general[where unproj=vec_lambda])
1.484        (auto intro!: f bounded_component_cart simp: vec_lambda_eta)
1.485 @@ -517,19 +517,19 @@
1.486    with r show "\<exists>l r. strict_mono r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially" by auto
1.487  qed
1.488
1.489 -lemma interval_cart:
1.490 +lemma%unimportant interval_cart:
1.491    fixes a :: "real^'n"
1.492    shows "box a b = {x::real^'n. \<forall>i. a\$i < x\$i \<and> x\$i < b\$i}"
1.493      and "cbox a b = {x::real^'n. \<forall>i. a\$i \<le> x\$i \<and> x\$i \<le> b\$i}"
1.494    by (auto simp add: set_eq_iff less_vec_def less_eq_vec_def mem_box Basis_vec_def inner_axis)
1.495
1.496 -lemma mem_box_cart:
1.497 +lemma%unimportant mem_box_cart:
1.498    fixes a :: "real^'n"
1.499    shows "x \<in> box a b \<longleftrightarrow> (\<forall>i. a\$i < x\$i \<and> x\$i < b\$i)"
1.500      and "x \<in> cbox a b \<longleftrightarrow> (\<forall>i. a\$i \<le> x\$i \<and> x\$i \<le> b\$i)"
1.501    using interval_cart[of a b] by (auto simp add: set_eq_iff less_vec_def less_eq_vec_def)
1.502
1.503 -lemma interval_eq_empty_cart:
1.504 +lemma%unimportant interval_eq_empty_cart:
1.505    fixes a :: "real^'n"
1.506    shows "(box a b = {} \<longleftrightarrow> (\<exists>i. b\$i \<le> a\$i))" (is ?th1)
1.507      and "(cbox a b = {} \<longleftrightarrow> (\<exists>i. b\$i < a\$i))" (is ?th2)
1.508 @@ -565,14 +565,14 @@
1.509    ultimately show ?th2 by blast
1.510  qed
1.511
1.512 -lemma interval_ne_empty_cart:
1.513 +lemma%unimportant interval_ne_empty_cart:
1.514    fixes a :: "real^'n"
1.515    shows "cbox a b \<noteq> {} \<longleftrightarrow> (\<forall>i. a\$i \<le> b\$i)"
1.516      and "box a b \<noteq> {} \<longleftrightarrow> (\<forall>i. a\$i < b\$i)"
1.517    unfolding interval_eq_empty_cart[of a b] by (auto simp add: not_less not_le)
1.518      (* BH: Why doesn't just "auto" work here? *)
1.519
1.520 -lemma subset_interval_imp_cart:
1.521 +lemma%unimportant subset_interval_imp_cart:
1.522    fixes a :: "real^'n"
1.523    shows "(\<forall>i. a\$i \<le> c\$i \<and> d\$i \<le> b\$i) \<Longrightarrow> cbox c d \<subseteq> cbox a b"
1.524      and "(\<forall>i. a\$i < c\$i \<and> d\$i < b\$i) \<Longrightarrow> cbox c d \<subseteq> box a b"
1.525 @@ -581,13 +581,13 @@
1.526    unfolding subset_eq[unfolded Ball_def] unfolding mem_box_cart
1.527    by (auto intro: order_trans less_le_trans le_less_trans less_imp_le) (* BH: Why doesn't just "auto" work here? *)
1.528
1.529 -lemma interval_sing:
1.530 +lemma%unimportant interval_sing:
1.531    fixes a :: "'a::linorder^'n"
1.532    shows "{a .. a} = {a} \<and> {a<..<a} = {}"
1.533    apply (auto simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff)
1.534    done
1.535
1.536 -lemma subset_interval_cart:
1.537 +lemma%unimportant subset_interval_cart:
1.538    fixes a :: "real^'n"
1.539    shows "cbox c d \<subseteq> cbox a b \<longleftrightarrow> (\<forall>i. c\$i \<le> d\$i) --> (\<forall>i. a\$i \<le> c\$i \<and> d\$i \<le> b\$i)" (is ?th1)
1.540      and "cbox c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i. c\$i \<le> d\$i) --> (\<forall>i. a\$i < c\$i \<and> d\$i < b\$i)" (is ?th2)
1.541 @@ -595,7 +595,7 @@
1.542      and "box c d \<subseteq> box a b \<longleftrightarrow> (\<forall>i. c\$i < d\$i) --> (\<forall>i. a\$i \<le> c\$i \<and> d\$i \<le> b\$i)" (is ?th4)
1.543    using subset_box[of c d a b] by (simp_all add: Basis_vec_def inner_axis)
1.544
1.545 -lemma disjoint_interval_cart:
1.546 +lemma%unimportant disjoint_interval_cart:
1.547    fixes a::"real^'n"
1.548    shows "cbox a b \<inter> cbox c d = {} \<longleftrightarrow> (\<exists>i. (b\$i < a\$i \<or> d\$i < c\$i \<or> b\$i < c\$i \<or> d\$i < a\$i))" (is ?th1)
1.549      and "cbox a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b\$i < a\$i \<or> d\$i \<le> c\$i \<or> b\$i \<le> c\$i \<or> d\$i \<le> a\$i))" (is ?th2)
1.550 @@ -603,53 +603,53 @@
1.551      and "box a b \<inter> box c d = {} \<longleftrightarrow> (\<exists>i. (b\$i \<le> a\$i \<or> d\$i \<le> c\$i \<or> b\$i \<le> c\$i \<or> d\$i \<le> a\$i))" (is ?th4)
1.552    using disjoint_interval[of a b c d] by (simp_all add: Basis_vec_def inner_axis)
1.553
1.554 -lemma Int_interval_cart:
1.555 +lemma%unimportant Int_interval_cart:
1.556    fixes a :: "real^'n"
1.557    shows "cbox a b \<inter> cbox c d =  {(\<chi> i. max (a\$i) (c\$i)) .. (\<chi> i. min (b\$i) (d\$i))}"
1.558    unfolding Int_interval
1.559    by (auto simp: mem_box less_eq_vec_def)
1.560      (auto simp: Basis_vec_def inner_axis)
1.561
1.562 -lemma closed_interval_left_cart:
1.563 +lemma%unimportant closed_interval_left_cart:
1.564    fixes b :: "real^'n"
1.565    shows "closed {x::real^'n. \<forall>i. x\$i \<le> b\$i}"
1.566    by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_const continuous_on_id continuous_on_component)
1.567
1.568 -lemma closed_interval_right_cart:
1.569 +lemma%unimportant closed_interval_right_cart:
1.570    fixes a::"real^'n"
1.571    shows "closed {x::real^'n. \<forall>i. a\$i \<le> x\$i}"
1.572    by (simp add: Collect_all_eq closed_INT closed_Collect_le continuous_on_const continuous_on_id continuous_on_component)
1.573
1.574 -lemma is_interval_cart:
1.575 +lemma%unimportant is_interval_cart:
1.576    "is_interval (s::(real^'n) set) \<longleftrightarrow>
1.577      (\<forall>a\<in>s. \<forall>b\<in>s. \<forall>x. (\<forall>i. ((a\$i \<le> x\$i \<and> x\$i \<le> b\$i) \<or> (b\$i \<le> x\$i \<and> x\$i \<le> a\$i))) \<longrightarrow> x \<in> s)"
1.578    by (simp add: is_interval_def Ball_def Basis_vec_def inner_axis imp_ex)
1.579
1.580 -lemma closed_halfspace_component_le_cart: "closed {x::real^'n. x\$i \<le> a}"
1.581 +lemma%unimportant closed_halfspace_component_le_cart: "closed {x::real^'n. x\$i \<le> a}"
1.582    by (simp add: closed_Collect_le continuous_on_const continuous_on_id continuous_on_component)
1.583
1.584 -lemma closed_halfspace_component_ge_cart: "closed {x::real^'n. x\$i \<ge> a}"
1.585 +lemma%unimportant closed_halfspace_component_ge_cart: "closed {x::real^'n. x\$i \<ge> a}"
1.586    by (simp add: closed_Collect_le continuous_on_const continuous_on_id continuous_on_component)
1.587
1.588 -lemma open_halfspace_component_lt_cart: "open {x::real^'n. x\$i < a}"
1.589 +lemma%unimportant open_halfspace_component_lt_cart: "open {x::real^'n. x\$i < a}"
1.590    by (simp add: open_Collect_less continuous_on_const continuous_on_id continuous_on_component)
1.591
1.592 -lemma open_halfspace_component_gt_cart: "open {x::real^'n. x\$i  > a}"
1.593 +lemma%unimportant open_halfspace_component_gt_cart: "open {x::real^'n. x\$i  > a}"
1.594    by (simp add: open_Collect_less continuous_on_const continuous_on_id continuous_on_component)
1.595
1.596 -lemma Lim_component_le_cart:
1.597 +lemma%unimportant Lim_component_le_cart:
1.598    fixes f :: "'a \<Rightarrow> real^'n"
1.599    assumes "(f \<longlongrightarrow> l) net" "\<not> (trivial_limit net)"  "eventually (\<lambda>x. f x \$i \<le> b) net"
1.600    shows "l\$i \<le> b"
1.601    by (rule tendsto_le[OF assms(2) tendsto_const tendsto_vec_nth, OF assms(1, 3)])
1.602
1.603 -lemma Lim_component_ge_cart:
1.604 +lemma%unimportant Lim_component_ge_cart:
1.605    fixes f :: "'a \<Rightarrow> real^'n"
1.606    assumes "(f \<longlongrightarrow> l) net"  "\<not> (trivial_limit net)"  "eventually (\<lambda>x. b \<le> (f x)\$i) net"
1.607    shows "b \<le> l\$i"
1.608    by (rule tendsto_le[OF assms(2) tendsto_vec_nth tendsto_const, OF assms(1, 3)])
1.609
1.610 -lemma Lim_component_eq_cart:
1.611 +lemma%unimportant Lim_component_eq_cart:
1.612    fixes f :: "'a \<Rightarrow> real^'n"
1.613    assumes net: "(f \<longlongrightarrow> l) net" "~(trivial_limit net)" and ev:"eventually (\<lambda>x. f(x)\$i = b) net"
1.614    shows "l\$i = b"
1.615 @@ -657,18 +657,18 @@
1.616      Lim_component_ge_cart[OF net, of b i] and
1.617      Lim_component_le_cart[OF net, of i b] by auto
1.618
1.619 -lemma connected_ivt_component_cart:
1.620 +lemma%unimportant connected_ivt_component_cart:
1.621    fixes x :: "real^'n"
1.622    shows "connected s \<Longrightarrow> x \<in> s \<Longrightarrow> y \<in> s \<Longrightarrow> x\$k \<le> a \<Longrightarrow> a \<le> y\$k \<Longrightarrow> (\<exists>z\<in>s.  z\$k = a)"
1.623    using connected_ivt_hyperplane[of s x y "axis k 1" a]
1.624    by (auto simp add: inner_axis inner_commute)
1.625
1.626 -lemma subspace_substandard_cart: "vec.subspace {x. (\<forall>i. P i \<longrightarrow> x\$i = 0)}"
1.627 +lemma%unimportant subspace_substandard_cart: "vec.subspace {x. (\<forall>i. P i \<longrightarrow> x\$i = 0)}"
1.628    unfolding vec.subspace_def by auto
1.629
1.630 -lemma closed_substandard_cart:
1.631 +lemma%important closed_substandard_cart:
1.632    "closed {x::'a::real_normed_vector ^ 'n. \<forall>i. P i \<longrightarrow> x\$i = 0}"
1.633 -proof -
1.634 +proof%unimportant -
1.635    { fix i::'n
1.636      have "closed {x::'a ^ 'n. P i \<longrightarrow> x\$i = 0}"
1.637        by (cases "P i") (simp_all add: closed_Collect_eq continuous_on_const continuous_on_id continuous_on_component) }
1.638 @@ -676,9 +676,9 @@
1.639      unfolding Collect_all_eq by (simp add: closed_INT)
1.640  qed
1.641
1.642 -lemma dim_substandard_cart: "vec.dim {x::'a::field^'n. \<forall>i. i \<notin> d \<longrightarrow> x\$i = 0} = card d"
1.643 +lemma%important dim_substandard_cart: "vec.dim {x::'a::field^'n. \<forall>i. i \<notin> d \<longrightarrow> x\$i = 0} = card d"
1.644    (is "vec.dim ?A = _")
1.645 -proof (rule vec.dim_unique)
1.646 +proof%unimportant (rule vec.dim_unique)
1.647    let ?B = "((\<lambda>x. axis x 1) ` d)"
1.648    have subset_basis: "?B \<subseteq> cart_basis"
1.649      by (auto simp: cart_basis_def)
1.650 @@ -703,27 +703,27 @@
1.651    then show "?A \<subseteq> vec.span ?B" by auto
1.652  qed (simp add: card_image inj_on_def axis_eq_axis)
1.653
1.654 -lemma dim_subset_UNIV_cart_gen:
1.655 +lemma%unimportant dim_subset_UNIV_cart_gen:
1.656    fixes S :: "('a::field^'n) set"
1.657    shows "vec.dim S \<le> CARD('n)"
1.658    by (metis vec.dim_eq_full vec.dim_subset_UNIV vec.span_UNIV vec_dim_card)
1.659
1.660 -lemma dim_subset_UNIV_cart:
1.661 +lemma%unimportant dim_subset_UNIV_cart:
1.662    fixes S :: "(real^'n) set"
1.663    shows "dim S \<le> CARD('n)"
1.664    using dim_subset_UNIV_cart_gen[of S] by (simp add: dim_vec_eq)
1.665
1.666 -lemma affinity_inverses:
1.667 +lemma%unimportant affinity_inverses:
1.668    assumes m0: "m \<noteq> (0::'a::field)"
1.669    shows "(\<lambda>x. m *s x + c) \<circ> (\<lambda>x. inverse(m) *s x + (-(inverse(m) *s c))) = id"
1.670    "(\<lambda>x. inverse(m) *s x + (-(inverse(m) *s c))) \<circ> (\<lambda>x. m *s x + c) = id"
1.671    using m0
1.673
1.674 -lemma vector_affinity_eq:
1.675 +lemma%important vector_affinity_eq:
1.676    assumes m0: "(m::'a::field) \<noteq> 0"
1.677    shows "m *s x + c = y \<longleftrightarrow> x = inverse m *s y + -(inverse m *s c)"
1.678 -proof
1.679 +proof%unimportant
1.680    assume h: "m *s x + c = y"
1.681    hence "m *s x = y - c" by (simp add: field_simps)
1.682    hence "inverse m *s (m *s x) = inverse m *s (y - c)" by simp
1.683 @@ -735,48 +735,48 @@
1.684      using m0 by (simp add: vector_smult_assoc vector_ssub_ldistrib)
1.685  qed
1.686
1.687 -lemma vector_eq_affinity:
1.688 +lemma%unimportant vector_eq_affinity:
1.689      "(m::'a::field) \<noteq> 0 ==> (y = m *s x + c \<longleftrightarrow> inverse(m) *s y + -(inverse(m) *s c) = x)"
1.690    using vector_affinity_eq[where m=m and x=x and y=y and c=c]
1.691    by metis
1.692
1.693 -lemma vector_cart:
1.694 +lemma%unimportant vector_cart:
1.695    fixes f :: "real^'n \<Rightarrow> real"
1.696    shows "(\<chi> i. f (axis i 1)) = (\<Sum>i\<in>Basis. f i *\<^sub>R i)"
1.697    unfolding euclidean_eq_iff[where 'a="real^'n"]
1.698    by simp (simp add: Basis_vec_def inner_axis)
1.699
1.700 -lemma const_vector_cart:"((\<chi> i. d)::real^'n) = (\<Sum>i\<in>Basis. d *\<^sub>R i)"
1.701 +lemma%unimportant const_vector_cart:"((\<chi> i. d)::real^'n) = (\<Sum>i\<in>Basis. d *\<^sub>R i)"
1.702    by (rule vector_cart)
1.703
1.704 -subsection "Convex Euclidean Space"
1.705 +subsection%important "Convex Euclidean Space"
1.706
1.707 -lemma Cart_1:"(1::real^'n) = \<Sum>Basis"
1.708 +lemma%unimportant Cart_1:"(1::real^'n) = \<Sum>Basis"
1.709    using const_vector_cart[of 1] by (simp add: one_vec_def)
1.710
1.711  declare vector_add_ldistrib[simp] vector_ssub_ldistrib[simp] vector_smult_assoc[simp] vector_smult_rneg[simp]
1.713
1.714 -lemmas vector_component_simps = vector_minus_component vector_smult_component vector_add_component less_eq_vec_def vec_lambda_beta vector_uminus_component
1.715 +lemmas%unimportant vector_component_simps = vector_minus_component vector_smult_component vector_add_component less_eq_vec_def vec_lambda_beta vector_uminus_component
1.716
1.717 -lemma convex_box_cart:
1.718 +lemma%unimportant convex_box_cart:
1.719    assumes "\<And>i. convex {x. P i x}"
1.720    shows "convex {x. \<forall>i. P i (x\$i)}"
1.721    using assms unfolding convex_def by auto
1.722
1.723 -lemma convex_positive_orthant_cart: "convex {x::real^'n. (\<forall>i. 0 \<le> x\$i)}"
1.724 +lemma%unimportant convex_positive_orthant_cart: "convex {x::real^'n. (\<forall>i. 0 \<le> x\$i)}"
1.725    by (rule convex_box_cart) (simp add: atLeast_def[symmetric])
1.726
1.727 -lemma unit_interval_convex_hull_cart:
1.728 +lemma%unimportant unit_interval_convex_hull_cart:
1.729    "cbox (0::real^'n) 1 = convex hull {x. \<forall>i. (x\$i = 0) \<or> (x\$i = 1)}"
1.730    unfolding Cart_1 unit_interval_convex_hull[where 'a="real^'n"] box_real[symmetric]
1.731    by (rule arg_cong[where f="\<lambda>x. convex hull x"]) (simp add: Basis_vec_def inner_axis)
1.732
1.733 -lemma cube_convex_hull_cart:
1.734 +lemma%important cube_convex_hull_cart:
1.735    assumes "0 < d"
1.736    obtains s::"(real^'n) set"
1.737      where "finite s" "cbox (x - (\<chi> i. d)) (x + (\<chi> i. d)) = convex hull s"
1.738 -proof -
1.739 +proof%unimportant -
1.740    from assms obtain s where "finite s"
1.741      and "cbox (x - sum (( *\<^sub>R) d) Basis) (x + sum (( *\<^sub>R) d) Basis) = convex hull s"
1.742      by (rule cube_convex_hull)
1.743 @@ -785,14 +785,14 @@
1.744  qed
1.745
1.746
1.747 -subsection "Derivative"
1.748 +subsection%important "Derivative"
1.749
1.750 -definition "jacobian f net = matrix(frechet_derivative f net)"
1.751 +definition%important "jacobian f net = matrix(frechet_derivative f net)"
1.752
1.753 -lemma jacobian_works:
1.754 +lemma%important jacobian_works:
1.755    "(f::(real^'a) \<Rightarrow> (real^'b)) differentiable net \<longleftrightarrow>
1.756      (f has_derivative (\<lambda>h. (jacobian f net) *v h)) net" (is "?lhs = ?rhs")
1.757 -proof
1.758 +proof%unimportant
1.759    assume ?lhs then show ?rhs
1.760      by (simp add: frechet_derivative_works has_derivative_linear jacobian_def)
1.761  next
1.762 @@ -801,10 +801,10 @@
1.763  qed
1.764
1.765
1.766 -subsection \<open>Component of the differential must be zero if it exists at a local
1.767 +subsection%important \<open>Component of the differential must be zero if it exists at a local
1.768    maximum or minimum for that corresponding component\<close>
1.769
1.770 -lemma differential_zero_maxmin_cart:
1.771 +lemma%important differential_zero_maxmin_cart:
1.772    fixes f::"real^'a \<Rightarrow> real^'b"
1.773    assumes "0 < e" "((\<forall>y \<in> ball x e. (f y)\$k \<le> (f x)\$k) \<or> (\<forall>y\<in>ball x e. (f x)\$k \<le> (f y)\$k))"
1.774      "f differentiable (at x)"
1.775 @@ -813,7 +813,7 @@
1.776      vector_cart[of "\<lambda>j. frechet_derivative f (at x) j \$ k"]
1.777    by (simp add: Basis_vec_def axis_eq_axis inner_axis jacobian_def matrix_def)
1.778
1.779 -subsection \<open>Lemmas for working on @{typ "real^1"}\<close>
1.780 +subsection%unimportant \<open>Lemmas for working on @{typ "real^1"}\<close>
1.781
1.782  lemma forall_1[simp]: "(\<forall>i::1. P i) \<longleftrightarrow> P 1"
1.783    by (metis (full_types) num1_eq_iff)
1.784 @@ -893,7 +893,7 @@
1.785  instance num1 :: wellorder
1.786    by intro_classes (auto simp: less_eq_num1_def less_num1_def)
1.787
1.788 -subsection\<open>The collapse of the general concepts to dimension one\<close>
1.789 +subsection%unimportant\<open>The collapse of the general concepts to dimension one\<close>
1.790
1.791  lemma vector_one: "(x::'a ^1) = (\<chi> i. (x\$1))"
1.793 @@ -918,11 +918,11 @@
1.794  lemma dist_real: "dist(x::real ^ 1) y = \<bar>(x\$1) - (y\$1)\<bar>"
1.795    by (auto simp add: norm_real dist_norm)
1.796
1.797 -subsection\<open> Rank of a matrix\<close>
1.798 +subsection%important\<open> Rank of a matrix\<close>
1.799
1.800  text\<open>Equivalence of row and column rank is taken from George Mackiw's paper, Mathematics Magazine 1995, p. 285.\<close>
1.801
1.802 -lemma matrix_vector_mult_in_columnspace_gen:
1.803 +lemma%unimportant matrix_vector_mult_in_columnspace_gen:
1.804    fixes A :: "'a::field^'n^'m"
1.805    shows "(A *v x) \<in> vec.span(columns A)"
1.806    apply (simp add: matrix_vector_column columns_def transpose_def column_def)
1.807 @@ -930,17 +930,17 @@
1.808    apply (force intro: vec.span_base)
1.809    done
1.810
1.811 -lemma matrix_vector_mult_in_columnspace:
1.812 +lemma%unimportant matrix_vector_mult_in_columnspace:
1.813    fixes A :: "real^'n^'m"
1.814    shows "(A *v x) \<in> span(columns A)"
1.815    using matrix_vector_mult_in_columnspace_gen[of A x] by (simp add: span_vec_eq)
1.816
1.817 -lemma orthogonal_nullspace_rowspace:
1.818 +lemma%important orthogonal_nullspace_rowspace:
1.819    fixes A :: "real^'n^'m"
1.820    assumes 0: "A *v x = 0" and y: "y \<in> span(rows A)"
1.821    shows "orthogonal x y"
1.822    using y
1.823 -proof (induction rule: span_induct)
1.824 +proof%unimportant (induction rule: span_induct)
1.825    case base
1.826    then show ?case
1.828 @@ -953,28 +953,28 @@
1.829      by (simp add: mult.commute) (metis (no_types) vec_lambda_beta zero_index)
1.830  qed
1.831
1.832 -lemma nullspace_inter_rowspace:
1.833 +lemma%unimportant nullspace_inter_rowspace:
1.834    fixes A :: "real^'n^'m"
1.835    shows "A *v x = 0 \<and> x \<in> span(rows A) \<longleftrightarrow> x = 0"
1.836    using orthogonal_nullspace_rowspace orthogonal_self span_zero matrix_vector_mult_0_right
1.837    by blast
1.838
1.839 -lemma matrix_vector_mul_injective_on_rowspace:
1.840 +lemma%unimportant matrix_vector_mul_injective_on_rowspace:
1.841    fixes A :: "real^'n^'m"
1.842    shows "\<lbrakk>A *v x = A *v y; x \<in> span(rows A); y \<in> span(rows A)\<rbrakk> \<Longrightarrow> x = y"
1.843    using nullspace_inter_rowspace [of A "x-y"]
1.844    by (metis diff_eq_diff_eq diff_self matrix_vector_mult_diff_distrib span_diff)
1.845
1.846 -definition rank :: "'a::field^'n^'m=>nat"
1.847 +definition%important rank :: "'a::field^'n^'m=>nat"
1.848    where row_rank_def_gen: "rank A \<equiv> vec.dim(rows A)"
1.849
1.850 -lemma row_rank_def: "rank A = dim (rows A)" for A::"real^'n^'m"
1.851 -  by (auto simp: row_rank_def_gen dim_vec_eq)
1.852 +lemma%important row_rank_def: "rank A = dim (rows A)" for A::"real^'n^'m"
1.853 +  by%unimportant (auto simp: row_rank_def_gen dim_vec_eq)
1.854
1.855 -lemma dim_rows_le_dim_columns:
1.856 +lemma%important dim_rows_le_dim_columns:
1.857    fixes A :: "real^'n^'m"
1.858    shows "dim(rows A) \<le> dim(columns A)"
1.859 -proof -
1.860 +proof%unimportant -
1.861    have "dim (span (rows A)) \<le> dim (span (columns A))"
1.862    proof -
1.863      obtain B where "independent B" "span(rows A) \<subseteq> span B"
1.864 @@ -999,32 +999,32 @@
1.866  qed
1.867
1.868 -lemma column_rank_def:
1.869 +lemma%unimportant column_rank_def:
1.870    fixes A :: "real^'n^'m"
1.871    shows "rank A = dim(columns A)"
1.872    unfolding row_rank_def
1.873    by (metis columns_transpose dim_rows_le_dim_columns le_antisym rows_transpose)
1.874
1.875 -lemma rank_transpose:
1.876 +lemma%unimportant rank_transpose:
1.877    fixes A :: "real^'n^'m"
1.878    shows "rank(transpose A) = rank A"
1.879    by (metis column_rank_def row_rank_def rows_transpose)
1.880
1.881 -lemma matrix_vector_mult_basis:
1.882 +lemma%unimportant matrix_vector_mult_basis:
1.883    fixes A :: "real^'n^'m"
1.884    shows "A *v (axis k 1) = column k A"
1.885    by (simp add: cart_eq_inner_axis column_def matrix_mult_dot)
1.886
1.887 -lemma columns_image_basis:
1.888 +lemma%unimportant columns_image_basis:
1.889    fixes A :: "real^'n^'m"
1.890    shows "columns A = ( *v) A ` (range (\<lambda>i. axis i 1))"
1.891    by (force simp: columns_def matrix_vector_mult_basis [symmetric])
1.892
1.893 -lemma rank_dim_range:
1.894 +lemma%important rank_dim_range:
1.895    fixes A :: "real^'n^'m"
1.896    shows "rank A = dim(range (\<lambda>x. A *v x))"
1.897    unfolding column_rank_def
1.898 -proof (rule span_eq_dim)
1.899 +proof%unimportant (rule span_eq_dim)
1.900    have "span (columns A) \<subseteq> span (range (( *v) A))" (is "?l \<subseteq> ?r")
1.901      by (simp add: columns_image_basis image_subsetI span_mono)
1.902    then show "?l = ?r"
1.903 @@ -1032,45 +1032,45 @@
1.904          span_eq span_span)
1.905  qed
1.906
1.907 -lemma rank_bound:
1.908 +lemma%unimportant rank_bound:
1.909    fixes A :: "real^'n^'m"
1.910    shows "rank A \<le> min CARD('m) (CARD('n))"
1.911    by (metis (mono_tags, lifting) dim_subset_UNIV_cart min.bounded_iff
1.912        column_rank_def row_rank_def)
1.913
1.914 -lemma full_rank_injective:
1.915 +lemma%unimportant full_rank_injective:
1.916    fixes A :: "real^'n^'m"
1.917    shows "rank A = CARD('n) \<longleftrightarrow> inj (( *v) A)"
1.918    by (simp add: matrix_left_invertible_injective [symmetric] matrix_left_invertible_span_rows row_rank_def
1.919        dim_eq_full [symmetric] card_cart_basis vec.dimension_def)
1.920
1.921 -lemma full_rank_surjective:
1.922 +lemma%unimportant full_rank_surjective:
1.923    fixes A :: "real^'n^'m"
1.924    shows "rank A = CARD('m) \<longleftrightarrow> surj (( *v) A)"
1.925    by (simp add: matrix_right_invertible_surjective [symmetric] left_invertible_transpose [symmetric]
1.926                  matrix_left_invertible_injective full_rank_injective [symmetric] rank_transpose)
1.927
1.928 -lemma rank_I: "rank(mat 1::real^'n^'n) = CARD('n)"
1.929 +lemma%unimportant rank_I: "rank(mat 1::real^'n^'n) = CARD('n)"
1.930    by (simp add: full_rank_injective inj_on_def)
1.931
1.932 -lemma less_rank_noninjective:
1.933 +lemma%unimportant less_rank_noninjective:
1.934    fixes A :: "real^'n^'m"
1.935    shows "rank A < CARD('n) \<longleftrightarrow> \<not> inj (( *v) A)"
1.936  using less_le rank_bound by (auto simp: full_rank_injective [symmetric])
1.937
1.938 -lemma matrix_nonfull_linear_equations_eq:
1.939 +lemma%unimportant matrix_nonfull_linear_equations_eq:
1.940    fixes A :: "real^'n^'m"
1.941    shows "(\<exists>x. (x \<noteq> 0) \<and> A *v x = 0) \<longleftrightarrow> ~(rank A = CARD('n))"
1.942    by (meson matrix_left_invertible_injective full_rank_injective matrix_left_invertible_ker)
1.943
1.944 -lemma rank_eq_0: "rank A = 0 \<longleftrightarrow> A = 0" and rank_0 [simp]: "rank (0::real^'n^'m) = 0"
1.945 +lemma%unimportant rank_eq_0: "rank A = 0 \<longleftrightarrow> A = 0" and rank_0 [simp]: "rank (0::real^'n^'m) = 0"
1.946    for A :: "real^'n^'m"
1.947    by (auto simp: rank_dim_range matrix_eq)
1.948
1.949 -lemma rank_mul_le_right:
1.950 +lemma%important rank_mul_le_right:
1.951    fixes A :: "real^'n^'m" and B :: "real^'p^'n"
1.952    shows "rank(A ** B) \<le> rank B"
1.953 -proof -
1.954 +proof%unimportant -
1.955    have "rank(A ** B) \<le> dim (( *v) A ` range (( *v) B))"
1.956      by (auto simp: rank_dim_range image_comp o_def matrix_vector_mul_assoc)
1.957    also have "\<dots> \<le> rank B"
1.958 @@ -1078,12 +1078,12 @@
1.959    finally show ?thesis .
1.960  qed
1.961
1.962 -lemma rank_mul_le_left:
1.963 +lemma%unimportant rank_mul_le_left:
1.964    fixes A :: "real^'n^'m" and B :: "real^'p^'n"
1.965    shows "rank(A ** B) \<le> rank A"
1.966    by (metis matrix_transpose_mul rank_mul_le_right rank_transpose)
1.967
1.968 -subsection\<open>Routine results connecting the types @{typ "real^1"} and @{typ real}\<close>
1.969 +subsection%unimportant\<open>Routine results connecting the types @{typ "real^1"} and @{typ real}\<close>
1.970
1.971  lemma vector_one_nth [simp]:
1.972    fixes x :: "'a^1" shows "vec (x \$ 1) = x"
1.973 @@ -1146,7 +1146,7 @@
1.974      done
1.975
1.976
1.977 -subsection\<open>Explicit vector construction from lists\<close>
1.978 +subsection%unimportant\<open>Explicit vector construction from lists\<close>
1.979
1.980  definition "vector l = (\<chi> i. foldr (\<lambda>x f n. fun_upd (f (n+1)) n x) l (\<lambda>n x. 0) 1 i)"
1.981
```