src/HOL/Library/Inner_Product.thy
author wenzelm
Tue Aug 13 16:25:47 2013 +0200 (2013-08-13)
changeset 53015 a1119cf551e8
parent 51642 400ec5ae7f8f
child 53938 eb93cca4589a
permissions -rw-r--r--
standardized symbols via "isabelle update_sub_sup", excluding src/Pure and src/Tools/WWW_Find;
wenzelm@41959
     1
(*  Title:      HOL/Library/Inner_Product.thy
wenzelm@41959
     2
    Author:     Brian Huffman
huffman@29993
     3
*)
huffman@29993
     4
huffman@29993
     5
header {* Inner Product Spaces and the Gradient Derivative *}
huffman@29993
     6
huffman@29993
     7
theory Inner_Product
hoelzl@51642
     8
imports "~~/src/HOL/Complex_Main"
huffman@29993
     9
begin
huffman@29993
    10
huffman@29993
    11
subsection {* Real inner product spaces *}
huffman@29993
    12
huffman@31492
    13
text {*
huffman@31492
    14
  Temporarily relax type constraints for @{term "open"},
huffman@31492
    15
  @{term dist}, and @{term norm}.
huffman@31492
    16
*}
huffman@31492
    17
huffman@31492
    18
setup {* Sign.add_const_constraint
huffman@31492
    19
  (@{const_name "open"}, SOME @{typ "'a::open set \<Rightarrow> bool"}) *}
huffman@31446
    20
huffman@31446
    21
setup {* Sign.add_const_constraint
huffman@31446
    22
  (@{const_name dist}, SOME @{typ "'a::dist \<Rightarrow> 'a \<Rightarrow> real"}) *}
huffman@31446
    23
huffman@31446
    24
setup {* Sign.add_const_constraint
huffman@31446
    25
  (@{const_name norm}, SOME @{typ "'a::norm \<Rightarrow> real"}) *}
huffman@31446
    26
huffman@31492
    27
class real_inner = real_vector + sgn_div_norm + dist_norm + open_dist +
huffman@29993
    28
  fixes inner :: "'a \<Rightarrow> 'a \<Rightarrow> real"
huffman@29993
    29
  assumes inner_commute: "inner x y = inner y x"
huffman@31590
    30
  and inner_add_left: "inner (x + y) z = inner x z + inner y z"
huffman@31590
    31
  and inner_scaleR_left [simp]: "inner (scaleR r x) y = r * (inner x y)"
huffman@29993
    32
  and inner_ge_zero [simp]: "0 \<le> inner x x"
huffman@29993
    33
  and inner_eq_zero_iff [simp]: "inner x x = 0 \<longleftrightarrow> x = 0"
huffman@29993
    34
  and norm_eq_sqrt_inner: "norm x = sqrt (inner x x)"
huffman@29993
    35
begin
huffman@29993
    36
huffman@29993
    37
lemma inner_zero_left [simp]: "inner 0 x = 0"
huffman@31590
    38
  using inner_add_left [of 0 0 x] by simp
huffman@29993
    39
huffman@29993
    40
lemma inner_minus_left [simp]: "inner (- x) y = - inner x y"
huffman@31590
    41
  using inner_add_left [of x "- x" y] by simp
huffman@29993
    42
huffman@29993
    43
lemma inner_diff_left: "inner (x - y) z = inner x z - inner y z"
huffman@31590
    44
  by (simp add: diff_minus inner_add_left)
huffman@29993
    45
huffman@44282
    46
lemma inner_setsum_left: "inner (\<Sum>x\<in>A. f x) y = (\<Sum>x\<in>A. inner (f x) y)"
huffman@44282
    47
  by (cases "finite A", induct set: finite, simp_all add: inner_add_left)
huffman@44282
    48
huffman@29993
    49
text {* Transfer distributivity rules to right argument. *}
huffman@29993
    50
huffman@31590
    51
lemma inner_add_right: "inner x (y + z) = inner x y + inner x z"
huffman@31590
    52
  using inner_add_left [of y z x] by (simp only: inner_commute)
huffman@29993
    53
huffman@31590
    54
lemma inner_scaleR_right [simp]: "inner x (scaleR r y) = r * (inner x y)"
huffman@29993
    55
  using inner_scaleR_left [of r y x] by (simp only: inner_commute)
huffman@29993
    56
huffman@29993
    57
lemma inner_zero_right [simp]: "inner x 0 = 0"
huffman@29993
    58
  using inner_zero_left [of x] by (simp only: inner_commute)
huffman@29993
    59
huffman@29993
    60
lemma inner_minus_right [simp]: "inner x (- y) = - inner x y"
huffman@29993
    61
  using inner_minus_left [of y x] by (simp only: inner_commute)
huffman@29993
    62
huffman@29993
    63
lemma inner_diff_right: "inner x (y - z) = inner x y - inner x z"
huffman@29993
    64
  using inner_diff_left [of y z x] by (simp only: inner_commute)
huffman@29993
    65
huffman@44282
    66
lemma inner_setsum_right: "inner x (\<Sum>y\<in>A. f y) = (\<Sum>y\<in>A. inner x (f y))"
huffman@44282
    67
  using inner_setsum_left [of f A x] by (simp only: inner_commute)
huffman@44282
    68
huffman@31590
    69
lemmas inner_add [algebra_simps] = inner_add_left inner_add_right
huffman@31590
    70
lemmas inner_diff [algebra_simps]  = inner_diff_left inner_diff_right
huffman@31590
    71
lemmas inner_scaleR = inner_scaleR_left inner_scaleR_right
huffman@31590
    72
huffman@31590
    73
text {* Legacy theorem names *}
huffman@31590
    74
lemmas inner_left_distrib = inner_add_left
huffman@31590
    75
lemmas inner_right_distrib = inner_add_right
huffman@29993
    76
lemmas inner_distrib = inner_left_distrib inner_right_distrib
huffman@29993
    77
huffman@29993
    78
lemma inner_gt_zero_iff [simp]: "0 < inner x x \<longleftrightarrow> x \<noteq> 0"
huffman@29993
    79
  by (simp add: order_less_le)
huffman@29993
    80
wenzelm@53015
    81
lemma power2_norm_eq_inner: "(norm x)\<^sup>2 = inner x x"
huffman@29993
    82
  by (simp add: norm_eq_sqrt_inner)
huffman@29993
    83
huffman@30046
    84
lemma Cauchy_Schwarz_ineq:
wenzelm@53015
    85
  "(inner x y)\<^sup>2 \<le> inner x x * inner y y"
huffman@29993
    86
proof (cases)
huffman@29993
    87
  assume "y = 0"
huffman@29993
    88
  thus ?thesis by simp
huffman@29993
    89
next
huffman@29993
    90
  assume y: "y \<noteq> 0"
huffman@29993
    91
  let ?r = "inner x y / inner y y"
huffman@29993
    92
  have "0 \<le> inner (x - scaleR ?r y) (x - scaleR ?r y)"
huffman@29993
    93
    by (rule inner_ge_zero)
huffman@29993
    94
  also have "\<dots> = inner x x - inner y x * ?r"
huffman@31590
    95
    by (simp add: inner_diff)
wenzelm@53015
    96
  also have "\<dots> = inner x x - (inner x y)\<^sup>2 / inner y y"
huffman@29993
    97
    by (simp add: power2_eq_square inner_commute)
wenzelm@53015
    98
  finally have "0 \<le> inner x x - (inner x y)\<^sup>2 / inner y y" .
wenzelm@53015
    99
  hence "(inner x y)\<^sup>2 / inner y y \<le> inner x x"
huffman@29993
   100
    by (simp add: le_diff_eq)
wenzelm@53015
   101
  thus "(inner x y)\<^sup>2 \<le> inner x x * inner y y"
huffman@29993
   102
    by (simp add: pos_divide_le_eq y)
huffman@29993
   103
qed
huffman@29993
   104
huffman@30046
   105
lemma Cauchy_Schwarz_ineq2:
huffman@29993
   106
  "\<bar>inner x y\<bar> \<le> norm x * norm y"
huffman@29993
   107
proof (rule power2_le_imp_le)
wenzelm@53015
   108
  have "(inner x y)\<^sup>2 \<le> inner x x * inner y y"
huffman@30046
   109
    using Cauchy_Schwarz_ineq .
wenzelm@53015
   110
  thus "\<bar>inner x y\<bar>\<^sup>2 \<le> (norm x * norm y)\<^sup>2"
huffman@29993
   111
    by (simp add: power_mult_distrib power2_norm_eq_inner)
huffman@29993
   112
  show "0 \<le> norm x * norm y"
huffman@29993
   113
    unfolding norm_eq_sqrt_inner
huffman@29993
   114
    by (intro mult_nonneg_nonneg real_sqrt_ge_zero inner_ge_zero)
huffman@29993
   115
qed
huffman@29993
   116
huffman@29993
   117
subclass real_normed_vector
huffman@29993
   118
proof
huffman@29993
   119
  fix a :: real and x y :: 'a
huffman@29993
   120
  show "norm x = 0 \<longleftrightarrow> x = 0"
huffman@29993
   121
    unfolding norm_eq_sqrt_inner by simp
huffman@29993
   122
  show "norm (x + y) \<le> norm x + norm y"
huffman@29993
   123
    proof (rule power2_le_imp_le)
huffman@29993
   124
      have "inner x y \<le> norm x * norm y"
huffman@30046
   125
        by (rule order_trans [OF abs_ge_self Cauchy_Schwarz_ineq2])
wenzelm@53015
   126
      thus "(norm (x + y))\<^sup>2 \<le> (norm x + norm y)\<^sup>2"
huffman@29993
   127
        unfolding power2_sum power2_norm_eq_inner
huffman@31590
   128
        by (simp add: inner_add inner_commute)
huffman@29993
   129
      show "0 \<le> norm x + norm y"
huffman@44126
   130
        unfolding norm_eq_sqrt_inner by simp
huffman@29993
   131
    qed
wenzelm@53015
   132
  have "sqrt (a\<^sup>2 * inner x x) = \<bar>a\<bar> * sqrt (inner x x)"
huffman@29993
   133
    by (simp add: real_sqrt_mult_distrib)
huffman@29993
   134
  then show "norm (a *\<^sub>R x) = \<bar>a\<bar> * norm x"
huffman@29993
   135
    unfolding norm_eq_sqrt_inner
huffman@31590
   136
    by (simp add: power2_eq_square mult_assoc)
huffman@29993
   137
qed
huffman@29993
   138
huffman@29993
   139
end
huffman@29993
   140
huffman@31492
   141
text {*
huffman@31492
   142
  Re-enable constraints for @{term "open"},
huffman@31492
   143
  @{term dist}, and @{term norm}.
huffman@31492
   144
*}
huffman@31492
   145
huffman@31492
   146
setup {* Sign.add_const_constraint
huffman@31492
   147
  (@{const_name "open"}, SOME @{typ "'a::topological_space set \<Rightarrow> bool"}) *}
huffman@31446
   148
huffman@31446
   149
setup {* Sign.add_const_constraint
huffman@31446
   150
  (@{const_name dist}, SOME @{typ "'a::metric_space \<Rightarrow> 'a \<Rightarrow> real"}) *}
huffman@31446
   151
huffman@31446
   152
setup {* Sign.add_const_constraint
huffman@31446
   153
  (@{const_name norm}, SOME @{typ "'a::real_normed_vector \<Rightarrow> real"}) *}
huffman@31446
   154
huffman@44282
   155
lemma bounded_bilinear_inner:
huffman@44282
   156
  "bounded_bilinear (inner::'a::real_inner \<Rightarrow> 'a \<Rightarrow> real)"
huffman@29993
   157
proof
huffman@29993
   158
  fix x y z :: 'a and r :: real
huffman@29993
   159
  show "inner (x + y) z = inner x z + inner y z"
huffman@31590
   160
    by (rule inner_add_left)
huffman@29993
   161
  show "inner x (y + z) = inner x y + inner x z"
huffman@31590
   162
    by (rule inner_add_right)
huffman@29993
   163
  show "inner (scaleR r x) y = scaleR r (inner x y)"
huffman@29993
   164
    unfolding real_scaleR_def by (rule inner_scaleR_left)
huffman@29993
   165
  show "inner x (scaleR r y) = scaleR r (inner x y)"
huffman@29993
   166
    unfolding real_scaleR_def by (rule inner_scaleR_right)
huffman@29993
   167
  show "\<exists>K. \<forall>x y::'a. norm (inner x y) \<le> norm x * norm y * K"
huffman@29993
   168
  proof
huffman@29993
   169
    show "\<forall>x y::'a. norm (inner x y) \<le> norm x * norm y * 1"
huffman@30046
   170
      by (simp add: Cauchy_Schwarz_ineq2)
huffman@29993
   171
  qed
huffman@29993
   172
qed
huffman@29993
   173
huffman@44282
   174
lemmas tendsto_inner [tendsto_intros] =
huffman@44282
   175
  bounded_bilinear.tendsto [OF bounded_bilinear_inner]
huffman@44282
   176
huffman@44282
   177
lemmas isCont_inner [simp] =
huffman@44282
   178
  bounded_bilinear.isCont [OF bounded_bilinear_inner]
huffman@29993
   179
hoelzl@51642
   180
lemmas FDERIV_inner [FDERIV_intros] =
huffman@44282
   181
  bounded_bilinear.FDERIV [OF bounded_bilinear_inner]
huffman@29993
   182
huffman@44282
   183
lemmas bounded_linear_inner_left =
huffman@44282
   184
  bounded_bilinear.bounded_linear_left [OF bounded_bilinear_inner]
huffman@44282
   185
huffman@44282
   186
lemmas bounded_linear_inner_right =
huffman@44282
   187
  bounded_bilinear.bounded_linear_right [OF bounded_bilinear_inner]
huffman@44233
   188
hoelzl@51642
   189
lemmas FDERIV_inner_right [FDERIV_intros] =
hoelzl@51642
   190
  bounded_linear.FDERIV [OF bounded_linear_inner_right]
hoelzl@51642
   191
hoelzl@51642
   192
lemmas FDERIV_inner_left [FDERIV_intros] =
hoelzl@51642
   193
  bounded_linear.FDERIV [OF bounded_linear_inner_left]
hoelzl@51642
   194
hoelzl@51642
   195
lemma differentiable_inner [simp]:
hoelzl@51642
   196
  "f differentiable x in s \<Longrightarrow> g differentiable x in s \<Longrightarrow> (\<lambda>x. inner (f x) (g x)) differentiable x in s"
hoelzl@51642
   197
  unfolding isDiff_def by (blast intro: FDERIV_inner)
huffman@29993
   198
huffman@29993
   199
subsection {* Class instances *}
huffman@29993
   200
huffman@29993
   201
instantiation real :: real_inner
huffman@29993
   202
begin
huffman@29993
   203
huffman@29993
   204
definition inner_real_def [simp]: "inner = op *"
huffman@29993
   205
huffman@29993
   206
instance proof
huffman@29993
   207
  fix x y z r :: real
huffman@29993
   208
  show "inner x y = inner y x"
huffman@29993
   209
    unfolding inner_real_def by (rule mult_commute)
huffman@29993
   210
  show "inner (x + y) z = inner x z + inner y z"
webertj@49962
   211
    unfolding inner_real_def by (rule distrib_right)
huffman@29993
   212
  show "inner (scaleR r x) y = r * inner x y"
huffman@29993
   213
    unfolding inner_real_def real_scaleR_def by (rule mult_assoc)
huffman@29993
   214
  show "0 \<le> inner x x"
huffman@29993
   215
    unfolding inner_real_def by simp
huffman@29993
   216
  show "inner x x = 0 \<longleftrightarrow> x = 0"
huffman@29993
   217
    unfolding inner_real_def by simp
huffman@29993
   218
  show "norm x = sqrt (inner x x)"
huffman@29993
   219
    unfolding inner_real_def by simp
huffman@29993
   220
qed
huffman@29993
   221
huffman@29993
   222
end
huffman@29993
   223
huffman@29993
   224
instantiation complex :: real_inner
huffman@29993
   225
begin
huffman@29993
   226
huffman@29993
   227
definition inner_complex_def:
huffman@29993
   228
  "inner x y = Re x * Re y + Im x * Im y"
huffman@29993
   229
huffman@29993
   230
instance proof
huffman@29993
   231
  fix x y z :: complex and r :: real
huffman@29993
   232
  show "inner x y = inner y x"
huffman@29993
   233
    unfolding inner_complex_def by (simp add: mult_commute)
huffman@29993
   234
  show "inner (x + y) z = inner x z + inner y z"
webertj@49962
   235
    unfolding inner_complex_def by (simp add: distrib_right)
huffman@29993
   236
  show "inner (scaleR r x) y = r * inner x y"
webertj@49962
   237
    unfolding inner_complex_def by (simp add: distrib_left)
huffman@29993
   238
  show "0 \<le> inner x x"
huffman@44126
   239
    unfolding inner_complex_def by simp
huffman@29993
   240
  show "inner x x = 0 \<longleftrightarrow> x = 0"
huffman@29993
   241
    unfolding inner_complex_def
huffman@29993
   242
    by (simp add: add_nonneg_eq_0_iff complex_Re_Im_cancel_iff)
huffman@29993
   243
  show "norm x = sqrt (inner x x)"
huffman@29993
   244
    unfolding inner_complex_def complex_norm_def
huffman@29993
   245
    by (simp add: power2_eq_square)
huffman@29993
   246
qed
huffman@29993
   247
huffman@29993
   248
end
huffman@29993
   249
huffman@44902
   250
lemma complex_inner_1 [simp]: "inner 1 x = Re x"
huffman@44902
   251
  unfolding inner_complex_def by simp
huffman@44902
   252
huffman@44902
   253
lemma complex_inner_1_right [simp]: "inner x 1 = Re x"
huffman@44902
   254
  unfolding inner_complex_def by simp
huffman@44902
   255
huffman@44902
   256
lemma complex_inner_ii_left [simp]: "inner ii x = Im x"
huffman@44902
   257
  unfolding inner_complex_def by simp
huffman@44902
   258
huffman@44902
   259
lemma complex_inner_ii_right [simp]: "inner x ii = Im x"
huffman@44902
   260
  unfolding inner_complex_def by simp
huffman@44902
   261
huffman@29993
   262
huffman@29993
   263
subsection {* Gradient derivative *}
huffman@29993
   264
huffman@29993
   265
definition
huffman@29993
   266
  gderiv ::
huffman@29993
   267
    "['a::real_inner \<Rightarrow> real, 'a, 'a] \<Rightarrow> bool"
huffman@29993
   268
          ("(GDERIV (_)/ (_)/ :> (_))" [1000, 1000, 60] 60)
huffman@29993
   269
where
huffman@29993
   270
  "GDERIV f x :> D \<longleftrightarrow> FDERIV f x :> (\<lambda>h. inner h D)"
huffman@29993
   271
huffman@29993
   272
lemma gderiv_deriv [simp]: "GDERIV f x :> D \<longleftrightarrow> DERIV f x :> D"
huffman@29993
   273
  by (simp only: gderiv_def deriv_fderiv inner_real_def)
huffman@29993
   274
huffman@29993
   275
lemma GDERIV_DERIV_compose:
huffman@29993
   276
    "\<lbrakk>GDERIV f x :> df; DERIV g (f x) :> dg\<rbrakk>
huffman@29993
   277
     \<Longrightarrow> GDERIV (\<lambda>x. g (f x)) x :> scaleR dg df"
huffman@29993
   278
  unfolding gderiv_def deriv_fderiv
huffman@29993
   279
  apply (drule (1) FDERIV_compose)
huffman@31590
   280
  apply (simp add: mult_ac)
huffman@29993
   281
  done
huffman@29993
   282
huffman@29993
   283
lemma FDERIV_subst: "\<lbrakk>FDERIV f x :> df; df = d\<rbrakk> \<Longrightarrow> FDERIV f x :> d"
huffman@29993
   284
  by simp
huffman@29993
   285
huffman@29993
   286
lemma GDERIV_subst: "\<lbrakk>GDERIV f x :> df; df = d\<rbrakk> \<Longrightarrow> GDERIV f x :> d"
huffman@29993
   287
  by simp
huffman@29993
   288
huffman@29993
   289
lemma GDERIV_const: "GDERIV (\<lambda>x. k) x :> 0"
huffman@44282
   290
  unfolding gderiv_def inner_zero_right by (rule FDERIV_const)
huffman@29993
   291
huffman@29993
   292
lemma GDERIV_add:
huffman@29993
   293
    "\<lbrakk>GDERIV f x :> df; GDERIV g x :> dg\<rbrakk>
huffman@29993
   294
     \<Longrightarrow> GDERIV (\<lambda>x. f x + g x) x :> df + dg"
huffman@44282
   295
  unfolding gderiv_def inner_add_right by (rule FDERIV_add)
huffman@29993
   296
huffman@29993
   297
lemma GDERIV_minus:
huffman@29993
   298
    "GDERIV f x :> df \<Longrightarrow> GDERIV (\<lambda>x. - f x) x :> - df"
huffman@44282
   299
  unfolding gderiv_def inner_minus_right by (rule FDERIV_minus)
huffman@29993
   300
huffman@29993
   301
lemma GDERIV_diff:
huffman@29993
   302
    "\<lbrakk>GDERIV f x :> df; GDERIV g x :> dg\<rbrakk>
huffman@29993
   303
     \<Longrightarrow> GDERIV (\<lambda>x. f x - g x) x :> df - dg"
huffman@44282
   304
  unfolding gderiv_def inner_diff_right by (rule FDERIV_diff)
huffman@29993
   305
huffman@29993
   306
lemma GDERIV_scaleR:
huffman@29993
   307
    "\<lbrakk>DERIV f x :> df; GDERIV g x :> dg\<rbrakk>
huffman@29993
   308
     \<Longrightarrow> GDERIV (\<lambda>x. scaleR (f x) (g x)) x
huffman@29993
   309
      :> (scaleR (f x) dg + scaleR df (g x))"
huffman@44282
   310
  unfolding gderiv_def deriv_fderiv inner_add_right inner_scaleR_right
huffman@29993
   311
  apply (rule FDERIV_subst)
huffman@44282
   312
  apply (erule (1) FDERIV_scaleR)
huffman@29993
   313
  apply (simp add: mult_ac)
huffman@29993
   314
  done
huffman@29993
   315
huffman@29993
   316
lemma GDERIV_mult:
huffman@29993
   317
    "\<lbrakk>GDERIV f x :> df; GDERIV g x :> dg\<rbrakk>
huffman@29993
   318
     \<Longrightarrow> GDERIV (\<lambda>x. f x * g x) x :> scaleR (f x) dg + scaleR (g x) df"
huffman@29993
   319
  unfolding gderiv_def
huffman@29993
   320
  apply (rule FDERIV_subst)
huffman@29993
   321
  apply (erule (1) FDERIV_mult)
huffman@31590
   322
  apply (simp add: inner_add mult_ac)
huffman@29993
   323
  done
huffman@29993
   324
huffman@29993
   325
lemma GDERIV_inverse:
huffman@29993
   326
    "\<lbrakk>GDERIV f x :> df; f x \<noteq> 0\<rbrakk>
wenzelm@53015
   327
     \<Longrightarrow> GDERIV (\<lambda>x. inverse (f x)) x :> - (inverse (f x))\<^sup>2 *\<^sub>R df"
huffman@29993
   328
  apply (erule GDERIV_DERIV_compose)
huffman@29993
   329
  apply (erule DERIV_inverse [folded numeral_2_eq_2])
huffman@29993
   330
  done
huffman@29993
   331
huffman@29993
   332
lemma GDERIV_norm:
huffman@29993
   333
  assumes "x \<noteq> 0" shows "GDERIV (\<lambda>x. norm x) x :> sgn x"
huffman@29993
   334
proof -
huffman@29993
   335
  have 1: "FDERIV (\<lambda>x. inner x x) x :> (\<lambda>h. inner x h + inner h x)"
huffman@44282
   336
    by (intro FDERIV_inner FDERIV_ident)
huffman@29993
   337
  have 2: "(\<lambda>h. inner x h + inner h x) = (\<lambda>h. inner h (scaleR 2 x))"
nipkow@39302
   338
    by (simp add: fun_eq_iff inner_commute)
huffman@29993
   339
  have "0 < inner x x" using `x \<noteq> 0` by simp
huffman@29993
   340
  then have 3: "DERIV sqrt (inner x x) :> (inverse (sqrt (inner x x)) / 2)"
huffman@29993
   341
    by (rule DERIV_real_sqrt)
huffman@29993
   342
  have 4: "(inverse (sqrt (inner x x)) / 2) *\<^sub>R 2 *\<^sub>R x = sgn x"
huffman@29993
   343
    by (simp add: sgn_div_norm norm_eq_sqrt_inner)
huffman@29993
   344
  show ?thesis
huffman@29993
   345
    unfolding norm_eq_sqrt_inner
huffman@29993
   346
    apply (rule GDERIV_subst [OF _ 4])
huffman@29993
   347
    apply (rule GDERIV_DERIV_compose [where g=sqrt and df="scaleR 2 x"])
huffman@29993
   348
    apply (subst gderiv_def)
huffman@29993
   349
    apply (rule FDERIV_subst [OF _ 2])
huffman@29993
   350
    apply (rule 1)
huffman@29993
   351
    apply (rule 3)
huffman@29993
   352
    done
huffman@29993
   353
qed
huffman@29993
   354
huffman@29993
   355
lemmas FDERIV_norm = GDERIV_norm [unfolded gderiv_def]
huffman@29993
   356
huffman@29993
   357
end