src/HOL/Analysis/Linear_Algebra.thy
changeset 73933 fa92bc604c59
parent 73932 fd21b4a93043
parent 73885 26171a89466a
child 74729 64b3d8d9bd10
equal deleted inserted replaced
73932:fd21b4a93043 73933:fa92bc604c59
  1238       apply (rule exI[where x="c - 1"], simp add: scaleR_left_diff_distrib)
  1238       apply (rule exI[where x="c - 1"], simp add: scaleR_left_diff_distrib)
  1239       done
  1239       done
  1240   qed
  1240   qed
  1241 qed
  1241 qed
  1242 
  1242 
       
  1243 lemma collinear_iff_Reals: "collinear {0::complex,w,z} \<longleftrightarrow> z/w \<in> \<real>"
       
  1244 proof
       
  1245   show "z/w \<in> \<real> \<Longrightarrow> collinear {0,w,z}"
       
  1246     by (metis Reals_cases collinear_lemma nonzero_divide_eq_eq scaleR_conv_of_real)
       
  1247 qed (auto simp: collinear_lemma scaleR_conv_of_real)
       
  1248 
       
  1249 lemma collinear_scaleR_iff: "collinear {0, \<alpha> *\<^sub>R w, \<beta> *\<^sub>R z} \<longleftrightarrow> collinear {0,w,z} \<or> \<alpha>=0 \<or> \<beta>=0"
       
  1250   (is "?lhs = ?rhs")
       
  1251 proof (cases "\<alpha>=0 \<or> \<beta>=0")
       
  1252   case False
       
  1253   then have "(\<exists>c. \<beta> *\<^sub>R z = (c * \<alpha>) *\<^sub>R w) = (\<exists>c. z = c *\<^sub>R w)"
       
  1254     by (metis mult.commute scaleR_scaleR vector_fraction_eq_iff)
       
  1255   then show ?thesis
       
  1256     by (auto simp add: collinear_lemma)
       
  1257 qed (auto simp: collinear_lemma)
       
  1258 
  1243 lemma norm_cauchy_schwarz_equal: "\<bar>x \<bullet> y\<bar> = norm x * norm y \<longleftrightarrow> collinear {0, x, y}"
  1259 lemma norm_cauchy_schwarz_equal: "\<bar>x \<bullet> y\<bar> = norm x * norm y \<longleftrightarrow> collinear {0, x, y}"
  1244 proof (cases "x=0")
  1260 proof (cases "x=0")
  1245   case True
  1261   case True
  1246   then show ?thesis
  1262   then show ?thesis
  1247     by (auto simp: insert_commute)
  1263     by (auto simp: insert_commute)
  1259     assume "collinear {0, x, y}"
  1275     assume "collinear {0, x, y}"
  1260     with False show "\<bar>x \<bullet> y\<bar> = norm x * norm y"
  1276     with False show "\<bar>x \<bullet> y\<bar> = norm x * norm y"
  1261       unfolding norm_cauchy_schwarz_abs_eq collinear_lemma  by (auto simp: abs_if)
  1277       unfolding norm_cauchy_schwarz_abs_eq collinear_lemma  by (auto simp: abs_if)
  1262   qed
  1278   qed
  1263 qed
  1279 qed
       
  1280 
       
  1281 lemma norm_triangle_eq_imp_collinear:
       
  1282   fixes x y :: "'a::real_inner"
       
  1283   assumes "norm (x + y) = norm x + norm y"
       
  1284   shows "collinear{0,x,y}"
       
  1285 proof (cases "x = 0 \<or> y = 0")
       
  1286   case False
       
  1287   with assms show ?thesis
       
  1288     by (meson norm_cauchy_schwarz_abs_eq norm_cauchy_schwarz_equal norm_triangle_eq)
       
  1289 qed (use collinear_lemma in blast)
  1264 
  1290 
  1265 
  1291 
  1266 subsection\<open>Properties of special hyperplanes\<close>
  1292 subsection\<open>Properties of special hyperplanes\<close>
  1267 
  1293 
  1268 lemma subspace_hyperplane: "subspace {x. a \<bullet> x = 0}"
  1294 lemma subspace_hyperplane: "subspace {x. a \<bullet> x = 0}"