src/HOL/Analysis/Inner_Product.thy
changeset 67962 0acdcd8f4ba1
parent 67399 eab6ce8368fa
child 67986 b65c4a6a015e
equal deleted inserted replaced
67961:9c31678d2139 67962:0acdcd8f4ba1
    25   (@{const_name uniformity}, SOME @{typ "('a::uniformity \<times> 'a) filter"})\<close>
    25   (@{const_name uniformity}, SOME @{typ "('a::uniformity \<times> 'a) filter"})\<close>
    26 
    26 
    27 setup \<open>Sign.add_const_constraint
    27 setup \<open>Sign.add_const_constraint
    28   (@{const_name norm}, SOME @{typ "'a::norm \<Rightarrow> real"})\<close>
    28   (@{const_name norm}, SOME @{typ "'a::norm \<Rightarrow> real"})\<close>
    29 
    29 
    30 class real_inner = real_vector + sgn_div_norm + dist_norm + uniformity_dist + open_uniformity +
    30 class%important real_inner = real_vector + sgn_div_norm + dist_norm + uniformity_dist + open_uniformity +
    31   fixes inner :: "'a \<Rightarrow> 'a \<Rightarrow> real"
    31   fixes inner :: "'a \<Rightarrow> 'a \<Rightarrow> real"
    32   assumes inner_commute: "inner x y = inner y x"
    32   assumes inner_commute: "inner x y = inner y x"
    33   and inner_add_left: "inner (x + y) z = inner x z + inner y z"
    33   and inner_add_left: "inner (x + y) z = inner x z + inner y z"
    34   and inner_scaleR_left [simp]: "inner (scaleR r x) y = r * (inner x y)"
    34   and inner_scaleR_left [simp]: "inner (scaleR r x) y = r * (inner x y)"
    35   and inner_ge_zero [simp]: "0 \<le> inner x x"
    35   and inner_ge_zero [simp]: "0 \<le> inner x x"
   234   unfolding differentiable_def by (blast intro: has_derivative_inner)
   234   unfolding differentiable_def by (blast intro: has_derivative_inner)
   235 
   235 
   236 
   236 
   237 subsection \<open>Class instances\<close>
   237 subsection \<open>Class instances\<close>
   238 
   238 
   239 instantiation real :: real_inner
   239 instantiation%important real :: real_inner
   240 begin
   240 begin
   241 
   241 
   242 definition inner_real_def [simp]: "inner = ( * )"
   242 definition inner_real_def [simp]: "inner = ( * )"
   243 
   243 
   244 instance
   244 instance
   263 lemma
   263 lemma
   264   shows real_inner_1_left[simp]: "inner 1 x = x"
   264   shows real_inner_1_left[simp]: "inner 1 x = x"
   265     and real_inner_1_right[simp]: "inner x 1 = x"
   265     and real_inner_1_right[simp]: "inner x 1 = x"
   266   by simp_all
   266   by simp_all
   267 
   267 
   268 instantiation complex :: real_inner
   268 instantiation%important complex :: real_inner
   269 begin
   269 begin
   270 
   270 
   271 definition inner_complex_def:
   271 definition inner_complex_def:
   272   "inner x y = Re x * Re y + Im x * Im y"
   272   "inner x y = Re x * Re y + Im x * Im y"
   273 
   273 
   355 qed (auto intro: summable_of_real)
   355 qed (auto intro: summable_of_real)
   356 
   356 
   357 
   357 
   358 subsection \<open>Gradient derivative\<close>
   358 subsection \<open>Gradient derivative\<close>
   359 
   359 
   360 definition
   360 definition%important
   361   gderiv ::
   361   gderiv ::
   362     "['a::real_inner \<Rightarrow> real, 'a, 'a] \<Rightarrow> bool"
   362     "['a::real_inner \<Rightarrow> real, 'a, 'a] \<Rightarrow> bool"
   363           ("(GDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
   363           ("(GDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
   364 where
   364 where
   365   "GDERIV f x :> D \<longleftrightarrow> FDERIV f x :> (\<lambda>h. inner h D)"
   365   "GDERIV f x :> D \<longleftrightarrow> FDERIV f x :> (\<lambda>h. inner h D)"