src/HOL/Real_Vector_Spaces.thy
changeset 61524 f2e51e704a96
parent 61169 4de9ff3ea29a
child 61531 ab2e862263e7
equal deleted inserted replaced
61523:9ad1fccbba96 61524:f2e51e704a96
   732 proof -
   732 proof -
   733   have "norm (- (b - a)) = norm (b - a)"
   733   have "norm (- (b - a)) = norm (b - a)"
   734     by (rule norm_minus_cancel)
   734     by (rule norm_minus_cancel)
   735   thus ?thesis by simp
   735   thus ?thesis by simp
   736 qed
   736 qed
       
   737 
       
   738 lemma norm_uminus_minus: "norm (-x - y :: 'a :: real_normed_vector) = norm (x + y)"
       
   739   by (subst (2) norm_minus_cancel[symmetric], subst minus_add_distrib) simp
   737 
   740 
   738 lemma norm_triangle_ineq2:
   741 lemma norm_triangle_ineq2:
   739   fixes a b :: "'a::real_normed_vector"
   742   fixes a b :: "'a::real_normed_vector"
   740   shows "norm a - norm b \<le> norm (a - b)"
   743   shows "norm a - norm b \<le> norm (a - b)"
   741 proof -
   744 proof -
  1279   unfolding dist_norm by simp
  1282   unfolding dist_norm by simp
  1280 
  1283 
  1281 lemma dist_diff [simp]: "dist a (a - b) = norm b"  "dist (a - b) a = norm b"
  1284 lemma dist_diff [simp]: "dist a (a - b) = norm b"  "dist (a - b) a = norm b"
  1282   by (simp_all add: dist_norm)
  1285   by (simp_all add: dist_norm)
  1283   
  1286   
       
  1287 lemma dist_of_int: "dist (of_int m) (of_int n :: 'a :: real_normed_algebra_1) = of_int \<bar>m - n\<bar>"
       
  1288 proof -
       
  1289   have "dist (of_int m) (of_int n :: 'a) = dist (of_int m :: 'a) (of_int m - (of_int (m - n)))"
       
  1290     by simp
       
  1291   also have "\<dots> = of_int \<bar>m - n\<bar>" by (subst dist_diff, subst norm_of_int) simp
       
  1292   finally show ?thesis .
       
  1293 qed
       
  1294 
       
  1295 lemma dist_of_nat: 
       
  1296   "dist (of_nat m) (of_nat n :: 'a :: real_normed_algebra_1) = of_int \<bar>int m - int n\<bar>"
       
  1297   by (subst (1 2) of_int_of_nat_eq [symmetric]) (rule dist_of_int)
       
  1298   
  1284 subsection \<open>Bounded Linear and Bilinear Operators\<close>
  1299 subsection \<open>Bounded Linear and Bilinear Operators\<close>
  1285 
  1300 
  1286 locale linear = additive f for f :: "'a::real_vector \<Rightarrow> 'b::real_vector" +
  1301 locale linear = additive f for f :: "'a::real_vector \<Rightarrow> 'b::real_vector" +
  1287   assumes scaleR: "f (scaleR r x) = scaleR r (f x)"
  1302   assumes scaleR: "f (scaleR r x) = scaleR r (f x)"
  1288 
  1303