src/HOL/Library/Inner_Product.thy
changeset 57512 cc97b347b301
parent 56381 0556204bc230
child 57514 bdc2c6b40bf2
equal deleted inserted replaced
57511:de51a86fc903 57512:cc97b347b301
   134     qed
   134     qed
   135   have "sqrt (a\<^sup>2 * inner x x) = \<bar>a\<bar> * sqrt (inner x x)"
   135   have "sqrt (a\<^sup>2 * inner x x) = \<bar>a\<bar> * sqrt (inner x x)"
   136     by (simp add: real_sqrt_mult_distrib)
   136     by (simp add: real_sqrt_mult_distrib)
   137   then show "norm (a *\<^sub>R x) = \<bar>a\<bar> * norm x"
   137   then show "norm (a *\<^sub>R x) = \<bar>a\<bar> * norm x"
   138     unfolding norm_eq_sqrt_inner
   138     unfolding norm_eq_sqrt_inner
   139     by (simp add: power2_eq_square mult_assoc)
   139     by (simp add: power2_eq_square mult.assoc)
   140 qed
   140 qed
   141 
   141 
   142 end
   142 end
   143 
   143 
   144 text {*
   144 text {*
   207 definition inner_real_def [simp]: "inner = op *"
   207 definition inner_real_def [simp]: "inner = op *"
   208 
   208 
   209 instance proof
   209 instance proof
   210   fix x y z r :: real
   210   fix x y z r :: real
   211   show "inner x y = inner y x"
   211   show "inner x y = inner y x"
   212     unfolding inner_real_def by (rule mult_commute)
   212     unfolding inner_real_def by (rule mult.commute)
   213   show "inner (x + y) z = inner x z + inner y z"
   213   show "inner (x + y) z = inner x z + inner y z"
   214     unfolding inner_real_def by (rule distrib_right)
   214     unfolding inner_real_def by (rule distrib_right)
   215   show "inner (scaleR r x) y = r * inner x y"
   215   show "inner (scaleR r x) y = r * inner x y"
   216     unfolding inner_real_def real_scaleR_def by (rule mult_assoc)
   216     unfolding inner_real_def real_scaleR_def by (rule mult.assoc)
   217   show "0 \<le> inner x x"
   217   show "0 \<le> inner x x"
   218     unfolding inner_real_def by simp
   218     unfolding inner_real_def by simp
   219   show "inner x x = 0 \<longleftrightarrow> x = 0"
   219   show "inner x x = 0 \<longleftrightarrow> x = 0"
   220     unfolding inner_real_def by simp
   220     unfolding inner_real_def by simp
   221   show "norm x = sqrt (inner x x)"
   221   show "norm x = sqrt (inner x x)"
   231   "inner x y = Re x * Re y + Im x * Im y"
   231   "inner x y = Re x * Re y + Im x * Im y"
   232 
   232 
   233 instance proof
   233 instance proof
   234   fix x y z :: complex and r :: real
   234   fix x y z :: complex and r :: real
   235   show "inner x y = inner y x"
   235   show "inner x y = inner y x"
   236     unfolding inner_complex_def by (simp add: mult_commute)
   236     unfolding inner_complex_def by (simp add: mult.commute)
   237   show "inner (x + y) z = inner x z + inner y z"
   237   show "inner (x + y) z = inner x z + inner y z"
   238     unfolding inner_complex_def by (simp add: distrib_right)
   238     unfolding inner_complex_def by (simp add: distrib_right)
   239   show "inner (scaleR r x) y = r * inner x y"
   239   show "inner (scaleR r x) y = r * inner x y"
   240     unfolding inner_complex_def by (simp add: distrib_left)
   240     unfolding inner_complex_def by (simp add: distrib_left)
   241   show "0 \<le> inner x x"
   241   show "0 \<le> inner x x"