more uniform naming scheme for finite cartesian product type and related theorems
authorhuffman
Wed Aug 10 13:13:37 2011 -0700 (2011-08-10)
changeset 44136e63ad7d5158d
parent 44135 18b4ab6854f1
child 44137 ac5cb4c86448
more uniform naming scheme for finite cartesian product type and related theorems
NEWS
src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy
src/HOL/Multivariate_Analysis/Fashoda.thy
src/HOL/Multivariate_Analysis/Finite_Cartesian_Product.thy
     1.1 --- a/NEWS	Wed Aug 10 10:13:16 2011 -0700
     1.2 +++ b/NEWS	Wed Aug 10 13:13:37 2011 -0700
     1.3 @@ -183,6 +183,19 @@
     1.4  * Limits.thy: Type "'a net" has been renamed to "'a filter", in
     1.5  accordance with standard mathematical terminology. INCOMPATIBILITY.
     1.6  
     1.7 +* Session Multivariate_Analysis: Type "('a, 'b) cart" has been renamed
     1.8 +to "('a, 'b) vec" (the syntax "'a ^ 'b" remains unaffected). Constants
     1.9 +"Cart_nth" and "Cart_lambda" have been respectively renamed to
    1.10 +"vec_nth" and "vec_lambda"; theorems mentioning those names have
    1.11 +changed to match. Definition theorems for overloaded constants now use
    1.12 +the standard "foo_vec_def" naming scheme. A few other theorems have
    1.13 +been renamed as follows (INCOMPATIBILITY):
    1.14 +
    1.15 +  Cart_eq          ~> vec_eq_iff
    1.16 +  dist_nth_le_cart ~> dist_vec_nth_le
    1.17 +  tendsto_vector   ~> vec_tendstoI
    1.18 +  Cauchy_vector    ~> vec_CauchyI
    1.19 +
    1.20  
    1.21  *** Document preparation ***
    1.22  
     2.1 --- a/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy	Wed Aug 10 10:13:16 2011 -0700
     2.2 +++ b/src/HOL/Multivariate_Analysis/Cartesian_Euclidean_Space.thy	Wed Aug 10 13:13:37 2011 -0700
     2.3 @@ -36,24 +36,23 @@
     2.4  
     2.5  subsection{* Basic componentwise operations on vectors. *}
     2.6  
     2.7 -instantiation cart :: (times,finite) times
     2.8 +instantiation vec :: (times, finite) times
     2.9  begin
    2.10 -  definition vector_mult_def : "op * \<equiv> (\<lambda> x y.  (\<chi> i. (x$i) * (y$i)))"
    2.11 +  definition "op * \<equiv> (\<lambda> x y.  (\<chi> i. (x$i) * (y$i)))"
    2.12    instance ..
    2.13  end
    2.14  
    2.15 -instantiation cart :: (one,finite) one
    2.16 +instantiation vec :: (one, finite) one
    2.17  begin
    2.18 -  definition vector_one_def : "1 \<equiv> (\<chi> i. 1)"
    2.19 +  definition "1 \<equiv> (\<chi> i. 1)"
    2.20    instance ..
    2.21  end
    2.22  
    2.23 -instantiation cart :: (ord,finite) ord
    2.24 +instantiation vec :: (ord, finite) ord
    2.25  begin
    2.26 -  definition vector_le_def:
    2.27 -    "less_eq (x :: 'a ^'b) y = (ALL i. x$i <= y$i)"
    2.28 -  definition vector_less_def: "less (x :: 'a ^'b) y = (ALL i. x$i < y$i)"
    2.29 -  instance by (intro_classes)
    2.30 +  definition "x \<le> y \<longleftrightarrow> (\<forall>i. x$i \<le> y$i)"
    2.31 +  definition "x < y \<longleftrightarrow> (\<forall>i. x$i < y$i)"
    2.32 +  instance ..
    2.33  end
    2.34  
    2.35  text{* The ordering on one-dimensional vectors is linear. *}
    2.36 @@ -65,12 +64,12 @@
    2.37        by (auto intro!: card_ge_0_finite) qed
    2.38  end
    2.39  
    2.40 -instantiation cart :: (linorder,cart_one) linorder begin
    2.41 +instantiation vec :: (linorder,cart_one) linorder begin
    2.42  instance proof
    2.43    guess a B using UNIV_one[where 'a='b] unfolding card_Suc_eq apply- by(erule exE)+
    2.44    hence *:"UNIV = {a}" by auto
    2.45    have "\<And>P. (\<forall>i\<in>UNIV. P i) \<longleftrightarrow> P a" unfolding * by auto hence all:"\<And>P. (\<forall>i. P i) \<longleftrightarrow> P a" by auto
    2.46 -  fix x y z::"'a^'b::cart_one" note * = vector_le_def vector_less_def all Cart_eq
    2.47 +  fix x y z::"'a^'b::cart_one" note * = less_eq_vec_def less_vec_def all vec_eq_iff
    2.48    show "x\<le>x" "(x < y) = (x \<le> y \<and> \<not> y \<le> x)" "x\<le>y \<or> y\<le>x" unfolding * by(auto simp only:field_simps)
    2.49    { assume "x\<le>y" "y\<le>z" thus "x\<le>z" unfolding * by(auto simp only:field_simps) }
    2.50    { assume "x\<le>y" "y\<le>x" thus "x=y" unfolding * by(auto simp only:field_simps) }
    2.51 @@ -93,16 +92,16 @@
    2.52    @{thm setsum_subtractf} RS sym, @{thm setsum_right_distrib},
    2.53    @{thm setsum_left_distrib}, @{thm setsum_negf} RS sym]
    2.54    val ss2 = @{simpset} addsimps
    2.55 -             [@{thm vector_add_def}, @{thm vector_mult_def},
    2.56 -              @{thm vector_minus_def}, @{thm vector_uminus_def},
    2.57 -              @{thm vector_one_def}, @{thm vector_zero_def}, @{thm vec_def},
    2.58 -              @{thm vector_scaleR_def},
    2.59 -              @{thm Cart_lambda_beta}, @{thm vector_scalar_mult_def}]
    2.60 +             [@{thm plus_vec_def}, @{thm times_vec_def},
    2.61 +              @{thm minus_vec_def}, @{thm uminus_vec_def},
    2.62 +              @{thm one_vec_def}, @{thm zero_vec_def}, @{thm vec_def},
    2.63 +              @{thm scaleR_vec_def},
    2.64 +              @{thm vec_lambda_beta}, @{thm vector_scalar_mult_def}]
    2.65   fun vector_arith_tac ths =
    2.66     simp_tac ss1
    2.67     THEN' (fn i => rtac @{thm setsum_cong2} i
    2.68           ORELSE rtac @{thm setsum_0'} i
    2.69 -         ORELSE simp_tac (HOL_basic_ss addsimps [@{thm "Cart_eq"}]) i)
    2.70 +         ORELSE simp_tac (HOL_basic_ss addsimps [@{thm vec_eq_iff}]) i)
    2.71     (* THEN' TRY o clarify_tac HOL_cs  THEN' (TRY o rtac @{thm iffI}) *)
    2.72     THEN' asm_full_simp_tac (ss2 addsimps ths)
    2.73   in
    2.74 @@ -110,8 +109,8 @@
    2.75   end
    2.76  *} "lift trivial vector statements to real arith statements"
    2.77  
    2.78 -lemma vec_0[simp]: "vec 0 = 0" by (vector vector_zero_def)
    2.79 -lemma vec_1[simp]: "vec 1 = 1" by (vector vector_one_def)
    2.80 +lemma vec_0[simp]: "vec 0 = 0" by (vector zero_vec_def)
    2.81 +lemma vec_1[simp]: "vec 1 = 1" by (vector one_vec_def)
    2.82  
    2.83  lemma vec_inj[simp]: "vec x = vec y \<longleftrightarrow> x = y" by vector
    2.84  
    2.85 @@ -149,49 +148,47 @@
    2.86  
    2.87  subsection {* Some frequently useful arithmetic lemmas over vectors. *}
    2.88  
    2.89 -instance cart :: (semigroup_mult,finite) semigroup_mult
    2.90 -  apply (intro_classes) by (vector mult_assoc)
    2.91 +instance vec :: (semigroup_mult, finite) semigroup_mult
    2.92 +  by default (vector mult_assoc)
    2.93  
    2.94 -instance cart :: (monoid_mult,finite) monoid_mult
    2.95 -  apply (intro_classes) by vector+
    2.96 +instance vec :: (monoid_mult, finite) monoid_mult
    2.97 +  by default vector+
    2.98  
    2.99 -instance cart :: (ab_semigroup_mult,finite) ab_semigroup_mult
   2.100 -  apply (intro_classes) by (vector mult_commute)
   2.101 +instance vec :: (ab_semigroup_mult, finite) ab_semigroup_mult
   2.102 +  by default (vector mult_commute)
   2.103  
   2.104 -instance cart :: (ab_semigroup_idem_mult,finite) ab_semigroup_idem_mult
   2.105 -  apply (intro_classes) by (vector mult_idem)
   2.106 +instance vec :: (ab_semigroup_idem_mult, finite) ab_semigroup_idem_mult
   2.107 +  by default (vector mult_idem)
   2.108  
   2.109 -instance cart :: (comm_monoid_mult,finite) comm_monoid_mult
   2.110 -  apply (intro_classes) by vector
   2.111 +instance vec :: (comm_monoid_mult, finite) comm_monoid_mult
   2.112 +  by default vector
   2.113  
   2.114 -instance cart :: (semiring,finite) semiring
   2.115 -  apply (intro_classes) by (vector field_simps)+
   2.116 +instance vec :: (semiring, finite) semiring
   2.117 +  by default (vector field_simps)+
   2.118  
   2.119 -instance cart :: (semiring_0,finite) semiring_0
   2.120 -  apply (intro_classes) by (vector field_simps)+
   2.121 -instance cart :: (semiring_1,finite) semiring_1
   2.122 -  apply (intro_classes) by vector
   2.123 -instance cart :: (comm_semiring,finite) comm_semiring
   2.124 -  apply (intro_classes) by (vector field_simps)+
   2.125 +instance vec :: (semiring_0, finite) semiring_0
   2.126 +  by default (vector field_simps)+
   2.127 +instance vec :: (semiring_1, finite) semiring_1
   2.128 +  by default vector
   2.129 +instance vec :: (comm_semiring, finite) comm_semiring
   2.130 +  by default (vector field_simps)+
   2.131  
   2.132 -instance cart :: (comm_semiring_0,finite) comm_semiring_0 by (intro_classes)
   2.133 -instance cart :: (cancel_comm_monoid_add, finite) cancel_comm_monoid_add ..
   2.134 -instance cart :: (semiring_0_cancel,finite) semiring_0_cancel by (intro_classes)
   2.135 -instance cart :: (comm_semiring_0_cancel,finite) comm_semiring_0_cancel by (intro_classes)
   2.136 -instance cart :: (ring,finite) ring by (intro_classes)
   2.137 -instance cart :: (semiring_1_cancel,finite) semiring_1_cancel by (intro_classes)
   2.138 -instance cart :: (comm_semiring_1,finite) comm_semiring_1 by (intro_classes)
   2.139 +instance vec :: (comm_semiring_0, finite) comm_semiring_0 ..
   2.140 +instance vec :: (cancel_comm_monoid_add, finite) cancel_comm_monoid_add ..
   2.141 +instance vec :: (semiring_0_cancel, finite) semiring_0_cancel ..
   2.142 +instance vec :: (comm_semiring_0_cancel, finite) comm_semiring_0_cancel ..
   2.143 +instance vec :: (ring, finite) ring ..
   2.144 +instance vec :: (semiring_1_cancel, finite) semiring_1_cancel ..
   2.145 +instance vec :: (comm_semiring_1, finite) comm_semiring_1 ..
   2.146  
   2.147 -instance cart :: (ring_1,finite) ring_1 ..
   2.148 +instance vec :: (ring_1, finite) ring_1 ..
   2.149  
   2.150 -instance cart :: (real_algebra,finite) real_algebra
   2.151 +instance vec :: (real_algebra, finite) real_algebra
   2.152    apply intro_classes
   2.153 -  apply (simp_all add: vector_scaleR_def field_simps)
   2.154 -  apply vector
   2.155 -  apply vector
   2.156 +  apply (simp_all add: vec_eq_iff)
   2.157    done
   2.158  
   2.159 -instance cart :: (real_algebra_1,finite) real_algebra_1 ..
   2.160 +instance vec :: (real_algebra_1, finite) real_algebra_1 ..
   2.161  
   2.162  lemma of_nat_index:
   2.163    "(of_nat n :: 'a::semiring_1 ^'n)$i = of_nat n"
   2.164 @@ -203,15 +200,15 @@
   2.165  lemma one_index[simp]:
   2.166    "(1 :: 'a::one ^'n)$i = 1" by vector
   2.167  
   2.168 -instance cart :: (semiring_char_0, finite) semiring_char_0
   2.169 +instance vec :: (semiring_char_0, finite) semiring_char_0
   2.170  proof
   2.171    fix m n :: nat
   2.172    show "inj (of_nat :: nat \<Rightarrow> 'a ^ 'b)"
   2.173 -    by (auto intro!: injI simp add: Cart_eq of_nat_index)
   2.174 +    by (auto intro!: injI simp add: vec_eq_iff of_nat_index)
   2.175  qed
   2.176  
   2.177 -instance cart :: (comm_ring_1,finite) comm_ring_1 ..
   2.178 -instance cart :: (ring_char_0,finite) ring_char_0 ..
   2.179 +instance vec :: (comm_ring_1, finite) comm_ring_1 ..
   2.180 +instance vec :: (ring_char_0, finite) ring_char_0 ..
   2.181  
   2.182  lemma vector_smult_assoc: "a *s (b *s x) = ((a::'a::semigroup_mult) * b) *s x"
   2.183    by (vector mult_assoc)
   2.184 @@ -231,7 +228,7 @@
   2.185    by (vector field_simps)
   2.186  
   2.187  lemma vec_eq[simp]: "(vec m = vec n) \<longleftrightarrow> (m = n)"
   2.188 -  by (simp add: Cart_eq)
   2.189 +  by (simp add: vec_eq_iff)
   2.190  
   2.191  lemma norm_eq_0_imp: "norm x = 0 ==> x = (0::real ^'n)" by (metis norm_eq_zero)
   2.192  lemma vector_mul_eq_0[simp]: "(a *s x = 0) \<longleftrightarrow> a = (0::'a::idom) \<or> x = 0"
   2.193 @@ -246,7 +243,7 @@
   2.194    by (metis vector_mul_rcancel)
   2.195  
   2.196  lemma component_le_norm_cart: "\<bar>x$i\<bar> <= norm x"
   2.197 -  apply (simp add: norm_vector_def)
   2.198 +  apply (simp add: norm_vec_def)
   2.199    apply (rule member_le_setL2, simp_all)
   2.200    done
   2.201  
   2.202 @@ -257,10 +254,10 @@
   2.203    by (metis component_le_norm_cart basic_trans_rules(21))
   2.204  
   2.205  lemma norm_le_l1_cart: "norm x <= setsum(\<lambda>i. \<bar>x$i\<bar>) UNIV"
   2.206 -  by (simp add: norm_vector_def setL2_le_setsum)
   2.207 +  by (simp add: norm_vec_def setL2_le_setsum)
   2.208  
   2.209  lemma scalar_mult_eq_scaleR: "c *s x = c *\<^sub>R x"
   2.210 -  unfolding vector_scaleR_def vector_scalar_mult_def by simp
   2.211 +  unfolding scaleR_vec_def vector_scalar_mult_def by simp
   2.212  
   2.213  lemma dist_mul[simp]: "dist (c *s x) (c *s y) = \<bar>c\<bar> * dist x y"
   2.214    unfolding dist_norm scalar_mult_eq_scaleR
   2.215 @@ -272,12 +269,12 @@
   2.216    by (cases "finite S", induct S set: finite, simp_all)
   2.217  
   2.218  lemma setsum_eq: "setsum f S = (\<chi> i. setsum (\<lambda>x. (f x)$i ) S)"
   2.219 -  by (simp add: Cart_eq)
   2.220 +  by (simp add: vec_eq_iff)
   2.221  
   2.222  lemma setsum_cmul:
   2.223    fixes f:: "'c \<Rightarrow> ('a::semiring_1)^'n"
   2.224    shows "setsum (\<lambda>x. c *s f x) S = c *s setsum f S"
   2.225 -  by (simp add: Cart_eq setsum_right_distrib)
   2.226 +  by (simp add: vec_eq_iff setsum_right_distrib)
   2.227  
   2.228  (* TODO: use setsum_norm_allsubsets_bound *)
   2.229  lemma setsum_norm_allsubsets_bound_cart:
   2.230 @@ -359,10 +356,10 @@
   2.231  lemmas cart_simps = forall_CARD_DIM exists_CARD_DIM forall_CARD exists_CARD
   2.232  
   2.233  lemma cart_euclidean_nth[simp]:
   2.234 -  fixes x :: "('a::euclidean_space, 'b::finite) cart"
   2.235 +  fixes x :: "('a::euclidean_space, 'b::finite) vec"
   2.236    assumes j:"j < DIM('a)"
   2.237    shows "x $$ (j + \<pi>' i * DIM('a)) = x $ i $$ j"
   2.238 -  unfolding euclidean_component_def inner_vector_def basis_eq_pi'[OF j] if_distrib cond_application_beta
   2.239 +  unfolding euclidean_component_def inner_vec_def basis_eq_pi'[OF j] if_distrib cond_application_beta
   2.240    by (simp add: setsum_cases)
   2.241  
   2.242  lemma real_euclidean_nth:
   2.243 @@ -393,13 +390,13 @@
   2.244    thus "x = y \<and> i = j" using * by simp
   2.245  qed simp
   2.246  
   2.247 -instance cart :: (ordered_euclidean_space,finite) ordered_euclidean_space
   2.248 +instance vec :: (ordered_euclidean_space, finite) ordered_euclidean_space
   2.249  proof
   2.250    fix x y::"'a^'b"
   2.251 -  show "(x \<le> y) = (\<forall>i<DIM(('a, 'b) cart). x $$ i \<le> y $$ i)"
   2.252 -    unfolding vector_le_def apply(subst eucl_le) by (simp add: cart_simps)
   2.253 -  show"(x < y) = (\<forall>i<DIM(('a, 'b) cart). x $$ i < y $$ i)"
   2.254 -    unfolding vector_less_def apply(subst eucl_less) by (simp add: cart_simps)
   2.255 +  show "(x \<le> y) = (\<forall>i<DIM(('a, 'b) vec). x $$ i \<le> y $$ i)"
   2.256 +    unfolding less_eq_vec_def apply(subst eucl_le) by (simp add: cart_simps)
   2.257 +  show"(x < y) = (\<forall>i<DIM(('a, 'b) vec). x $$ i < y $$ i)"
   2.258 +    unfolding less_vec_def apply(subst eucl_less) by (simp add: cart_simps)
   2.259  qed
   2.260  
   2.261  subsection{* Basis vectors in coordinate directions. *}
   2.262 @@ -411,7 +408,7 @@
   2.263  
   2.264  lemma norm_basis[simp]:
   2.265    shows "norm (cart_basis k :: real ^'n) = 1"
   2.266 -  apply (simp add: cart_basis_def norm_eq_sqrt_inner) unfolding inner_vector_def
   2.267 +  apply (simp add: cart_basis_def norm_eq_sqrt_inner) unfolding inner_vec_def
   2.268    apply (vector delta_mult_idempotent)
   2.269    using setsum_delta[of "UNIV :: 'n set" "k" "\<lambda>k. 1::real"] by auto
   2.270  
   2.271 @@ -431,14 +428,14 @@
   2.272  qed
   2.273  
   2.274  lemma basis_inj[intro]: "inj (cart_basis :: 'n \<Rightarrow> real ^'n)"
   2.275 -  by (simp add: inj_on_def Cart_eq)
   2.276 +  by (simp add: inj_on_def vec_eq_iff)
   2.277  
   2.278  lemma basis_expansion:
   2.279    "setsum (\<lambda>i. (x$i) *s cart_basis i) UNIV = (x::('a::ring_1) ^'n)" (is "?lhs = ?rhs" is "setsum ?f ?S = _")
   2.280 -  by (auto simp add: Cart_eq if_distrib setsum_delta[of "?S", where ?'b = "'a", simplified] cong del: if_weak_cong)
   2.281 +  by (auto simp add: vec_eq_iff if_distrib setsum_delta[of "?S", where ?'b = "'a", simplified] cong del: if_weak_cong)
   2.282  
   2.283  lemma smult_conv_scaleR: "c *s x = scaleR c x"
   2.284 -  unfolding vector_scalar_mult_def vector_scaleR_def by simp
   2.285 +  unfolding vector_scalar_mult_def scaleR_vec_def by simp
   2.286  
   2.287  lemma basis_expansion':
   2.288    "setsum (\<lambda>i. (x$i) *\<^sub>R cart_basis i) UNIV = x"
   2.289 @@ -446,22 +443,22 @@
   2.290  
   2.291  lemma basis_expansion_unique:
   2.292    "setsum (\<lambda>i. f i *s cart_basis i) UNIV = (x::('a::comm_ring_1) ^'n) \<longleftrightarrow> (\<forall>i. f i = x$i)"
   2.293 -  by (simp add: Cart_eq setsum_delta if_distrib cong del: if_weak_cong)
   2.294 +  by (simp add: vec_eq_iff setsum_delta if_distrib cong del: if_weak_cong)
   2.295  
   2.296  lemma dot_basis:
   2.297    shows "cart_basis i \<bullet> x = x$i" "x \<bullet> (cart_basis i) = (x$i)"
   2.298 -  by (auto simp add: inner_vector_def cart_basis_def cond_application_beta if_distrib setsum_delta
   2.299 +  by (auto simp add: inner_vec_def cart_basis_def cond_application_beta if_distrib setsum_delta
   2.300             cong del: if_weak_cong)
   2.301  
   2.302  lemma inner_basis:
   2.303    fixes x :: "'a::{real_inner, real_algebra_1} ^ 'n"
   2.304    shows "inner (cart_basis i) x = inner 1 (x $ i)"
   2.305      and "inner x (cart_basis i) = inner (x $ i) 1"
   2.306 -  unfolding inner_vector_def cart_basis_def
   2.307 +  unfolding inner_vec_def cart_basis_def
   2.308    by (auto simp add: cond_application_beta if_distrib setsum_delta cong del: if_weak_cong)
   2.309  
   2.310  lemma basis_eq_0: "cart_basis i = (0::'a::semiring_1^'n) \<longleftrightarrow> False"
   2.311 -  by (auto simp add: Cart_eq)
   2.312 +  by (auto simp add: vec_eq_iff)
   2.313  
   2.314  lemma basis_nonzero:
   2.315    shows "cart_basis k \<noteq> (0:: 'a::semiring_1 ^'n)"
   2.316 @@ -469,14 +466,14 @@
   2.317  
   2.318  text {* some lemmas to map between Eucl and Cart *}
   2.319  lemma basis_real_n[simp]:"(basis (\<pi>' i)::real^'a) = cart_basis i"
   2.320 -  unfolding basis_cart_def using pi'_range[where 'n='a]
   2.321 -  by (auto simp: Cart_eq Cart_lambda_beta)
   2.322 +  unfolding basis_vec_def using pi'_range[where 'n='a]
   2.323 +  by (auto simp: vec_eq_iff)
   2.324  
   2.325  subsection {* Orthogonality on cartesian products *}
   2.326  
   2.327  lemma orthogonal_basis:
   2.328    shows "orthogonal (cart_basis i) x \<longleftrightarrow> x$i = (0::real)"
   2.329 -  by (auto simp add: orthogonal_def inner_vector_def cart_basis_def if_distrib
   2.330 +  by (auto simp add: orthogonal_def inner_vec_def cart_basis_def if_distrib
   2.331                       cond_application_beta setsum_delta cong del: if_weak_cong)
   2.332  
   2.333  lemma orthogonal_basis_basis:
   2.334 @@ -518,7 +515,7 @@
   2.335          by (simp add: linear_cmul[OF lf])
   2.336        finally have "f x \<bullet> y = x \<bullet> ?w"
   2.337          apply (simp only: )
   2.338 -        apply (simp add: inner_vector_def setsum_left_distrib setsum_right_distrib setsum_commute[of _ ?M ?N] field_simps)
   2.339 +        apply (simp add: inner_vec_def setsum_left_distrib setsum_right_distrib setsum_commute[of _ ?M ?N] field_simps)
   2.340          done}
   2.341    }
   2.342    then show ?thesis unfolding adjoint_def
   2.343 @@ -612,25 +609,25 @@
   2.344      setsum_delta' cong del: if_weak_cong)
   2.345  
   2.346  lemma matrix_transpose_mul: "transpose(A ** B) = transpose B ** transpose (A::'a::comm_semiring_1^_^_)"
   2.347 -  by (simp add: matrix_matrix_mult_def transpose_def Cart_eq mult_commute)
   2.348 +  by (simp add: matrix_matrix_mult_def transpose_def vec_eq_iff mult_commute)
   2.349  
   2.350  lemma matrix_eq:
   2.351    fixes A B :: "'a::semiring_1 ^ 'n ^ 'm"
   2.352    shows "A = B \<longleftrightarrow>  (\<forall>x. A *v x = B *v x)" (is "?lhs \<longleftrightarrow> ?rhs")
   2.353    apply auto
   2.354 -  apply (subst Cart_eq)
   2.355 +  apply (subst vec_eq_iff)
   2.356    apply clarify
   2.357 -  apply (clarsimp simp add: matrix_vector_mult_def cart_basis_def if_distrib cond_application_beta Cart_eq cong del: if_weak_cong)
   2.358 +  apply (clarsimp simp add: matrix_vector_mult_def cart_basis_def if_distrib cond_application_beta vec_eq_iff cong del: if_weak_cong)
   2.359    apply (erule_tac x="cart_basis ia" in allE)
   2.360    apply (erule_tac x="i" in allE)
   2.361    by (auto simp add: cart_basis_def if_distrib cond_application_beta setsum_delta[OF finite] cong del: if_weak_cong)
   2.362  
   2.363  lemma matrix_vector_mul_component:
   2.364    shows "((A::real^_^_) *v x)$k = (A$k) \<bullet> x"
   2.365 -  by (simp add: matrix_vector_mult_def inner_vector_def)
   2.366 +  by (simp add: matrix_vector_mult_def inner_vec_def)
   2.367  
   2.368  lemma dot_lmul_matrix: "((x::real ^_) v* A) \<bullet> y = x \<bullet> (A *v y)"
   2.369 -  apply (simp add: inner_vector_def matrix_vector_mult_def vector_matrix_mult_def setsum_left_distrib setsum_right_distrib mult_ac)
   2.370 +  apply (simp add: inner_vec_def matrix_vector_mult_def vector_matrix_mult_def setsum_left_distrib setsum_right_distrib mult_ac)
   2.371    apply (subst setsum_commute)
   2.372    by simp
   2.373  
   2.374 @@ -643,12 +640,12 @@
   2.375  lemma row_transpose:
   2.376    fixes A:: "'a::semiring_1^_^_"
   2.377    shows "row i (transpose A) = column i A"
   2.378 -  by (simp add: row_def column_def transpose_def Cart_eq)
   2.379 +  by (simp add: row_def column_def transpose_def vec_eq_iff)
   2.380  
   2.381  lemma column_transpose:
   2.382    fixes A:: "'a::semiring_1^_^_"
   2.383    shows "column i (transpose A) = row i A"
   2.384 -  by (simp add: row_def column_def transpose_def Cart_eq)
   2.385 +  by (simp add: row_def column_def transpose_def vec_eq_iff)
   2.386  
   2.387  lemma rows_transpose: "rows(transpose (A::'a::semiring_1^_^_)) = columns A"
   2.388  by (auto simp add: rows_def columns_def row_transpose intro: set_eqI)
   2.389 @@ -658,15 +655,15 @@
   2.390  text{* Two sometimes fruitful ways of looking at matrix-vector multiplication. *}
   2.391  
   2.392  lemma matrix_mult_dot: "A *v x = (\<chi> i. A$i \<bullet> x)"
   2.393 -  by (simp add: matrix_vector_mult_def inner_vector_def)
   2.394 +  by (simp add: matrix_vector_mult_def inner_vec_def)
   2.395  
   2.396  lemma matrix_mult_vsum: "(A::'a::comm_semiring_1^'n^'m) *v x = setsum (\<lambda>i. (x$i) *s column i A) (UNIV:: 'n set)"
   2.397 -  by (simp add: matrix_vector_mult_def Cart_eq column_def mult_commute)
   2.398 +  by (simp add: matrix_vector_mult_def vec_eq_iff column_def mult_commute)
   2.399  
   2.400  lemma vector_componentwise:
   2.401    "(x::'a::ring_1^'n) = (\<chi> j. setsum (\<lambda>i. (x$i) * (cart_basis i :: 'a^'n)$j) (UNIV :: 'n set))"
   2.402    apply (subst basis_expansion[symmetric])
   2.403 -  by (vector Cart_eq setsum_component)
   2.404 +  by (vector vec_eq_iff setsum_component)
   2.405  
   2.406  lemma linear_componentwise:
   2.407    fixes f:: "real ^'m \<Rightarrow> real ^ _"
   2.408 @@ -696,10 +693,10 @@
   2.409  where "matrix f = (\<chi> i j. (f(cart_basis j))$i)"
   2.410  
   2.411  lemma matrix_vector_mul_linear: "linear(\<lambda>x. A *v (x::real ^ _))"
   2.412 -  by (simp add: linear_def matrix_vector_mult_def Cart_eq field_simps setsum_right_distrib setsum_addf)
   2.413 +  by (simp add: linear_def matrix_vector_mult_def vec_eq_iff field_simps setsum_right_distrib setsum_addf)
   2.414  
   2.415  lemma matrix_works: assumes lf: "linear f" shows "matrix f *v x = f (x::real ^ 'n)"
   2.416 -apply (simp add: matrix_def matrix_vector_mult_def Cart_eq mult_commute)
   2.417 +apply (simp add: matrix_def matrix_vector_mult_def vec_eq_iff mult_commute)
   2.418  apply clarify
   2.419  apply (rule linear_componentwise[OF lf, symmetric])
   2.420  done
   2.421 @@ -717,11 +714,11 @@
   2.422    by (simp  add: matrix_eq matrix_works matrix_vector_mul_assoc[symmetric] o_def)
   2.423  
   2.424  lemma matrix_vector_column:"(A::'a::comm_semiring_1^'n^_) *v x = setsum (\<lambda>i. (x$i) *s ((transpose A)$i)) (UNIV:: 'n set)"
   2.425 -  by (simp add: matrix_vector_mult_def transpose_def Cart_eq mult_commute)
   2.426 +  by (simp add: matrix_vector_mult_def transpose_def vec_eq_iff mult_commute)
   2.427  
   2.428  lemma adjoint_matrix: "adjoint(\<lambda>x. (A::real^'n^'m) *v x) = (\<lambda>x. transpose A *v x)"
   2.429    apply (rule adjoint_unique)
   2.430 -  apply (simp add: transpose_def inner_vector_def matrix_vector_mult_def setsum_left_distrib setsum_right_distrib)
   2.431 +  apply (simp add: transpose_def inner_vec_def matrix_vector_mult_def setsum_left_distrib setsum_right_distrib)
   2.432    apply (subst setsum_commute)
   2.433    apply (auto simp add: mult_ac)
   2.434    done
   2.435 @@ -916,10 +913,10 @@
   2.436        let ?x = "\<chi> i. c i"
   2.437        have th0:"A *v ?x = 0"
   2.438          using c
   2.439 -        unfolding matrix_mult_vsum Cart_eq
   2.440 +        unfolding matrix_mult_vsum vec_eq_iff
   2.441          by auto
   2.442        from k[rule_format, OF th0] i
   2.443 -      have "c i = 0" by (vector Cart_eq)}
   2.444 +      have "c i = 0" by (vector vec_eq_iff)}
   2.445      hence ?rhs by blast}
   2.446    moreover
   2.447    {assume H: ?rhs
   2.448 @@ -1038,17 +1035,17 @@
   2.449  
   2.450  lemma transpose_columnvector:
   2.451   "transpose(columnvector v) = rowvector v"
   2.452 -  by (simp add: transpose_def rowvector_def columnvector_def Cart_eq)
   2.453 +  by (simp add: transpose_def rowvector_def columnvector_def vec_eq_iff)
   2.454  
   2.455  lemma transpose_rowvector: "transpose(rowvector v) = columnvector v"
   2.456 -  by (simp add: transpose_def columnvector_def rowvector_def Cart_eq)
   2.457 +  by (simp add: transpose_def columnvector_def rowvector_def vec_eq_iff)
   2.458  
   2.459  lemma dot_rowvector_columnvector:
   2.460    "columnvector (A *v v) = A ** columnvector v"
   2.461    by (vector columnvector_def matrix_matrix_mult_def matrix_vector_mult_def)
   2.462  
   2.463  lemma dot_matrix_product: "(x::real^'n) \<bullet> y = (((rowvector x ::real^'n^1) ** (columnvector y :: real^1^'n))$1)$1"
   2.464 -  by (vector matrix_matrix_mult_def rowvector_def columnvector_def inner_vector_def)
   2.465 +  by (vector matrix_matrix_mult_def rowvector_def columnvector_def inner_vec_def)
   2.466  
   2.467  lemma dot_matrix_vector_mul:
   2.468    fixes A B :: "real ^'n ^'n" and x y :: "real ^'n"
   2.469 @@ -1078,18 +1075,18 @@
   2.470    unfolding nth_conv_component
   2.471    using component_le_infnorm[of x] .
   2.472  
   2.473 -instance cart :: (perfect_space, finite) perfect_space
   2.474 +instance vec :: (perfect_space, finite) perfect_space
   2.475  proof
   2.476    fix x :: "'a ^ 'b"
   2.477    show "x islimpt UNIV"
   2.478      apply (rule islimptI)
   2.479 -    apply (unfold open_vector_def)
   2.480 +    apply (unfold open_vec_def)
   2.481      apply (drule (1) bspec)
   2.482      apply clarsimp
   2.483      apply (subgoal_tac "\<forall>i\<in>UNIV. \<exists>y. y \<in> A i \<and> y \<noteq> x $ i")
   2.484       apply (drule finite_choice [OF finite_UNIV], erule exE)
   2.485 -     apply (rule_tac x="Cart_lambda f" in exI)
   2.486 -     apply (simp add: Cart_eq)
   2.487 +     apply (rule_tac x="vec_lambda f" in exI)
   2.488 +     apply (simp add: vec_eq_iff)
   2.489      apply (rule ballI, drule_tac x=i in spec, clarify)
   2.490      apply (cut_tac x="x $ i" in islimpt_UNIV)
   2.491      apply (simp add: islimpt_def)
   2.492 @@ -1122,7 +1119,7 @@
   2.493    apply (clarify)
   2.494    apply (drule spec, drule (1) mp)
   2.495    apply (erule eventually_elim1)
   2.496 -  apply (erule le_less_trans [OF dist_nth_le_cart])
   2.497 +  apply (erule le_less_trans [OF dist_vec_nth_le])
   2.498    done
   2.499  
   2.500  lemma bounded_component_cart: "bounded s \<Longrightarrow> bounded ((\<lambda>x. x $ i) ` s)"
   2.501 @@ -1131,7 +1128,7 @@
   2.502  apply (rule_tac x="x $ i" in exI)
   2.503  apply (rule_tac x="e" in exI)
   2.504  apply clarify
   2.505 -apply (rule order_trans [OF dist_nth_le_cart], simp)
   2.506 +apply (rule order_trans [OF dist_vec_nth_le], simp)
   2.507  done
   2.508  
   2.509  lemma compact_lemma_cart:
   2.510 @@ -1168,7 +1165,7 @@
   2.511    qed
   2.512  qed
   2.513  
   2.514 -instance cart :: (heine_borel, finite) heine_borel
   2.515 +instance vec :: (heine_borel, finite) heine_borel
   2.516  proof
   2.517    fix s :: "('a ^ 'b) set" and f :: "nat \<Rightarrow> 'a ^ 'b"
   2.518    assume s: "bounded s" and f: "\<forall>n. f n \<in> s"
   2.519 @@ -1184,7 +1181,7 @@
   2.520      moreover
   2.521      { fix n assume n: "\<forall>i. dist (f (r n) $ i) (l $ i) < e / (real_of_nat (card ?d))"
   2.522        have "dist (f (r n)) l \<le> (\<Sum>i\<in>?d. dist (f (r n) $ i) (l $ i))"
   2.523 -        unfolding dist_vector_def using zero_le_dist by (rule setL2_le_setsum)
   2.524 +        unfolding dist_vec_def using zero_le_dist by (rule setL2_le_setsum)
   2.525        also have "\<dots> < (\<Sum>i\<in>?d. e / (real_of_nat (card ?d)))"
   2.526          by (rule setsum_strict_mono) (simp_all add: n)
   2.527        finally have "dist (f (r n)) l < e" by simp
   2.528 @@ -1205,12 +1202,12 @@
   2.529  lemma interval_cart: fixes a :: "'a::ord^'n" shows
   2.530    "{a <..< b} = {x::'a^'n. \<forall>i. a$i < x$i \<and> x$i < b$i}" and
   2.531    "{a .. b} = {x::'a^'n. \<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i}"
   2.532 -  by (auto simp add: set_eq_iff vector_less_def vector_le_def)
   2.533 +  by (auto simp add: set_eq_iff less_vec_def less_eq_vec_def)
   2.534  
   2.535  lemma mem_interval_cart: fixes a :: "'a::ord^'n" shows
   2.536    "x \<in> {a<..<b} \<longleftrightarrow> (\<forall>i. a$i < x$i \<and> x$i < b$i)"
   2.537    "x \<in> {a .. b} \<longleftrightarrow> (\<forall>i. a$i \<le> x$i \<and> x$i \<le> b$i)"
   2.538 -  using interval_cart[of a b] by(auto simp add: set_eq_iff vector_less_def vector_le_def)
   2.539 +  using interval_cart[of a b] by(auto simp add: set_eq_iff less_vec_def less_eq_vec_def)
   2.540  
   2.541  lemma interval_eq_empty_cart: fixes a :: "real^'n" shows
   2.542   "({a <..< b} = {} \<longleftrightarrow> (\<exists>i. b$i \<le> a$i))" (is ?th1) and
   2.543 @@ -1263,7 +1260,7 @@
   2.544  
   2.545  lemma interval_sing: fixes a :: "'a::linorder^'n" shows
   2.546   "{a .. a} = {a} \<and> {a<..<a} = {}"
   2.547 -apply(auto simp add: set_eq_iff vector_less_def vector_le_def Cart_eq)
   2.548 +apply(auto simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff)
   2.549  apply (simp add: order_eq_iff)
   2.550  apply (auto simp add: not_less less_imp_le)
   2.551  done
   2.552 @@ -1276,17 +1273,17 @@
   2.553    { fix i
   2.554      have "a $ i \<le> x $ i"
   2.555        using x order_less_imp_le[of "a$i" "x$i"]
   2.556 -      by(simp add: set_eq_iff vector_less_def vector_le_def Cart_eq)
   2.557 +      by(simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff)
   2.558    }
   2.559    moreover
   2.560    { fix i
   2.561      have "x $ i \<le> b $ i"
   2.562        using x order_less_imp_le[of "x$i" "b$i"]
   2.563 -      by(simp add: set_eq_iff vector_less_def vector_le_def Cart_eq)
   2.564 +      by(simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff)
   2.565    }
   2.566    ultimately
   2.567    show "a \<le> x \<and> x \<le> b"
   2.568 -    by(simp add: set_eq_iff vector_less_def vector_le_def Cart_eq)
   2.569 +    by(simp add: set_eq_iff less_vec_def less_eq_vec_def vec_eq_iff)
   2.570  qed
   2.571  
   2.572  lemma subset_interval_cart: fixes a :: "real^'n" shows
   2.573 @@ -1406,12 +1403,12 @@
   2.574  
   2.575  lemma dim_substandard_cart:
   2.576    shows "dim {x::real^'n. \<forall>i. i \<notin> d \<longrightarrow> x$i = 0} = card d" (is "dim ?A = _")
   2.577 -proof- have *:"{x. \<forall>i<DIM((real, 'n) cart). i \<notin> \<pi>' ` d \<longrightarrow> x $$ i = 0} = 
   2.578 +proof- have *:"{x. \<forall>i<DIM((real, 'n) vec). i \<notin> \<pi>' ` d \<longrightarrow> x $$ i = 0} = 
   2.579      {x::real^'n. \<forall>i. i \<notin> d \<longrightarrow> x$i = 0}"apply safe
   2.580      apply(erule_tac x="\<pi>' i" in allE) defer
   2.581      apply(erule_tac x="\<pi> i" in allE)
   2.582      unfolding image_iff real_euclidean_nth[symmetric] by (auto simp: pi'_inj[THEN inj_eq])
   2.583 -  have " \<pi>' ` d \<subseteq> {..<DIM((real, 'n) cart)}" using pi'_range[where 'n='n] by auto
   2.584 +  have " \<pi>' ` d \<subseteq> {..<DIM((real, 'n) vec)}" using pi'_range[where 'n='n] by auto
   2.585    thus ?thesis using dim_substandard[of "\<pi>' ` d", where 'a="real^'n"] 
   2.586      unfolding * using card_image[of "\<pi>'" d] using pi'_inj unfolding inj_on_def by auto
   2.587  qed
   2.588 @@ -1464,7 +1461,7 @@
   2.589  declare vector_add_ldistrib[simp] vector_ssub_ldistrib[simp] vector_smult_assoc[simp] vector_smult_rneg[simp]
   2.590  declare vector_sadd_rdistrib[simp] vector_sub_rdistrib[simp]
   2.591  
   2.592 -lemmas vector_component_simps = vector_minus_component vector_smult_component vector_add_component vector_le_def Cart_lambda_beta basis_component vector_uminus_component
   2.593 +lemmas vector_component_simps = vector_minus_component vector_smult_component vector_add_component less_eq_vec_def vec_lambda_beta basis_component vector_uminus_component
   2.594  
   2.595  lemma convex_box_cart:
   2.596    assumes "\<And>i. convex {x. P i x}"
   2.597 @@ -1489,7 +1486,7 @@
   2.598  
   2.599  lemma std_simplex_cart:
   2.600    "(insert (0::real^'n) { cart_basis i | i. i\<in>UNIV}) =
   2.601 -  (insert 0 { basis i | i. i<DIM((real,'n) cart)})"
   2.602 +  (insert 0 { basis i | i. i<DIM((real,'n) vec)})"
   2.603    apply(rule arg_cong[where f="\<lambda>s. (insert 0 s)"])
   2.604    unfolding basis_real_n[THEN sym] apply safe
   2.605    apply(rule_tac x="\<pi>' i" in exI) defer
   2.606 @@ -1516,13 +1513,13 @@
   2.607  lemma interval_bij_cart:"interval_bij = (\<lambda> (a,b) (u,v) (x::real^'n).
   2.608      (\<chi> i. u$i + (x$i - a$i) / (b$i - a$i) * (v$i - u$i))::real^'n)"
   2.609    unfolding interval_bij_def apply(rule ext)+ apply safe
   2.610 -  unfolding Cart_eq Cart_lambda_beta unfolding nth_conv_component
   2.611 +  unfolding vec_eq_iff vec_lambda_beta unfolding nth_conv_component
   2.612    apply rule apply(subst euclidean_lambda_beta) using pi'_range by auto
   2.613  
   2.614  lemma interval_bij_affine_cart:
   2.615   "interval_bij (a,b) (u,v) = (\<lambda>x. (\<chi> i. (v$i - u$i) / (b$i - a$i) * x$i) +
   2.616              (\<chi> i. u$i - (v$i - u$i) / (b$i - a$i) * a$i)::real^'n)"
   2.617 -  apply rule unfolding Cart_eq interval_bij_cart vector_component_simps
   2.618 +  apply rule unfolding vec_eq_iff interval_bij_cart vector_component_simps
   2.619    by(auto simp add: field_simps add_divide_distrib[THEN sym]) 
   2.620  
   2.621  subsection "Derivative"
   2.622 @@ -1552,7 +1549,7 @@
   2.623  
   2.624  proof(rule ccontr)
   2.625    def D \<equiv> "jacobian f (at x)" assume "jacobian f (at x) $ k \<noteq> 0"
   2.626 -  then obtain j where j:"D$k$j \<noteq> 0" unfolding Cart_eq D_def by auto
   2.627 +  then obtain j where j:"D$k$j \<noteq> 0" unfolding vec_eq_iff D_def by auto
   2.628    hence *:"abs (jacobian f (at x) $ k $ j) / 2 > 0" unfolding D_def by auto
   2.629    note as = assms(3)[unfolded jacobian_works has_derivative_at_alt]
   2.630    guess e' using as[THEN conjunct2,rule_format,OF *] .. note e' = this
   2.631 @@ -1639,10 +1636,10 @@
   2.632    where "dest_vec1 x \<equiv> (x$1)"
   2.633  
   2.634  lemma vec1_dest_vec1[simp]: "vec1(dest_vec1 x) = x" "dest_vec1(vec1 y) = y"
   2.635 -  by (simp_all add:  Cart_eq)
   2.636 +  by (simp_all add:  vec_eq_iff)
   2.637  
   2.638  lemma vec1_component[simp]: "(vec1 x)$1 = x"
   2.639 -  by (simp_all add:  Cart_eq)
   2.640 +  by (simp_all add:  vec_eq_iff)
   2.641  
   2.642  declare vec1_dest_vec1(1) [simp]
   2.643  
   2.644 @@ -1661,7 +1658,7 @@
   2.645  subsection{* The collapse of the general concepts to dimension one. *}
   2.646  
   2.647  lemma vector_one: "(x::'a ^1) = (\<chi> i. (x$1))"
   2.648 -  by (simp add: Cart_eq)
   2.649 +  by (simp add: vec_eq_iff)
   2.650  
   2.651  lemma forall_one: "(\<forall>(x::'a ^1). P x) \<longleftrightarrow> (\<forall>x. P(\<chi> i. x))"
   2.652    apply auto
   2.653 @@ -1670,7 +1667,7 @@
   2.654    done
   2.655  
   2.656  lemma norm_vector_1: "norm (x :: _^1) = norm (x$1)"
   2.657 -  by (simp add: norm_vector_def)
   2.658 +  by (simp add: norm_vec_def)
   2.659  
   2.660  lemma norm_real: "norm(x::real ^ 1) = abs(x$1)"
   2.661    by (simp add: norm_vector_1)
   2.662 @@ -1751,7 +1748,7 @@
   2.663    by (metis vec1_dest_vec1(1) norm_vec1)
   2.664  
   2.665  lemmas vec1_dest_vec1_simps = forall_vec1 vec_add[THEN sym] dist_vec1 vec_sub[THEN sym] vec1_dest_vec1 norm_vec1 vector_smult_component
   2.666 -   vec1_eq vec_cmul[THEN sym] smult_conv_scaleR[THEN sym] o_def dist_real_def norm_vec1 real_norm_def
   2.667 +   vec1_eq vec_cmul[THEN sym] smult_conv_scaleR[THEN sym] o_def dist_real_def real_norm_def
   2.668  
   2.669  lemma bounded_linear_vec1:"bounded_linear (vec1::real\<Rightarrow>real^1)"
   2.670    unfolding bounded_linear_def additive_def bounded_linear_axioms_def 
   2.671 @@ -1770,14 +1767,14 @@
   2.672    unfolding smult_conv_scaleR
   2.673    apply (rule ext)
   2.674    apply (subst matrix_works[OF lf, symmetric])
   2.675 -  apply (auto simp add: Cart_eq matrix_vector_mult_def column_def mult_commute)
   2.676 +  apply (auto simp add: vec_eq_iff matrix_vector_mult_def column_def mult_commute)
   2.677    done
   2.678  
   2.679  lemma linear_to_scalars: assumes lf: "linear (f::real ^'n \<Rightarrow> real^1)"
   2.680    shows "f = (\<lambda>x. vec1(row 1 (matrix f) \<bullet> x))"
   2.681    apply (rule ext)
   2.682    apply (subst matrix_works[OF lf, symmetric])
   2.683 -  apply (simp add: Cart_eq matrix_vector_mult_def row_def inner_vector_def mult_commute)
   2.684 +  apply (simp add: vec_eq_iff matrix_vector_mult_def row_def inner_vec_def mult_commute)
   2.685    done
   2.686  
   2.687  lemma dest_vec1_eq_0: "dest_vec1 x = 0 \<longleftrightarrow> x = 0"
   2.688 @@ -1801,14 +1798,14 @@
   2.689    using assms unfolding continuous_on_iff apply safe
   2.690    apply(erule_tac x="x$1" in ballE,erule_tac x=e in allE) apply safe
   2.691    apply(rule_tac x=d in exI) apply safe unfolding o_def dist_real_def dist_real 
   2.692 -  apply(erule_tac x="dest_vec1 x'" in ballE) by(auto simp add:vector_le_def)
   2.693 +  apply(erule_tac x="dest_vec1 x'" in ballE) by(auto simp add:less_eq_vec_def)
   2.694  
   2.695  lemma continuous_on_o_vec1: fixes f::"real^1 \<Rightarrow> 'a::real_normed_vector"
   2.696    assumes "continuous_on {a..b} f" shows "continuous_on {dest_vec1 a..dest_vec1 b} (f o vec1)"
   2.697    using assms unfolding continuous_on_iff apply safe
   2.698    apply(erule_tac x="vec x" in ballE,erule_tac x=e in allE) apply safe
   2.699    apply(rule_tac x=d in exI) apply safe unfolding o_def dist_real_def dist_real 
   2.700 -  apply(erule_tac x="vec1 x'" in ballE) by(auto simp add:vector_le_def)
   2.701 +  apply(erule_tac x="vec1 x'" in ballE) by(auto simp add:less_eq_vec_def)
   2.702  
   2.703  lemma continuous_on_vec1:"continuous_on A (vec1::real\<Rightarrow>real^1)"
   2.704    by(rule linear_continuous_on[OF bounded_linear_vec1])
   2.705 @@ -1816,12 +1813,12 @@
   2.706  lemma mem_interval_1: fixes x :: "real^1" shows
   2.707   "(x \<in> {a .. b} \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b)"
   2.708   "(x \<in> {a<..<b} \<longleftrightarrow> dest_vec1 a < dest_vec1 x \<and> dest_vec1 x < dest_vec1 b)"
   2.709 -by(simp_all add: Cart_eq vector_less_def vector_le_def)
   2.710 +by(simp_all add: vec_eq_iff less_vec_def less_eq_vec_def)
   2.711  
   2.712  lemma vec1_interval:fixes a::"real" shows
   2.713    "vec1 ` {a .. b} = {vec1 a .. vec1 b}"
   2.714    "vec1 ` {a<..<b} = {vec1 a<..<vec1 b}"
   2.715 -  apply(rule_tac[!] set_eqI) unfolding image_iff vector_less_def unfolding mem_interval_cart
   2.716 +  apply(rule_tac[!] set_eqI) unfolding image_iff less_vec_def unfolding mem_interval_cart
   2.717    unfolding forall_1 unfolding vec1_dest_vec1_simps
   2.718    apply rule defer apply(rule_tac x="dest_vec1 x" in bexI) prefer 3 apply rule defer
   2.719    apply(rule_tac x="dest_vec1 x" in bexI) by auto
   2.720 @@ -1830,12 +1827,12 @@
   2.721  
   2.722  lemma interval_cases_1: fixes x :: "real^1" shows
   2.723   "x \<in> {a .. b} ==> x \<in> {a<..<b} \<or> (x = a) \<or> (x = b)"
   2.724 -  unfolding Cart_eq vector_less_def vector_le_def mem_interval_cart by(auto simp del:dest_vec1_eq)
   2.725 +  unfolding vec_eq_iff less_vec_def less_eq_vec_def mem_interval_cart by(auto simp del:dest_vec1_eq)
   2.726  
   2.727  lemma in_interval_1: fixes x :: "real^1" shows
   2.728   "(x \<in> {a .. b} \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 x \<and> dest_vec1 x \<le> dest_vec1 b) \<and>
   2.729    (x \<in> {a<..<b} \<longleftrightarrow> dest_vec1 a < dest_vec1 x \<and> dest_vec1 x < dest_vec1 b)"
   2.730 -  unfolding Cart_eq vector_less_def vector_le_def mem_interval_cart by(auto simp del:dest_vec1_eq)
   2.731 +  unfolding vec_eq_iff less_vec_def less_eq_vec_def mem_interval_cart by(auto simp del:dest_vec1_eq)
   2.732  
   2.733  lemma interval_eq_empty_1: fixes a :: "real^1" shows
   2.734    "{a .. b} = {} \<longleftrightarrow> dest_vec1 b < dest_vec1 a"
   2.735 @@ -1871,10 +1868,10 @@
   2.736  
   2.737  lemma open_closed_interval_1: fixes a :: "real^1" shows
   2.738   "{a<..<b} = {a .. b} - {a, b}"
   2.739 -  unfolding set_eq_iff apply simp unfolding vector_less_def and vector_le_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq)
   2.740 +  unfolding set_eq_iff apply simp unfolding less_vec_def and less_eq_vec_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq)
   2.741  
   2.742  lemma closed_open_interval_1: "dest_vec1 (a::real^1) \<le> dest_vec1 b ==> {a .. b} = {a<..<b} \<union> {a,b}"
   2.743 -  unfolding set_eq_iff apply simp unfolding vector_less_def and vector_le_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq)
   2.744 +  unfolding set_eq_iff apply simp unfolding less_vec_def and less_eq_vec_def and forall_1 and dest_vec1_eq[THEN sym] by(auto simp del:dest_vec1_eq)
   2.745  
   2.746  lemma Lim_drop_le: fixes f :: "'a \<Rightarrow> real^1" shows
   2.747    "(f ---> l) net \<Longrightarrow> ~(trivial_limit net) \<Longrightarrow> eventually (\<lambda>x. dest_vec1 (f x) \<le> b) net ==> dest_vec1 l \<le> b"
   2.748 @@ -1903,7 +1900,7 @@
   2.749  lemma dest_vec1_simps[simp]: fixes a::"real^1"
   2.750    shows "a$1 = 0 \<longleftrightarrow> a = 0" (*"a \<le> 1 \<longleftrightarrow> dest_vec1 a \<le> 1" "0 \<le> a \<longleftrightarrow> 0 \<le> dest_vec1 a"*)
   2.751    "a \<le> b \<longleftrightarrow> dest_vec1 a \<le> dest_vec1 b" "dest_vec1 (1::real^1) = 1"
   2.752 -  by(auto simp add: vector_le_def Cart_eq)
   2.753 +  by(auto simp add: less_eq_vec_def vec_eq_iff)
   2.754  
   2.755  lemma dest_vec1_inverval:
   2.756    "dest_vec1 ` {a .. b} = {dest_vec1 a .. dest_vec1 b}"
   2.757 @@ -1915,18 +1912,18 @@
   2.758    apply(rule_tac [!] allI)apply(rule_tac [!] impI)
   2.759    apply(rule_tac[2] x="vec1 x" in exI)apply(rule_tac[4] x="vec1 x" in exI)
   2.760    apply(rule_tac[6] x="vec1 x" in exI)apply(rule_tac[8] x="vec1 x" in exI)
   2.761 -  by (auto simp add: vector_less_def vector_le_def)
   2.762 +  by (auto simp add: less_vec_def less_eq_vec_def)
   2.763  
   2.764  lemma dest_vec1_setsum: assumes "finite S"
   2.765    shows " dest_vec1 (setsum f S) = setsum (\<lambda>x. dest_vec1 (f x)) S"
   2.766    using dest_vec1_sum[OF assms] by auto
   2.767  
   2.768  lemma open_dest_vec1_vimage: "open S \<Longrightarrow> open (dest_vec1 -` S)"
   2.769 -unfolding open_vector_def forall_1 by auto
   2.770 +unfolding open_vec_def forall_1 by auto
   2.771  
   2.772  lemma tendsto_dest_vec1 [tendsto_intros]:
   2.773    "(f ---> l) net \<Longrightarrow> ((\<lambda>x. dest_vec1 (f x)) ---> dest_vec1 l) net"
   2.774 -by(rule tendsto_Cart_nth)
   2.775 +by(rule tendsto_vec_nth)
   2.776  
   2.777  lemma continuous_dest_vec1: "continuous net f \<Longrightarrow> continuous net (\<lambda>x. dest_vec1 (f x))"
   2.778    unfolding continuous_def by (rule tendsto_dest_vec1)
   2.779 @@ -1952,9 +1949,9 @@
   2.780      unfolding vec1_dest_vec1_simps by auto qed
   2.781  
   2.782  lemma vec1_le[simp]:fixes a::real shows "vec1 a \<le> vec1 b \<longleftrightarrow> a \<le> b"
   2.783 -  unfolding vector_le_def by auto
   2.784 +  unfolding less_eq_vec_def by auto
   2.785  lemma vec1_less[simp]:fixes a::real shows "vec1 a < vec1 b \<longleftrightarrow> a < b"
   2.786 -  unfolding vector_less_def by auto
   2.787 +  unfolding less_vec_def by auto
   2.788  
   2.789  
   2.790  subsection {* Derivatives on real = Derivatives on @{typ "real^1"} *}
   2.791 @@ -1998,7 +1995,7 @@
   2.792  
   2.793  lemma onorm_vec1: fixes f::"real \<Rightarrow> real"
   2.794    shows "onorm (\<lambda>x. vec1 (f (dest_vec1 x))) = onorm f" proof-
   2.795 -  have "\<forall>x::real^1. norm x = 1 \<longleftrightarrow> x\<in>{vec1 -1, vec1 (1::real)}" unfolding forall_vec1 by(auto simp add:Cart_eq)
   2.796 +  have "\<forall>x::real^1. norm x = 1 \<longleftrightarrow> x\<in>{vec1 -1, vec1 (1::real)}" unfolding forall_vec1 by(auto simp add:vec_eq_iff)
   2.797    hence 1:"{x. norm x = 1} = {vec1 -1, vec1 (1::real)}" by auto
   2.798    have 2:"{norm (vec1 (f (dest_vec1 x))) |x. norm x = 1} = (\<lambda>x. norm (vec1 (f (dest_vec1 x)))) ` {x. norm x=1}" by auto
   2.799    have "\<forall>x::real. norm x = 1 \<longleftrightarrow> x\<in>{-1, 1}" by auto hence 3:"{x. norm x = 1} = {-1, (1::real)}" by auto
   2.800 @@ -2037,11 +2034,11 @@
   2.801    "{a..b::real^'n} \<inter> {x. x$k \<le> c} = {a .. (\<chi> i. if i = k then min (b$k) c else b$i)}"
   2.802    "{a..b} \<inter> {x. x$k \<ge> c} = {(\<chi> i. if i = k then max (a$k) c else a$i) .. b}"
   2.803    apply(rule_tac[!] set_eqI) unfolding Int_iff mem_interval_cart mem_Collect_eq
   2.804 -  unfolding Cart_lambda_beta by auto
   2.805 +  unfolding vec_lambda_beta by auto
   2.806  
   2.807  (*lemma content_split_cart:
   2.808    "content {a..b::real^'n} = content({a..b} \<inter> {x. x$k \<le> c}) + content({a..b} \<inter> {x. x$k >= c})"
   2.809 -proof- note simps = interval_split_cart content_closed_interval_cases_cart Cart_lambda_beta vector_le_def
   2.810 +proof- note simps = interval_split_cart content_closed_interval_cases_cart vec_lambda_beta less_eq_vec_def
   2.811    { presume "a\<le>b \<Longrightarrow> ?thesis" thus ?thesis apply(cases "a\<le>b") unfolding simps by auto }
   2.812    have *:"UNIV = insert k (UNIV - {k})" "\<And>x. finite (UNIV-{x::'n})" "\<And>x. x\<notin>UNIV-{x}" by auto
   2.813    have *:"\<And>X Y Z. (\<Prod>i\<in>UNIV. Z i (if i = k then X else Y i)) = Z k X * (\<Prod>i\<in>UNIV-{k}. Z i (Y i))"
   2.814 @@ -2051,7 +2048,7 @@
   2.815      \<Longrightarrow> x* (b$k - a$k) = x*(max (a $ k) c - a $ k) + x*(b $ k - max (a $ k) c)"
   2.816      by  (auto simp add:field_simps)
   2.817    moreover have "\<not> a $ k \<le> c \<Longrightarrow> \<not> c \<le> b $ k \<Longrightarrow> False"
   2.818 -    unfolding not_le using as[unfolded vector_le_def,rule_format,of k] by auto
   2.819 +    unfolding not_le using as[unfolded less_eq_vec_def,rule_format,of k] by auto
   2.820    ultimately show ?thesis 
   2.821      unfolding simps unfolding *(1)[of "\<lambda>i x. b$i - x"] *(1)[of "\<lambda>i x. x - a$i"] *(2) by(auto)
   2.822  qed*)
   2.823 @@ -2059,7 +2056,7 @@
   2.824  lemma has_integral_vec1: assumes "(f has_integral k) {a..b}"
   2.825    shows "((\<lambda>x. vec1 (f x)) has_integral (vec1 k)) {a..b}"
   2.826  proof- have *:"\<And>p. (\<Sum>(x, k)\<in>p. content k *\<^sub>R vec1 (f x)) - vec1 k = vec1 ((\<Sum>(x, k)\<in>p. content k *\<^sub>R f x) - k)"
   2.827 -    unfolding vec_sub Cart_eq by(auto simp add: split_beta)
   2.828 +    unfolding vec_sub vec_eq_iff by(auto simp add: split_beta)
   2.829    show ?thesis using assms unfolding has_integral apply safe
   2.830      apply(erule_tac x=e in allE,safe) apply(rule_tac x=d in exI,safe)
   2.831      apply(erule_tac x=p in allE,safe) unfolding * norm_vector_1 by auto qed
     3.1 --- a/src/HOL/Multivariate_Analysis/Fashoda.thy	Wed Aug 10 10:13:16 2011 -0700
     3.2 +++ b/src/HOL/Multivariate_Analysis/Fashoda.thy	Wed Aug 10 13:13:37 2011 -0700
     3.3 @@ -46,7 +46,7 @@
     3.4      apply(rule assms)+ apply(rule continuous_on_compose,subst sqprojection_def)
     3.5      apply(rule continuous_on_mul ) apply(rule continuous_at_imp_continuous_on,rule) apply(rule continuous_at_inv[unfolded o_def])
     3.6      apply(rule continuous_at_infnorm) unfolding infnorm_eq_0 defer apply(rule continuous_on_id) apply(rule linear_continuous_on) proof-
     3.7 -    show "bounded_linear negatex" apply(rule bounded_linearI') unfolding Cart_eq proof(rule_tac[!] allI) fix i::2 and x y::"real^2" and c::real
     3.8 +    show "bounded_linear negatex" apply(rule bounded_linearI') unfolding vec_eq_iff proof(rule_tac[!] allI) fix i::2 and x y::"real^2" and c::real
     3.9        show "negatex (x + y) $ i = (negatex x + negatex y) $ i" "negatex (c *\<^sub>R x) $ i = (c *\<^sub>R negatex x) $ i"
    3.10          apply-apply(case_tac[!] "i\<noteq>1") prefer 3 apply(drule_tac[1-2] 21) 
    3.11          unfolding negatex_def by(auto simp add:vector_2 ) qed qed(insert x0, auto)
    3.12 @@ -66,7 +66,7 @@
    3.13      apply- apply(rule_tac[!] allI impI)+ proof- fix x::"real^2" and i::2 assume x:"x\<noteq>0"
    3.14      have "inverse (infnorm x) > 0" using x[unfolded infnorm_pos_lt[THEN sym]] by auto
    3.15      thus "(0 < sqprojection x $ i) = (0 < x $ i)"   "(sqprojection x $ i < 0) = (x $ i < 0)"
    3.16 -      unfolding sqprojection_def vector_component_simps Cart_nth.scaleR real_scaleR_def
    3.17 +      unfolding sqprojection_def vector_component_simps vec_nth.scaleR real_scaleR_def
    3.18        unfolding zero_less_mult_iff mult_less_0_iff by(auto simp add:field_simps) qed
    3.19    note lem3 = this[rule_format]
    3.20    have x1:"x $ 1 \<in> {- 1..1::real}" "x $ 2 \<in> {- 1..1::real}" using x(1) unfolding mem_interval_cart by auto
    3.21 @@ -77,7 +77,7 @@
    3.22    next assume as:"x$1 = 1"
    3.23      hence *:"f (x $ 1) $ 1 = 1" using assms(6) by auto
    3.24      have "sqprojection (f (x$1) - g (x$2)) $ 1 < 0"
    3.25 -      using x(2)[unfolded o_def Cart_eq,THEN spec[where x=1]]
    3.26 +      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
    3.27        unfolding as negatex_def vector_2 by auto moreover
    3.28      from x1 have "g (x $ 2) \<in> {- 1..1}" apply-apply(rule assms(2)[unfolded subset_eq,rule_format]) by auto
    3.29      ultimately show False unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
    3.30 @@ -85,7 +85,7 @@
    3.31    next assume as:"x$1 = -1"
    3.32      hence *:"f (x $ 1) $ 1 = - 1" using assms(5) by auto
    3.33      have "sqprojection (f (x$1) - g (x$2)) $ 1 > 0"
    3.34 -      using x(2)[unfolded o_def Cart_eq,THEN spec[where x=1]]
    3.35 +      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=1]]
    3.36        unfolding as negatex_def vector_2 by auto moreover
    3.37      from x1 have "g (x $ 2) \<in> {- 1..1}" apply-apply(rule assms(2)[unfolded subset_eq,rule_format]) by auto
    3.38      ultimately show False unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
    3.39 @@ -93,7 +93,7 @@
    3.40    next assume as:"x$2 = 1"
    3.41      hence *:"g (x $ 2) $ 2 = 1" using assms(8) by auto
    3.42      have "sqprojection (f (x$1) - g (x$2)) $ 2 > 0"
    3.43 -      using x(2)[unfolded o_def Cart_eq,THEN spec[where x=2]]
    3.44 +      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
    3.45        unfolding as negatex_def vector_2 by auto moreover
    3.46      from x1 have "f (x $ 1) \<in> {- 1..1}" apply-apply(rule assms(1)[unfolded subset_eq,rule_format]) by auto
    3.47      ultimately show False unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
    3.48 @@ -101,7 +101,7 @@
    3.49   next assume as:"x$2 = -1"
    3.50      hence *:"g (x $ 2) $ 2 = - 1" using assms(7) by auto
    3.51      have "sqprojection (f (x$1) - g (x$2)) $ 2 < 0"
    3.52 -      using x(2)[unfolded o_def Cart_eq,THEN spec[where x=2]]
    3.53 +      using x(2)[unfolded o_def vec_eq_iff,THEN spec[where x=2]]
    3.54        unfolding as negatex_def vector_2 by auto moreover
    3.55      from x1 have "f (x $ 1) \<in> {- 1..1}" apply-apply(rule assms(1)[unfolded subset_eq,rule_format]) by auto
    3.56      ultimately show False unfolding lem3[OF nz] vector_component_simps * mem_interval_cart 
    3.57 @@ -120,7 +120,7 @@
    3.58      have *:"continuous_on {- 1..1} iscale" unfolding iscale_def by(rule continuous_on_intros)+
    3.59      show "continuous_on {- 1..1} (f \<circ> iscale)" "continuous_on {- 1..1} (g \<circ> iscale)"
    3.60        apply-apply(rule_tac[!] continuous_on_compose[OF *]) apply(rule_tac[!] continuous_on_subset[OF _ isc])
    3.61 -      by(rule assms)+ have *:"(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1" unfolding Cart_eq by auto
    3.62 +      by(rule assms)+ have *:"(1 / 2) *\<^sub>R (1 + (1::real^1)) = 1" unfolding vec_eq_iff by auto
    3.63      show "(f \<circ> iscale) (- 1) $ 1 = - 1" "(f \<circ> iscale) 1 $ 1 = 1" "(g \<circ> iscale) (- 1) $ 2 = -1" "(g \<circ> iscale) 1 $ 2 = 1"
    3.64        unfolding o_def iscale_def using assms by(auto simp add:*) qed
    3.65    then guess s .. from this(2) guess t .. note st=this
    3.66 @@ -132,7 +132,7 @@
    3.67  (* move *)
    3.68  lemma interval_bij_bij_cart: fixes x::"real^'n" assumes "\<forall>i. a$i < b$i \<and> u$i < v$i" 
    3.69    shows "interval_bij (a,b) (u,v) (interval_bij (u,v) (a,b) x) = x"
    3.70 -  unfolding interval_bij_cart split_conv Cart_eq Cart_lambda_beta
    3.71 +  unfolding interval_bij_cart split_conv vec_eq_iff vec_lambda_beta
    3.72    apply(rule,insert assms,erule_tac x=i in allE) by auto
    3.73  
    3.74  lemma fashoda: fixes b::"real^2"
    3.75 @@ -142,23 +142,23 @@
    3.76    obtains z where "z \<in> path_image f" "z \<in> path_image g" proof-
    3.77    fix P Q S presume "P \<or> Q \<or> S" "P \<Longrightarrow> thesis" "Q \<Longrightarrow> thesis" "S \<Longrightarrow> thesis" thus thesis by auto
    3.78  next have "{a..b} \<noteq> {}" using assms(3) using path_image_nonempty by auto
    3.79 -  hence "a \<le> b" unfolding interval_eq_empty_cart vector_le_def by(auto simp add: not_less)
    3.80 -  thus "a$1 = b$1 \<or> a$2 = b$2 \<or> (a$1 < b$1 \<and> a$2 < b$2)" unfolding vector_le_def forall_2 by auto
    3.81 +  hence "a \<le> b" unfolding interval_eq_empty_cart less_eq_vec_def by(auto simp add: not_less)
    3.82 +  thus "a$1 = b$1 \<or> a$2 = b$2 \<or> (a$1 < b$1 \<and> a$2 < b$2)" unfolding less_eq_vec_def forall_2 by auto
    3.83  next assume as:"a$1 = b$1" have "\<exists>z\<in>path_image g. z$2 = (pathstart f)$2" apply(rule connected_ivt_component_cart)
    3.84      apply(rule connected_path_image assms)+apply(rule pathstart_in_path_image,rule pathfinish_in_path_image)
    3.85      unfolding assms using assms(3)[unfolded path_image_def subset_eq,rule_format,of "f 0"]
    3.86 -    unfolding pathstart_def by(auto simp add: vector_le_def) then guess z .. note z=this
    3.87 +    unfolding pathstart_def by(auto simp add: less_eq_vec_def) then guess z .. note z=this
    3.88    have "z \<in> {a..b}" using z(1) assms(4) unfolding path_image_def by blast 
    3.89 -  hence "z = f 0" unfolding Cart_eq forall_2 unfolding z(2) pathstart_def
    3.90 +  hence "z = f 0" unfolding vec_eq_iff forall_2 unfolding z(2) pathstart_def
    3.91      using assms(3)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "f 0" 1]
    3.92      unfolding mem_interval_cart apply(erule_tac x=1 in allE) using as by auto
    3.93    thus thesis apply-apply(rule that[OF _ z(1)]) unfolding path_image_def by auto
    3.94  next assume as:"a$2 = b$2" have "\<exists>z\<in>path_image f. z$1 = (pathstart g)$1" apply(rule connected_ivt_component_cart)
    3.95      apply(rule connected_path_image assms)+apply(rule pathstart_in_path_image,rule pathfinish_in_path_image)
    3.96      unfolding assms using assms(4)[unfolded path_image_def subset_eq,rule_format,of "g 0"]
    3.97 -    unfolding pathstart_def by(auto simp add: vector_le_def) then guess z .. note z=this
    3.98 +    unfolding pathstart_def by(auto simp add: less_eq_vec_def) then guess z .. note z=this
    3.99    have "z \<in> {a..b}" using z(1) assms(3) unfolding path_image_def by blast 
   3.100 -  hence "z = g 0" unfolding Cart_eq forall_2 unfolding z(2) pathstart_def
   3.101 +  hence "z = g 0" unfolding vec_eq_iff forall_2 unfolding z(2) pathstart_def
   3.102      using assms(4)[unfolded path_image_def subset_eq mem_interval_cart,rule_format,of "g 0" 2]
   3.103      unfolding mem_interval_cart apply(erule_tac x=2 in allE) using as by auto
   3.104    thus thesis apply-apply(rule that[OF z(1)]) unfolding path_image_def by auto
   3.105 @@ -180,7 +180,7 @@
   3.106        "(interval_bij (a, b) (- 1, 1) \<circ> f) 1 $ 1 = 1"
   3.107        "(interval_bij (a, b) (- 1, 1) \<circ> g) 0 $ 2 = -1"
   3.108        "(interval_bij (a, b) (- 1, 1) \<circ> g) 1 $ 2 = 1"
   3.109 -      unfolding interval_bij_cart Cart_lambda_beta vector_component_simps o_def split_conv
   3.110 +      unfolding interval_bij_cart vec_lambda_beta vector_component_simps o_def split_conv
   3.111        unfolding assms[unfolded pathstart_def pathfinish_def] using as by auto qed note z=this
   3.112    from z(1) guess zf unfolding image_iff .. note zf=this
   3.113    from z(2) guess zg unfolding image_iff .. note zg=this
   3.114 @@ -197,7 +197,7 @@
   3.115  proof- 
   3.116    let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1"
   3.117    { presume "?L \<Longrightarrow> ?R" "?R \<Longrightarrow> ?L" thus ?thesis unfolding closed_segment_def mem_Collect_eq
   3.118 -      unfolding Cart_eq forall_2 smult_conv_scaleR[THEN sym] vector_component_simps by blast }
   3.119 +      unfolding vec_eq_iff forall_2 smult_conv_scaleR[THEN sym] vector_component_simps by blast }
   3.120    { assume ?L then guess u apply-apply(erule exE)apply(erule conjE)+ . note u=this
   3.121      { fix b a assume "b + u * a > a + u * b"
   3.122        hence "(1 - u) * b > (1 - u) * a" by(auto simp add:field_simps)
   3.123 @@ -221,7 +221,7 @@
   3.124  proof- 
   3.125    let ?L = "\<exists>u. (x $ 1 = (1 - u) * a $ 1 + u * b $ 1 \<and> x $ 2 = (1 - u) * a $ 2 + u * b $ 2) \<and> 0 \<le> u \<and> u \<le> 1"
   3.126    { presume "?L \<Longrightarrow> ?R" "?R \<Longrightarrow> ?L" thus ?thesis unfolding closed_segment_def mem_Collect_eq
   3.127 -      unfolding Cart_eq forall_2 smult_conv_scaleR[THEN sym] vector_component_simps by blast }
   3.128 +      unfolding vec_eq_iff forall_2 smult_conv_scaleR[THEN sym] vector_component_simps by blast }
   3.129    { assume ?L then guess u apply-apply(erule exE)apply(erule conjE)+ . note u=this
   3.130      { fix b a assume "b + u * a > a + u * b"
   3.131        hence "(1 - u) * b > (1 - u) * a" by(auto simp add:field_simps)
   3.132 @@ -274,7 +274,7 @@
   3.133        path_image(linepath(vector[(pathfinish g)$1,a$2 - 1])(vector[b$1 + 1,a$2 - 1])) \<union>
   3.134        path_image(linepath(vector[b$1 + 1,a$2 - 1])(vector[b$1 + 1,b$2 + 3]))" using assms(1-2)
   3.135        by(auto simp add: path_image_join path_linepath)
   3.136 -  have abab: "{a..b} \<subseteq> {?a..?b}" by(auto simp add:vector_le_def forall_2 vector_2)
   3.137 +  have abab: "{a..b} \<subseteq> {?a..?b}" by(auto simp add:less_eq_vec_def forall_2 vector_2)
   3.138    guess z apply(rule fashoda[of ?P1 ?P2 ?a ?b])
   3.139      unfolding pathstart_join pathfinish_join pathstart_linepath pathfinish_linepath vector_2 proof-
   3.140      show "path ?P1" "path ?P2" using assms by auto
   3.141 @@ -318,11 +318,11 @@
   3.142      qed hence "z \<in> path_image f \<or> z \<in> path_image g" using z unfolding Un_iff by blast
   3.143      hence z':"z\<in>{a..b}" using assms(3-4) by auto
   3.144      have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart f $ 1 \<or> z $ 1 = pathfinish f $ 1) \<Longrightarrow> (z = pathstart f \<or> z = pathfinish f)"
   3.145 -      unfolding Cart_eq forall_2 assms by auto
   3.146 +      unfolding vec_eq_iff forall_2 assms by auto
   3.147      with z' show "z\<in>path_image f" using z(1) unfolding Un_iff mem_interval_cart forall_2 apply-
   3.148        apply(simp only: segment_vertical segment_horizontal vector_2) unfolding assms by auto
   3.149      have "a $ 2 = z $ 2 \<Longrightarrow> (z $ 1 = pathstart g $ 1 \<or> z $ 1 = pathfinish g $ 1) \<Longrightarrow> (z = pathstart g \<or> z = pathfinish g)"
   3.150 -      unfolding Cart_eq forall_2 assms by auto
   3.151 +      unfolding vec_eq_iff forall_2 assms by auto
   3.152      with z' show "z\<in>path_image g" using z(2) unfolding Un_iff mem_interval_cart forall_2 apply-
   3.153        apply(simp only: segment_vertical segment_horizontal vector_2) unfolding assms by auto
   3.154    qed qed
     4.1 --- a/src/HOL/Multivariate_Analysis/Finite_Cartesian_Product.thy	Wed Aug 10 10:13:16 2011 -0700
     4.2 +++ b/src/HOL/Multivariate_Analysis/Finite_Cartesian_Product.thy	Wed Aug 10 13:13:37 2011 -0700
     4.3 @@ -13,148 +13,148 @@
     4.4  
     4.5  subsection {* Finite Cartesian products, with indexing and lambdas. *}
     4.6  
     4.7 -typedef (open Cart)
     4.8 -  ('a, 'b) cart = "UNIV :: (('b::finite) \<Rightarrow> 'a) set"
     4.9 -  morphisms Cart_nth Cart_lambda ..
    4.10 +typedef (open)
    4.11 +  ('a, 'b) vec = "UNIV :: (('b::finite) \<Rightarrow> 'a) set"
    4.12 +  morphisms vec_nth vec_lambda ..
    4.13  
    4.14  notation
    4.15 -  Cart_nth (infixl "$" 90) and
    4.16 -  Cart_lambda (binder "\<chi>" 10)
    4.17 +  vec_nth (infixl "$" 90) and
    4.18 +  vec_lambda (binder "\<chi>" 10)
    4.19  
    4.20  (*
    4.21    Translate "'b ^ 'n" into "'b ^ ('n :: finite)". When 'n has already more than
    4.22 -  the finite type class write "cart 'b 'n"
    4.23 +  the finite type class write "vec 'b 'n"
    4.24  *)
    4.25  
    4.26 -syntax "_finite_cart" :: "type \<Rightarrow> type \<Rightarrow> type" ("(_ ^/ _)" [15, 16] 15)
    4.27 +syntax "_finite_vec" :: "type \<Rightarrow> type \<Rightarrow> type" ("(_ ^/ _)" [15, 16] 15)
    4.28  
    4.29  parse_translation {*
    4.30  let
    4.31 -  fun cart t u = Syntax.const @{type_syntax cart} $ t $ u;
    4.32 -  fun finite_cart_tr [t, u as Free (x, _)] =
    4.33 +  fun vec t u = Syntax.const @{type_syntax vec} $ t $ u;
    4.34 +  fun finite_vec_tr [t, u as Free (x, _)] =
    4.35          if Lexicon.is_tid x then
    4.36 -          cart t (Syntax.const @{syntax_const "_ofsort"} $ u $ Syntax.const @{class_syntax finite})
    4.37 -        else cart t u
    4.38 -    | finite_cart_tr [t, u] = cart t u
    4.39 +          vec t (Syntax.const @{syntax_const "_ofsort"} $ u $ Syntax.const @{class_syntax finite})
    4.40 +        else vec t u
    4.41 +    | finite_vec_tr [t, u] = vec t u
    4.42  in
    4.43 -  [(@{syntax_const "_finite_cart"}, finite_cart_tr)]
    4.44 +  [(@{syntax_const "_finite_vec"}, finite_vec_tr)]
    4.45  end
    4.46  *}
    4.47  
    4.48  lemma stupid_ext: "(\<forall>x. f x = g x) \<longleftrightarrow> (f = g)"
    4.49    by (auto intro: ext)
    4.50  
    4.51 -lemma Cart_eq: "(x = y) \<longleftrightarrow> (\<forall>i. x$i = y$i)"
    4.52 -  by (simp add: Cart_nth_inject [symmetric] fun_eq_iff)
    4.53 +lemma vec_eq_iff: "(x = y) \<longleftrightarrow> (\<forall>i. x$i = y$i)"
    4.54 +  by (simp add: vec_nth_inject [symmetric] fun_eq_iff)
    4.55  
    4.56 -lemma Cart_lambda_beta [simp]: "Cart_lambda g $ i = g i"
    4.57 -  by (simp add: Cart_lambda_inverse)
    4.58 +lemma vec_lambda_beta [simp]: "vec_lambda g $ i = g i"
    4.59 +  by (simp add: vec_lambda_inverse)
    4.60  
    4.61 -lemma Cart_lambda_unique: "(\<forall>i. f$i = g i) \<longleftrightarrow> Cart_lambda g = f"
    4.62 -  by (auto simp add: Cart_eq)
    4.63 +lemma vec_lambda_unique: "(\<forall>i. f$i = g i) \<longleftrightarrow> vec_lambda g = f"
    4.64 +  by (auto simp add: vec_eq_iff)
    4.65  
    4.66 -lemma Cart_lambda_eta: "(\<chi> i. (g$i)) = g"
    4.67 -  by (simp add: Cart_eq)
    4.68 +lemma vec_lambda_eta: "(\<chi> i. (g$i)) = g"
    4.69 +  by (simp add: vec_eq_iff)
    4.70  
    4.71  
    4.72  subsection {* Group operations and class instances *}
    4.73  
    4.74 -instantiation cart :: (zero,finite) zero
    4.75 +instantiation vec :: (zero, finite) zero
    4.76  begin
    4.77 -  definition vector_zero_def : "0 \<equiv> (\<chi> i. 0)"
    4.78 +  definition "0 \<equiv> (\<chi> i. 0)"
    4.79    instance ..
    4.80  end
    4.81  
    4.82 -instantiation cart :: (plus,finite) plus
    4.83 +instantiation vec :: (plus, finite) plus
    4.84  begin
    4.85 -  definition  vector_add_def : "op + \<equiv> (\<lambda> x y.  (\<chi> i. (x$i) + (y$i)))"
    4.86 +  definition "op + \<equiv> (\<lambda> x y. (\<chi> i. x$i + y$i))"
    4.87    instance ..
    4.88  end
    4.89  
    4.90 -instantiation cart :: (minus,finite) minus
    4.91 +instantiation vec :: (minus, finite) minus
    4.92  begin
    4.93 -  definition vector_minus_def : "op - \<equiv> (\<lambda> x y.  (\<chi> i. (x$i) - (y$i)))"
    4.94 +  definition "op - \<equiv> (\<lambda> x y. (\<chi> i. x$i - y$i))"
    4.95    instance ..
    4.96  end
    4.97  
    4.98 -instantiation cart :: (uminus,finite) uminus
    4.99 +instantiation vec :: (uminus, finite) uminus
   4.100  begin
   4.101 -  definition vector_uminus_def : "uminus \<equiv> (\<lambda> x.  (\<chi> i. - (x$i)))"
   4.102 +  definition "uminus \<equiv> (\<lambda> x. (\<chi> i. - (x$i)))"
   4.103    instance ..
   4.104  end
   4.105  
   4.106  lemma zero_index [simp]: "0 $ i = 0"
   4.107 -  unfolding vector_zero_def by simp
   4.108 +  unfolding zero_vec_def by simp
   4.109  
   4.110  lemma vector_add_component [simp]: "(x + y)$i = x$i + y$i"
   4.111 -  unfolding vector_add_def by simp
   4.112 +  unfolding plus_vec_def by simp
   4.113  
   4.114  lemma vector_minus_component [simp]: "(x - y)$i = x$i - y$i"
   4.115 -  unfolding vector_minus_def by simp
   4.116 +  unfolding minus_vec_def by simp
   4.117  
   4.118  lemma vector_uminus_component [simp]: "(- x)$i = - (x$i)"
   4.119 -  unfolding vector_uminus_def by simp
   4.120 +  unfolding uminus_vec_def by simp
   4.121  
   4.122 -instance cart :: (semigroup_add, finite) semigroup_add
   4.123 -  by default (simp add: Cart_eq add_assoc)
   4.124 +instance vec :: (semigroup_add, finite) semigroup_add
   4.125 +  by default (simp add: vec_eq_iff add_assoc)
   4.126  
   4.127 -instance cart :: (ab_semigroup_add, finite) ab_semigroup_add
   4.128 -  by default (simp add: Cart_eq add_commute)
   4.129 +instance vec :: (ab_semigroup_add, finite) ab_semigroup_add
   4.130 +  by default (simp add: vec_eq_iff add_commute)
   4.131  
   4.132 -instance cart :: (monoid_add, finite) monoid_add
   4.133 -  by default (simp_all add: Cart_eq)
   4.134 +instance vec :: (monoid_add, finite) monoid_add
   4.135 +  by default (simp_all add: vec_eq_iff)
   4.136  
   4.137 -instance cart :: (comm_monoid_add, finite) comm_monoid_add
   4.138 -  by default (simp add: Cart_eq)
   4.139 +instance vec :: (comm_monoid_add, finite) comm_monoid_add
   4.140 +  by default (simp add: vec_eq_iff)
   4.141  
   4.142 -instance cart :: (cancel_semigroup_add, finite) cancel_semigroup_add
   4.143 -  by default (simp_all add: Cart_eq)
   4.144 +instance vec :: (cancel_semigroup_add, finite) cancel_semigroup_add
   4.145 +  by default (simp_all add: vec_eq_iff)
   4.146  
   4.147 -instance cart :: (cancel_ab_semigroup_add, finite) cancel_ab_semigroup_add
   4.148 -  by default (simp add: Cart_eq)
   4.149 +instance vec :: (cancel_ab_semigroup_add, finite) cancel_ab_semigroup_add
   4.150 +  by default (simp add: vec_eq_iff)
   4.151  
   4.152 -instance cart :: (cancel_comm_monoid_add, finite) cancel_comm_monoid_add ..
   4.153 +instance vec :: (cancel_comm_monoid_add, finite) cancel_comm_monoid_add ..
   4.154  
   4.155 -instance cart :: (group_add, finite) group_add
   4.156 -  by default (simp_all add: Cart_eq diff_minus)
   4.157 +instance vec :: (group_add, finite) group_add
   4.158 +  by default (simp_all add: vec_eq_iff diff_minus)
   4.159  
   4.160 -instance cart :: (ab_group_add, finite) ab_group_add
   4.161 -  by default (simp_all add: Cart_eq)
   4.162 +instance vec :: (ab_group_add, finite) ab_group_add
   4.163 +  by default (simp_all add: vec_eq_iff)
   4.164  
   4.165  
   4.166  subsection {* Real vector space *}
   4.167  
   4.168 -instantiation cart :: (real_vector, finite) real_vector
   4.169 +instantiation vec :: (real_vector, finite) real_vector
   4.170  begin
   4.171  
   4.172 -definition vector_scaleR_def: "scaleR = (\<lambda> r x. (\<chi> i. scaleR r (x$i)))"
   4.173 +definition "scaleR \<equiv> (\<lambda> r x. (\<chi> i. scaleR r (x$i)))"
   4.174  
   4.175  lemma vector_scaleR_component [simp]: "(scaleR r x)$i = scaleR r (x$i)"
   4.176 -  unfolding vector_scaleR_def by simp
   4.177 +  unfolding scaleR_vec_def by simp
   4.178  
   4.179  instance
   4.180 -  by default (simp_all add: Cart_eq scaleR_left_distrib scaleR_right_distrib)
   4.181 +  by default (simp_all add: vec_eq_iff scaleR_left_distrib scaleR_right_distrib)
   4.182  
   4.183  end
   4.184  
   4.185  
   4.186  subsection {* Topological space *}
   4.187  
   4.188 -instantiation cart :: (topological_space, finite) topological_space
   4.189 +instantiation vec :: (topological_space, finite) topological_space
   4.190  begin
   4.191  
   4.192 -definition open_vector_def:
   4.193 +definition
   4.194    "open (S :: ('a ^ 'b) set) \<longleftrightarrow>
   4.195      (\<forall>x\<in>S. \<exists>A. (\<forall>i. open (A i) \<and> x$i \<in> A i) \<and>
   4.196        (\<forall>y. (\<forall>i. y$i \<in> A i) \<longrightarrow> y \<in> S))"
   4.197  
   4.198  instance proof
   4.199    show "open (UNIV :: ('a ^ 'b) set)"
   4.200 -    unfolding open_vector_def by auto
   4.201 +    unfolding open_vec_def by auto
   4.202  next
   4.203    fix S T :: "('a ^ 'b) set"
   4.204    assume "open S" "open T" thus "open (S \<inter> T)"
   4.205 -    unfolding open_vector_def
   4.206 +    unfolding open_vec_def
   4.207      apply clarify
   4.208      apply (drule (1) bspec)+
   4.209      apply (clarify, rename_tac Sa Ta)
   4.210 @@ -164,7 +164,7 @@
   4.211  next
   4.212    fix K :: "('a ^ 'b) set set"
   4.213    assume "\<forall>S\<in>K. open S" thus "open (\<Union>K)"
   4.214 -    unfolding open_vector_def
   4.215 +    unfolding open_vec_def
   4.216      apply clarify
   4.217      apply (drule (1) bspec)
   4.218      apply (drule (1) bspec)
   4.219 @@ -177,32 +177,32 @@
   4.220  end
   4.221  
   4.222  lemma open_vector_box: "\<forall>i. open (S i) \<Longrightarrow> open {x. \<forall>i. x $ i \<in> S i}"
   4.223 -unfolding open_vector_def by auto
   4.224 +  unfolding open_vec_def by auto
   4.225  
   4.226 -lemma open_vimage_Cart_nth: "open S \<Longrightarrow> open ((\<lambda>x. x $ i) -` S)"
   4.227 -unfolding open_vector_def
   4.228 -apply clarify
   4.229 -apply (rule_tac x="\<lambda>k. if k = i then S else UNIV" in exI, simp)
   4.230 -done
   4.231 +lemma open_vimage_vec_nth: "open S \<Longrightarrow> open ((\<lambda>x. x $ i) -` S)"
   4.232 +  unfolding open_vec_def
   4.233 +  apply clarify
   4.234 +  apply (rule_tac x="\<lambda>k. if k = i then S else UNIV" in exI, simp)
   4.235 +  done
   4.236  
   4.237 -lemma closed_vimage_Cart_nth: "closed S \<Longrightarrow> closed ((\<lambda>x. x $ i) -` S)"
   4.238 -unfolding closed_open vimage_Compl [symmetric]
   4.239 -by (rule open_vimage_Cart_nth)
   4.240 +lemma closed_vimage_vec_nth: "closed S \<Longrightarrow> closed ((\<lambda>x. x $ i) -` S)"
   4.241 +  unfolding closed_open vimage_Compl [symmetric]
   4.242 +  by (rule open_vimage_vec_nth)
   4.243  
   4.244  lemma closed_vector_box: "\<forall>i. closed (S i) \<Longrightarrow> closed {x. \<forall>i. x $ i \<in> S i}"
   4.245  proof -
   4.246    have "{x. \<forall>i. x $ i \<in> S i} = (\<Inter>i. (\<lambda>x. x $ i) -` S i)" by auto
   4.247    thus "\<forall>i. closed (S i) \<Longrightarrow> closed {x. \<forall>i. x $ i \<in> S i}"
   4.248 -    by (simp add: closed_INT closed_vimage_Cart_nth)
   4.249 +    by (simp add: closed_INT closed_vimage_vec_nth)
   4.250  qed
   4.251  
   4.252 -lemma tendsto_Cart_nth [tendsto_intros]:
   4.253 +lemma tendsto_vec_nth [tendsto_intros]:
   4.254    assumes "((\<lambda>x. f x) ---> a) net"
   4.255    shows "((\<lambda>x. f x $ i) ---> a $ i) net"
   4.256  proof (rule topological_tendstoI)
   4.257    fix S assume "open S" "a $ i \<in> S"
   4.258    then have "open ((\<lambda>y. y $ i) -` S)" "a \<in> ((\<lambda>y. y $ i) -` S)"
   4.259 -    by (simp_all add: open_vimage_Cart_nth)
   4.260 +    by (simp_all add: open_vimage_vec_nth)
   4.261    with assms have "eventually (\<lambda>x. f x \<in> (\<lambda>y. y $ i) -` S) net"
   4.262      by (rule topological_tendstoD)
   4.263    then show "eventually (\<lambda>x. f x $ i \<in> S) net"
   4.264 @@ -220,14 +220,14 @@
   4.265    shows "eventually (\<lambda>x. \<forall>y. P x y) net"
   4.266  using eventually_Ball_finite [of UNIV P] assms by simp
   4.267  
   4.268 -lemma tendsto_vector:
   4.269 +lemma vec_tendstoI:
   4.270    assumes "\<And>i. ((\<lambda>x. f x $ i) ---> a $ i) net"
   4.271    shows "((\<lambda>x. f x) ---> a) net"
   4.272  proof (rule topological_tendstoI)
   4.273    fix S assume "open S" and "a \<in> S"
   4.274    then obtain A where A: "\<And>i. open (A i)" "\<And>i. a $ i \<in> A i"
   4.275      and S: "\<And>y. \<forall>i. y $ i \<in> A i \<Longrightarrow> y \<in> S"
   4.276 -    unfolding open_vector_def by metis
   4.277 +    unfolding open_vec_def by metis
   4.278    have "\<And>i. eventually (\<lambda>x. f x $ i \<in> A i) net"
   4.279      using assms A by (rule topological_tendstoD)
   4.280    hence "eventually (\<lambda>x. \<forall>i. f x $ i \<in> A i) net"
   4.281 @@ -236,10 +236,10 @@
   4.282      by (rule eventually_elim1, simp add: S)
   4.283  qed
   4.284  
   4.285 -lemma tendsto_Cart_lambda [tendsto_intros]:
   4.286 +lemma tendsto_vec_lambda [tendsto_intros]:
   4.287    assumes "\<And>i. ((\<lambda>x. f x i) ---> a i) net"
   4.288    shows "((\<lambda>x. \<chi> i. f x i) ---> (\<chi> i. a i)) net"
   4.289 -using assms by (simp add: tendsto_vector)
   4.290 +  using assms by (simp add: vec_tendstoI)
   4.291  
   4.292  
   4.293  subsection {* Metric *}
   4.294 @@ -251,25 +251,24 @@
   4.295  apply (rule_tac x="f(x:=y)" in exI, simp)
   4.296  done
   4.297  
   4.298 -instantiation cart :: (metric_space, finite) metric_space
   4.299 +instantiation vec :: (metric_space, finite) metric_space
   4.300  begin
   4.301  
   4.302 -definition dist_vector_def:
   4.303 +definition
   4.304    "dist x y = setL2 (\<lambda>i. dist (x$i) (y$i)) UNIV"
   4.305  
   4.306 -lemma dist_nth_le_cart: "dist (x $ i) (y $ i) \<le> dist x y"
   4.307 -unfolding dist_vector_def
   4.308 -by (rule member_le_setL2) simp_all
   4.309 +lemma dist_vec_nth_le: "dist (x $ i) (y $ i) \<le> dist x y"
   4.310 +  unfolding dist_vec_def by (rule member_le_setL2) simp_all
   4.311  
   4.312  instance proof
   4.313    fix x y :: "'a ^ 'b"
   4.314    show "dist x y = 0 \<longleftrightarrow> x = y"
   4.315 -    unfolding dist_vector_def
   4.316 -    by (simp add: setL2_eq_0_iff Cart_eq)
   4.317 +    unfolding dist_vec_def
   4.318 +    by (simp add: setL2_eq_0_iff vec_eq_iff)
   4.319  next
   4.320    fix x y z :: "'a ^ 'b"
   4.321    show "dist x y \<le> dist x z + dist y z"
   4.322 -    unfolding dist_vector_def
   4.323 +    unfolding dist_vec_def
   4.324      apply (rule order_trans [OF _ setL2_triangle_ineq])
   4.325      apply (simp add: setL2_mono dist_triangle2)
   4.326      done
   4.327 @@ -277,7 +276,7 @@
   4.328    (* FIXME: long proof! *)
   4.329    fix S :: "('a ^ 'b) set"
   4.330    show "open S \<longleftrightarrow> (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S)"
   4.331 -    unfolding open_vector_def open_dist
   4.332 +    unfolding open_vec_def open_dist
   4.333      apply safe
   4.334       apply (drule (1) bspec)
   4.335       apply clarify
   4.336 @@ -286,7 +285,7 @@
   4.337        apply (rule_tac x=e in exI, clarify)
   4.338        apply (drule spec, erule mp, clarify)
   4.339        apply (drule spec, drule spec, erule mp)
   4.340 -      apply (erule le_less_trans [OF dist_nth_le_cart])
   4.341 +      apply (erule le_less_trans [OF dist_vec_nth_le])
   4.342       apply (subgoal_tac "\<forall>i\<in>UNIV. \<exists>e>0. \<forall>y. dist y (x$i) < e \<longrightarrow> y \<in> A i")
   4.343        apply (drule finite_choice [OF finite], clarify)
   4.344        apply (rule_tac x="Min (range f)" in exI, simp)
   4.345 @@ -308,7 +307,7 @@
   4.346        apply simp
   4.347       apply clarify
   4.348       apply (drule spec, erule mp)
   4.349 -     apply (simp add: dist_vector_def setL2_strict_mono)
   4.350 +     apply (simp add: dist_vec_def setL2_strict_mono)
   4.351      apply (rule_tac x="\<lambda>i. e / sqrt (of_nat CARD('b))" in exI)
   4.352      apply (simp add: divide_pos_pos setL2_constant)
   4.353      done
   4.354 @@ -316,11 +315,11 @@
   4.355  
   4.356  end
   4.357  
   4.358 -lemma Cauchy_Cart_nth:
   4.359 +lemma Cauchy_vec_nth:
   4.360    "Cauchy (\<lambda>n. X n) \<Longrightarrow> Cauchy (\<lambda>n. X n $ i)"
   4.361 -unfolding Cauchy_def by (fast intro: le_less_trans [OF dist_nth_le_cart])
   4.362 +  unfolding Cauchy_def by (fast intro: le_less_trans [OF dist_vec_nth_le])
   4.363  
   4.364 -lemma Cauchy_vector:
   4.365 +lemma vec_CauchyI:
   4.366    fixes X :: "nat \<Rightarrow> 'a::metric_space ^ 'n"
   4.367    assumes X: "\<And>i. Cauchy (\<lambda>n. X n $ i)"
   4.368    shows "Cauchy (\<lambda>n. X n)"
   4.369 @@ -340,7 +339,7 @@
   4.370      fix m n :: nat
   4.371      assume "M \<le> m" "M \<le> n"
   4.372      have "dist (X m) (X n) = setL2 (\<lambda>i. dist (X m $ i) (X n $ i)) UNIV"
   4.373 -      unfolding dist_vector_def ..
   4.374 +      unfolding dist_vec_def ..
   4.375      also have "\<dots> \<le> setsum (\<lambda>i. dist (X m $ i) (X n $ i)) UNIV"
   4.376        by (rule setL2_le_setsum [OF zero_le_dist])
   4.377      also have "\<dots> < setsum (\<lambda>i::'n. ?s) UNIV"
   4.378 @@ -354,14 +353,14 @@
   4.379    then show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. dist (X m) (X n) < r" ..
   4.380  qed
   4.381  
   4.382 -instance cart :: (complete_space, finite) complete_space
   4.383 +instance vec :: (complete_space, finite) complete_space
   4.384  proof
   4.385    fix X :: "nat \<Rightarrow> 'a ^ 'b" assume "Cauchy X"
   4.386    have "\<And>i. (\<lambda>n. X n $ i) ----> lim (\<lambda>n. X n $ i)"
   4.387 -    using Cauchy_Cart_nth [OF `Cauchy X`]
   4.388 +    using Cauchy_vec_nth [OF `Cauchy X`]
   4.389      by (simp add: Cauchy_convergent_iff convergent_LIMSEQ_iff)
   4.390 -  hence "X ----> Cart_lambda (\<lambda>i. lim (\<lambda>n. X n $ i))"
   4.391 -    by (simp add: tendsto_vector)
   4.392 +  hence "X ----> vec_lambda (\<lambda>i. lim (\<lambda>n. X n $ i))"
   4.393 +    by (simp add: vec_tendstoI)
   4.394    then show "convergent X"
   4.395      by (rule convergentI)
   4.396  qed
   4.397 @@ -369,11 +368,10 @@
   4.398  
   4.399  subsection {* Normed vector space *}
   4.400  
   4.401 -instantiation cart :: (real_normed_vector, finite) real_normed_vector
   4.402 +instantiation vec :: (real_normed_vector, finite) real_normed_vector
   4.403  begin
   4.404  
   4.405 -definition norm_vector_def:
   4.406 -  "norm x = setL2 (\<lambda>i. norm (x$i)) UNIV"
   4.407 +definition "norm x = setL2 (\<lambda>i. norm (x$i)) UNIV"
   4.408  
   4.409  definition vector_sgn_def:
   4.410    "sgn (x::'a^'b) = scaleR (inverse (norm x)) x"
   4.411 @@ -381,69 +379,68 @@
   4.412  instance proof
   4.413    fix a :: real and x y :: "'a ^ 'b"
   4.414    show "0 \<le> norm x"
   4.415 -    unfolding norm_vector_def
   4.416 +    unfolding norm_vec_def
   4.417      by (rule setL2_nonneg)
   4.418    show "norm x = 0 \<longleftrightarrow> x = 0"
   4.419 -    unfolding norm_vector_def
   4.420 -    by (simp add: setL2_eq_0_iff Cart_eq)
   4.421 +    unfolding norm_vec_def
   4.422 +    by (simp add: setL2_eq_0_iff vec_eq_iff)
   4.423    show "norm (x + y) \<le> norm x + norm y"
   4.424 -    unfolding norm_vector_def
   4.425 +    unfolding norm_vec_def
   4.426      apply (rule order_trans [OF _ setL2_triangle_ineq])
   4.427      apply (simp add: setL2_mono norm_triangle_ineq)
   4.428      done
   4.429    show "norm (scaleR a x) = \<bar>a\<bar> * norm x"
   4.430 -    unfolding norm_vector_def
   4.431 +    unfolding norm_vec_def
   4.432      by (simp add: setL2_right_distrib)
   4.433    show "sgn x = scaleR (inverse (norm x)) x"
   4.434      by (rule vector_sgn_def)
   4.435    show "dist x y = norm (x - y)"
   4.436 -    unfolding dist_vector_def norm_vector_def
   4.437 +    unfolding dist_vec_def norm_vec_def
   4.438      by (simp add: dist_norm)
   4.439  qed
   4.440  
   4.441  end
   4.442  
   4.443  lemma norm_nth_le: "norm (x $ i) \<le> norm x"
   4.444 -unfolding norm_vector_def
   4.445 +unfolding norm_vec_def
   4.446  by (rule member_le_setL2) simp_all
   4.447  
   4.448 -interpretation Cart_nth: bounded_linear "\<lambda>x. x $ i"
   4.449 +interpretation vec_nth: bounded_linear "\<lambda>x. x $ i"
   4.450  apply default
   4.451  apply (rule vector_add_component)
   4.452  apply (rule vector_scaleR_component)
   4.453  apply (rule_tac x="1" in exI, simp add: norm_nth_le)
   4.454  done
   4.455  
   4.456 -instance cart :: (banach, finite) banach ..
   4.457 +instance vec :: (banach, finite) banach ..
   4.458  
   4.459  
   4.460  subsection {* Inner product space *}
   4.461  
   4.462 -instantiation cart :: (real_inner, finite) real_inner
   4.463 +instantiation vec :: (real_inner, finite) real_inner
   4.464  begin
   4.465  
   4.466 -definition inner_vector_def:
   4.467 -  "inner x y = setsum (\<lambda>i. inner (x$i) (y$i)) UNIV"
   4.468 +definition "inner x y = setsum (\<lambda>i. inner (x$i) (y$i)) UNIV"
   4.469  
   4.470  instance proof
   4.471    fix r :: real and x y z :: "'a ^ 'b"
   4.472    show "inner x y = inner y x"
   4.473 -    unfolding inner_vector_def
   4.474 +    unfolding inner_vec_def
   4.475      by (simp add: inner_commute)
   4.476    show "inner (x + y) z = inner x z + inner y z"
   4.477 -    unfolding inner_vector_def
   4.478 +    unfolding inner_vec_def
   4.479      by (simp add: inner_add_left setsum_addf)
   4.480    show "inner (scaleR r x) y = r * inner x y"
   4.481 -    unfolding inner_vector_def
   4.482 +    unfolding inner_vec_def
   4.483      by (simp add: setsum_right_distrib)
   4.484    show "0 \<le> inner x x"
   4.485 -    unfolding inner_vector_def
   4.486 +    unfolding inner_vec_def
   4.487      by (simp add: setsum_nonneg)
   4.488    show "inner x x = 0 \<longleftrightarrow> x = 0"
   4.489 -    unfolding inner_vector_def
   4.490 -    by (simp add: Cart_eq setsum_nonneg_eq_0_iff)
   4.491 +    unfolding inner_vec_def
   4.492 +    by (simp add: vec_eq_iff setsum_nonneg_eq_0_iff)
   4.493    show "norm x = sqrt (inner x x)"
   4.494 -    unfolding inner_vector_def norm_vector_def setL2_def
   4.495 +    unfolding inner_vec_def norm_vec_def setL2_def
   4.496      by (simp add: power2_norm_eq_inner)
   4.497  qed
   4.498  
   4.499 @@ -453,16 +450,16 @@
   4.500  
   4.501  text {* A bijection between @{text "'n::finite"} and @{text "{..<CARD('n)}"} *}
   4.502  
   4.503 -definition cart_bij_nat :: "nat \<Rightarrow> ('n::finite)" where
   4.504 -  "cart_bij_nat = (SOME p. bij_betw p {..<CARD('n)} (UNIV::'n set) )"
   4.505 +definition vec_bij_nat :: "nat \<Rightarrow> ('n::finite)" where
   4.506 +  "vec_bij_nat = (SOME p. bij_betw p {..<CARD('n)} (UNIV::'n set) )"
   4.507  
   4.508 -abbreviation "\<pi> \<equiv> cart_bij_nat"
   4.509 +abbreviation "\<pi> \<equiv> vec_bij_nat"
   4.510  definition "\<pi>' = inv_into {..<CARD('n)} (\<pi>::nat \<Rightarrow> ('n::finite))"
   4.511  
   4.512  lemma bij_betw_pi:
   4.513    "bij_betw \<pi> {..<CARD('n::finite)} (UNIV::('n::finite) set)"
   4.514    using ex_bij_betw_nat_finite[of "UNIV::'n set"]
   4.515 -  by (auto simp: cart_bij_nat_def atLeast0LessThan
   4.516 +  by (auto simp: vec_bij_nat_def atLeast0LessThan
   4.517      intro!: someI_ex[of "\<lambda>x. bij_betw x {..<CARD('n)} (UNIV::'n set)"])
   4.518  
   4.519  lemma bij_betw_pi'[intro]: "bij_betw \<pi>' (UNIV::'n set) {..<CARD('n::finite)}"
   4.520 @@ -486,7 +483,7 @@
   4.521  lemma \<pi>_inj_on: "inj_on (\<pi>::nat\<Rightarrow>'n::finite) {..<CARD('n)}"
   4.522    using bij_betw_pi[where 'n='n] by (simp add: bij_betw_def)
   4.523  
   4.524 -instantiation cart :: (euclidean_space, finite) euclidean_space
   4.525 +instantiation vec :: (euclidean_space, finite) euclidean_space
   4.526  begin
   4.527  
   4.528  definition "dimension (t :: ('a ^ 'b) itself) = CARD('b) * DIM('a)"
   4.529 @@ -503,7 +500,7 @@
   4.530    have "j + i * DIM('a) <  DIM('a) * (i + 1)" using assms by (auto simp: field_simps)
   4.531    also have "\<dots> \<le> DIM('a) * CARD('b)" using assms unfolding mult_le_cancel1 by auto
   4.532    finally show ?thesis
   4.533 -    unfolding basis_cart_def using assms by (auto simp: Cart_eq not_less field_simps)
   4.534 +    unfolding basis_vec_def using assms by (auto simp: vec_eq_iff not_less field_simps)
   4.535  qed
   4.536  
   4.537  lemma basis_eq_pi':
   4.538 @@ -551,7 +548,7 @@
   4.539  qed
   4.540  
   4.541  lemma DIM_cart[simp]: "DIM('a^'b) = CARD('b) * DIM('a)"
   4.542 -  by (rule dimension_cart_def)
   4.543 +  by (rule dimension_vec_def)
   4.544  
   4.545  lemma all_less_DIM_cart:
   4.546    fixes m n :: nat
   4.547 @@ -582,17 +579,17 @@
   4.548  
   4.549  instance proof
   4.550    show "0 < DIM('a ^ 'b)"
   4.551 -    unfolding dimension_cart_def
   4.552 +    unfolding dimension_vec_def
   4.553      by (intro mult_pos_pos zero_less_card_finite DIM_positive)
   4.554  next
   4.555    fix i :: nat
   4.556    assume "DIM('a ^ 'b) \<le> i" thus "basis i = (0::'a^'b)"
   4.557 -    unfolding dimension_cart_def basis_cart_def
   4.558 +    unfolding dimension_vec_def basis_vec_def
   4.559      by simp
   4.560  next
   4.561    show "\<forall>i<DIM('a ^ 'b). \<forall>j<DIM('a ^ 'b).
   4.562      inner (basis i :: 'a ^ 'b) (basis j) = (if i = j then 1 else 0)"
   4.563 -    apply (simp add: inner_vector_def)
   4.564 +    apply (simp add: inner_vec_def)
   4.565      apply safe
   4.566      apply (erule split_CARD_DIM, simp add: basis_eq_pi')
   4.567      apply (simp add: inner_if setsum_delta cong: if_cong)
   4.568 @@ -605,11 +602,11 @@
   4.569    fix x :: "'a ^ 'b"
   4.570    show "(\<forall>i<DIM('a ^ 'b). inner (basis i) x = 0) \<longleftrightarrow> x = 0"
   4.571      unfolding all_less_DIM_cart
   4.572 -    unfolding inner_vector_def
   4.573 +    unfolding inner_vec_def
   4.574      apply (simp add: basis_eq_pi')
   4.575      apply (simp add: inner_if setsum_delta cong: if_cong)
   4.576      apply (simp add: euclidean_all_zero)
   4.577 -    apply (simp add: Cart_eq)
   4.578 +    apply (simp add: vec_eq_iff)
   4.579      done
   4.580  qed
   4.581