src/HOL/Real/RealVector.thy
author huffman
Mon May 14 20:48:32 2007 +0200 (2007-05-14)
changeset 22973 64d300e16370
parent 22972 3e96b98d37c6
child 23113 d5cdaa3b7517
permissions -rw-r--r--
add lemma sgn_mult; declare real_scaleR_def and scaleR_eq_0_iff as simp rules
huffman@20504
     1
(*  Title       : RealVector.thy
huffman@20504
     2
    ID:         $Id$
huffman@20504
     3
    Author      : Brian Huffman
huffman@20504
     4
*)
huffman@20504
     5
huffman@20504
     6
header {* Vector Spaces and Algebras over the Reals *}
huffman@20504
     7
huffman@20504
     8
theory RealVector
huffman@20684
     9
imports RealPow
huffman@20504
    10
begin
huffman@20504
    11
huffman@20504
    12
subsection {* Locale for additive functions *}
huffman@20504
    13
huffman@20504
    14
locale additive =
huffman@20504
    15
  fixes f :: "'a::ab_group_add \<Rightarrow> 'b::ab_group_add"
huffman@20504
    16
  assumes add: "f (x + y) = f x + f y"
huffman@20504
    17
huffman@20504
    18
lemma (in additive) zero: "f 0 = 0"
huffman@20504
    19
proof -
huffman@20504
    20
  have "f 0 = f (0 + 0)" by simp
huffman@20504
    21
  also have "\<dots> = f 0 + f 0" by (rule add)
huffman@20504
    22
  finally show "f 0 = 0" by simp
huffman@20504
    23
qed
huffman@20504
    24
huffman@20504
    25
lemma (in additive) minus: "f (- x) = - f x"
huffman@20504
    26
proof -
huffman@20504
    27
  have "f (- x) + f x = f (- x + x)" by (rule add [symmetric])
huffman@20504
    28
  also have "\<dots> = - f x + f x" by (simp add: zero)
huffman@20504
    29
  finally show "f (- x) = - f x" by (rule add_right_imp_eq)
huffman@20504
    30
qed
huffman@20504
    31
huffman@20504
    32
lemma (in additive) diff: "f (x - y) = f x - f y"
huffman@20504
    33
by (simp add: diff_def add minus)
huffman@20504
    34
huffman@22942
    35
lemma (in additive) setsum: "f (setsum g A) = (\<Sum>x\<in>A. f (g x))"
huffman@22942
    36
apply (cases "finite A")
huffman@22942
    37
apply (induct set: finite)
huffman@22942
    38
apply (simp add: zero)
huffman@22942
    39
apply (simp add: add)
huffman@22942
    40
apply (simp add: zero)
huffman@22942
    41
done
huffman@22942
    42
huffman@20504
    43
huffman@20504
    44
subsection {* Real vector spaces *}
huffman@20504
    45
huffman@22636
    46
class scaleR = type +
huffman@22636
    47
  fixes scaleR :: "real \<Rightarrow> 'a \<Rightarrow> 'a"
huffman@20504
    48
huffman@22636
    49
notation
huffman@22636
    50
  scaleR (infixr "*#" 75)
huffman@20504
    51
huffman@20763
    52
abbreviation
wenzelm@21404
    53
  divideR :: "'a \<Rightarrow> real \<Rightarrow> 'a::scaleR" (infixl "'/#" 70) where
huffman@21809
    54
  "x /# r == scaleR (inverse r) x"
huffman@20763
    55
wenzelm@21210
    56
notation (xsymbols)
wenzelm@21404
    57
  scaleR (infixr "*\<^sub>R" 75) and
huffman@20763
    58
  divideR (infixl "'/\<^sub>R" 70)
huffman@20504
    59
huffman@22636
    60
instance real :: scaleR
huffman@22973
    61
  real_scaleR_def [simp]: "scaleR a x \<equiv> a * x" ..
huffman@20554
    62
huffman@20504
    63
axclass real_vector < scaleR, ab_group_add
huffman@21809
    64
  scaleR_right_distrib: "scaleR a (x + y) = scaleR a x + scaleR a y"
huffman@21809
    65
  scaleR_left_distrib: "scaleR (a + b) x = scaleR a x + scaleR b x"
huffman@21809
    66
  scaleR_scaleR [simp]: "scaleR a (scaleR b x) = scaleR (a * b) x"
huffman@21809
    67
  scaleR_one [simp]: "scaleR 1 x = x"
huffman@20504
    68
huffman@20504
    69
axclass real_algebra < real_vector, ring
huffman@21809
    70
  mult_scaleR_left [simp]: "scaleR a x * y = scaleR a (x * y)"
huffman@21809
    71
  mult_scaleR_right [simp]: "x * scaleR a y = scaleR a (x * y)"
huffman@20504
    72
huffman@20554
    73
axclass real_algebra_1 < real_algebra, ring_1
huffman@20554
    74
huffman@20584
    75
axclass real_div_algebra < real_algebra_1, division_ring
huffman@20584
    76
huffman@20584
    77
axclass real_field < real_div_algebra, field
huffman@20584
    78
huffman@20584
    79
instance real :: real_field
huffman@20554
    80
apply (intro_classes, unfold real_scaleR_def)
huffman@20554
    81
apply (rule right_distrib)
huffman@20554
    82
apply (rule left_distrib)
huffman@20763
    83
apply (rule mult_assoc [symmetric])
huffman@20554
    84
apply (rule mult_1_left)
huffman@20554
    85
apply (rule mult_assoc)
huffman@20554
    86
apply (rule mult_left_commute)
huffman@20554
    87
done
huffman@20554
    88
huffman@20504
    89
lemma scaleR_left_commute:
huffman@20504
    90
  fixes x :: "'a::real_vector"
huffman@21809
    91
  shows "scaleR a (scaleR b x) = scaleR b (scaleR a x)"
huffman@20763
    92
by (simp add: mult_commute)
huffman@20504
    93
huffman@21809
    94
lemma additive_scaleR_right: "additive (\<lambda>x. scaleR a x::'a::real_vector)"
huffman@20504
    95
by (rule additive.intro, rule scaleR_right_distrib)
huffman@20504
    96
huffman@21809
    97
lemma additive_scaleR_left: "additive (\<lambda>a. scaleR a x::'a::real_vector)"
huffman@20504
    98
by (rule additive.intro, rule scaleR_left_distrib)
huffman@20504
    99
huffman@20504
   100
lemmas scaleR_zero_left [simp] =
huffman@20504
   101
  additive.zero [OF additive_scaleR_left, standard]
huffman@20504
   102
huffman@20504
   103
lemmas scaleR_zero_right [simp] =
huffman@20504
   104
  additive.zero [OF additive_scaleR_right, standard]
huffman@20504
   105
huffman@20504
   106
lemmas scaleR_minus_left [simp] =
huffman@20504
   107
  additive.minus [OF additive_scaleR_left, standard]
huffman@20504
   108
huffman@20504
   109
lemmas scaleR_minus_right [simp] =
huffman@20504
   110
  additive.minus [OF additive_scaleR_right, standard]
huffman@20504
   111
huffman@20504
   112
lemmas scaleR_left_diff_distrib =
huffman@20504
   113
  additive.diff [OF additive_scaleR_left, standard]
huffman@20504
   114
huffman@20504
   115
lemmas scaleR_right_diff_distrib =
huffman@20504
   116
  additive.diff [OF additive_scaleR_right, standard]
huffman@20504
   117
huffman@22973
   118
lemma scaleR_eq_0_iff [simp]:
huffman@20554
   119
  fixes x :: "'a::real_vector"
huffman@21809
   120
  shows "(scaleR a x = 0) = (a = 0 \<or> x = 0)"
huffman@20554
   121
proof cases
huffman@20554
   122
  assume "a = 0" thus ?thesis by simp
huffman@20554
   123
next
huffman@20554
   124
  assume anz [simp]: "a \<noteq> 0"
huffman@21809
   125
  { assume "scaleR a x = 0"
huffman@21809
   126
    hence "scaleR (inverse a) (scaleR a x) = 0" by simp
huffman@20763
   127
    hence "x = 0" by simp }
huffman@20554
   128
  thus ?thesis by force
huffman@20554
   129
qed
huffman@20554
   130
huffman@20554
   131
lemma scaleR_left_imp_eq:
huffman@20554
   132
  fixes x y :: "'a::real_vector"
huffman@21809
   133
  shows "\<lbrakk>a \<noteq> 0; scaleR a x = scaleR a y\<rbrakk> \<Longrightarrow> x = y"
huffman@20554
   134
proof -
huffman@20554
   135
  assume nonzero: "a \<noteq> 0"
huffman@21809
   136
  assume "scaleR a x = scaleR a y"
huffman@21809
   137
  hence "scaleR a (x - y) = 0"
huffman@20554
   138
     by (simp add: scaleR_right_diff_distrib)
huffman@22973
   139
  hence "x - y = 0" by (simp add: nonzero)
huffman@20554
   140
  thus "x = y" by simp
huffman@20554
   141
qed
huffman@20554
   142
huffman@20554
   143
lemma scaleR_right_imp_eq:
huffman@20554
   144
  fixes x y :: "'a::real_vector"
huffman@21809
   145
  shows "\<lbrakk>x \<noteq> 0; scaleR a x = scaleR b x\<rbrakk> \<Longrightarrow> a = b"
huffman@20554
   146
proof -
huffman@20554
   147
  assume nonzero: "x \<noteq> 0"
huffman@21809
   148
  assume "scaleR a x = scaleR b x"
huffman@21809
   149
  hence "scaleR (a - b) x = 0"
huffman@20554
   150
     by (simp add: scaleR_left_diff_distrib)
huffman@22973
   151
  hence "a - b = 0" by (simp add: nonzero)
huffman@20554
   152
  thus "a = b" by simp
huffman@20554
   153
qed
huffman@20554
   154
huffman@20554
   155
lemma scaleR_cancel_left:
huffman@20554
   156
  fixes x y :: "'a::real_vector"
huffman@21809
   157
  shows "(scaleR a x = scaleR a y) = (x = y \<or> a = 0)"
huffman@20554
   158
by (auto intro: scaleR_left_imp_eq)
huffman@20554
   159
huffman@20554
   160
lemma scaleR_cancel_right:
huffman@20554
   161
  fixes x y :: "'a::real_vector"
huffman@21809
   162
  shows "(scaleR a x = scaleR b x) = (a = b \<or> x = 0)"
huffman@20554
   163
by (auto intro: scaleR_right_imp_eq)
huffman@20554
   164
huffman@20584
   165
lemma nonzero_inverse_scaleR_distrib:
huffman@21809
   166
  fixes x :: "'a::real_div_algebra" shows
huffman@21809
   167
  "\<lbrakk>a \<noteq> 0; x \<noteq> 0\<rbrakk> \<Longrightarrow> inverse (scaleR a x) = scaleR (inverse a) (inverse x)"
huffman@20763
   168
by (rule inverse_unique, simp)
huffman@20584
   169
huffman@20584
   170
lemma inverse_scaleR_distrib:
huffman@20584
   171
  fixes x :: "'a::{real_div_algebra,division_by_zero}"
huffman@21809
   172
  shows "inverse (scaleR a x) = scaleR (inverse a) (inverse x)"
huffman@20584
   173
apply (case_tac "a = 0", simp)
huffman@20584
   174
apply (case_tac "x = 0", simp)
huffman@20584
   175
apply (erule (1) nonzero_inverse_scaleR_distrib)
huffman@20584
   176
done
huffman@20584
   177
huffman@20554
   178
huffman@20554
   179
subsection {* Embedding of the Reals into any @{text real_algebra_1}:
huffman@20554
   180
@{term of_real} *}
huffman@20554
   181
huffman@20554
   182
definition
wenzelm@21404
   183
  of_real :: "real \<Rightarrow> 'a::real_algebra_1" where
huffman@21809
   184
  "of_real r = scaleR r 1"
huffman@20554
   185
huffman@21809
   186
lemma scaleR_conv_of_real: "scaleR r x = of_real r * x"
huffman@20763
   187
by (simp add: of_real_def)
huffman@20763
   188
huffman@20554
   189
lemma of_real_0 [simp]: "of_real 0 = 0"
huffman@20554
   190
by (simp add: of_real_def)
huffman@20554
   191
huffman@20554
   192
lemma of_real_1 [simp]: "of_real 1 = 1"
huffman@20554
   193
by (simp add: of_real_def)
huffman@20554
   194
huffman@20554
   195
lemma of_real_add [simp]: "of_real (x + y) = of_real x + of_real y"
huffman@20554
   196
by (simp add: of_real_def scaleR_left_distrib)
huffman@20554
   197
huffman@20554
   198
lemma of_real_minus [simp]: "of_real (- x) = - of_real x"
huffman@20554
   199
by (simp add: of_real_def)
huffman@20554
   200
huffman@20554
   201
lemma of_real_diff [simp]: "of_real (x - y) = of_real x - of_real y"
huffman@20554
   202
by (simp add: of_real_def scaleR_left_diff_distrib)
huffman@20554
   203
huffman@20554
   204
lemma of_real_mult [simp]: "of_real (x * y) = of_real x * of_real y"
huffman@20763
   205
by (simp add: of_real_def mult_commute)
huffman@20554
   206
huffman@20584
   207
lemma nonzero_of_real_inverse:
huffman@20584
   208
  "x \<noteq> 0 \<Longrightarrow> of_real (inverse x) =
huffman@20584
   209
   inverse (of_real x :: 'a::real_div_algebra)"
huffman@20584
   210
by (simp add: of_real_def nonzero_inverse_scaleR_distrib)
huffman@20584
   211
huffman@20584
   212
lemma of_real_inverse [simp]:
huffman@20584
   213
  "of_real (inverse x) =
huffman@20584
   214
   inverse (of_real x :: 'a::{real_div_algebra,division_by_zero})"
huffman@20584
   215
by (simp add: of_real_def inverse_scaleR_distrib)
huffman@20584
   216
huffman@20584
   217
lemma nonzero_of_real_divide:
huffman@20584
   218
  "y \<noteq> 0 \<Longrightarrow> of_real (x / y) =
huffman@20584
   219
   (of_real x / of_real y :: 'a::real_field)"
huffman@20584
   220
by (simp add: divide_inverse nonzero_of_real_inverse)
huffman@20722
   221
huffman@20722
   222
lemma of_real_divide [simp]:
huffman@20584
   223
  "of_real (x / y) =
huffman@20584
   224
   (of_real x / of_real y :: 'a::{real_field,division_by_zero})"
huffman@20584
   225
by (simp add: divide_inverse)
huffman@20584
   226
huffman@20722
   227
lemma of_real_power [simp]:
huffman@20722
   228
  "of_real (x ^ n) = (of_real x :: 'a::{real_algebra_1,recpower}) ^ n"
wenzelm@20772
   229
by (induct n) (simp_all add: power_Suc)
huffman@20722
   230
huffman@20554
   231
lemma of_real_eq_iff [simp]: "(of_real x = of_real y) = (x = y)"
huffman@20554
   232
by (simp add: of_real_def scaleR_cancel_right)
huffman@20554
   233
huffman@20584
   234
lemmas of_real_eq_0_iff [simp] = of_real_eq_iff [of _ 0, simplified]
huffman@20554
   235
huffman@20554
   236
lemma of_real_eq_id [simp]: "of_real = (id :: real \<Rightarrow> real)"
huffman@20554
   237
proof
huffman@20554
   238
  fix r
huffman@20554
   239
  show "of_real r = id r"
huffman@22973
   240
    by (simp add: of_real_def)
huffman@20554
   241
qed
huffman@20554
   242
huffman@20554
   243
text{*Collapse nested embeddings*}
huffman@20554
   244
lemma of_real_of_nat_eq [simp]: "of_real (of_nat n) = of_nat n"
wenzelm@20772
   245
by (induct n) auto
huffman@20554
   246
huffman@20554
   247
lemma of_real_of_int_eq [simp]: "of_real (of_int z) = of_int z"
huffman@20554
   248
by (cases z rule: int_diff_cases, simp)
huffman@20554
   249
huffman@20554
   250
lemma of_real_number_of_eq:
huffman@20554
   251
  "of_real (number_of w) = (number_of w :: 'a::{number_ring,real_algebra_1})"
huffman@20554
   252
by (simp add: number_of_eq)
huffman@20554
   253
huffman@22912
   254
text{*Every real algebra has characteristic zero*}
huffman@22912
   255
instance real_algebra_1 < ring_char_0
huffman@22912
   256
proof
huffman@22912
   257
  fix w z :: int
huffman@22912
   258
  assume "of_int w = (of_int z::'a)"
huffman@22912
   259
  hence "of_real (of_int w) = (of_real (of_int z)::'a)"
huffman@22912
   260
    by (simp only: of_real_of_int_eq)
huffman@22912
   261
  thus "w = z"
huffman@22912
   262
    by (simp only: of_real_eq_iff of_int_eq_iff)
huffman@22912
   263
qed
huffman@22912
   264
huffman@20554
   265
huffman@20554
   266
subsection {* The Set of Real Numbers *}
huffman@20554
   267
wenzelm@20772
   268
definition
wenzelm@21404
   269
  Reals :: "'a::real_algebra_1 set" where
wenzelm@20772
   270
  "Reals \<equiv> range of_real"
huffman@20554
   271
wenzelm@21210
   272
notation (xsymbols)
huffman@20554
   273
  Reals  ("\<real>")
huffman@20554
   274
huffman@21809
   275
lemma Reals_of_real [simp]: "of_real r \<in> Reals"
huffman@20554
   276
by (simp add: Reals_def)
huffman@20554
   277
huffman@21809
   278
lemma Reals_of_int [simp]: "of_int z \<in> Reals"
huffman@21809
   279
by (subst of_real_of_int_eq [symmetric], rule Reals_of_real)
huffman@20718
   280
huffman@21809
   281
lemma Reals_of_nat [simp]: "of_nat n \<in> Reals"
huffman@21809
   282
by (subst of_real_of_nat_eq [symmetric], rule Reals_of_real)
huffman@21809
   283
huffman@21809
   284
lemma Reals_number_of [simp]:
huffman@21809
   285
  "(number_of w::'a::{number_ring,real_algebra_1}) \<in> Reals"
huffman@21809
   286
by (subst of_real_number_of_eq [symmetric], rule Reals_of_real)
huffman@20718
   287
huffman@20554
   288
lemma Reals_0 [simp]: "0 \<in> Reals"
huffman@20554
   289
apply (unfold Reals_def)
huffman@20554
   290
apply (rule range_eqI)
huffman@20554
   291
apply (rule of_real_0 [symmetric])
huffman@20554
   292
done
huffman@20554
   293
huffman@20554
   294
lemma Reals_1 [simp]: "1 \<in> Reals"
huffman@20554
   295
apply (unfold Reals_def)
huffman@20554
   296
apply (rule range_eqI)
huffman@20554
   297
apply (rule of_real_1 [symmetric])
huffman@20554
   298
done
huffman@20554
   299
huffman@20584
   300
lemma Reals_add [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a + b \<in> Reals"
huffman@20554
   301
apply (auto simp add: Reals_def)
huffman@20554
   302
apply (rule range_eqI)
huffman@20554
   303
apply (rule of_real_add [symmetric])
huffman@20554
   304
done
huffman@20554
   305
huffman@20584
   306
lemma Reals_minus [simp]: "a \<in> Reals \<Longrightarrow> - a \<in> Reals"
huffman@20584
   307
apply (auto simp add: Reals_def)
huffman@20584
   308
apply (rule range_eqI)
huffman@20584
   309
apply (rule of_real_minus [symmetric])
huffman@20584
   310
done
huffman@20584
   311
huffman@20584
   312
lemma Reals_diff [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a - b \<in> Reals"
huffman@20584
   313
apply (auto simp add: Reals_def)
huffman@20584
   314
apply (rule range_eqI)
huffman@20584
   315
apply (rule of_real_diff [symmetric])
huffman@20584
   316
done
huffman@20584
   317
huffman@20584
   318
lemma Reals_mult [simp]: "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a * b \<in> Reals"
huffman@20554
   319
apply (auto simp add: Reals_def)
huffman@20554
   320
apply (rule range_eqI)
huffman@20554
   321
apply (rule of_real_mult [symmetric])
huffman@20554
   322
done
huffman@20554
   323
huffman@20584
   324
lemma nonzero_Reals_inverse:
huffman@20584
   325
  fixes a :: "'a::real_div_algebra"
huffman@20584
   326
  shows "\<lbrakk>a \<in> Reals; a \<noteq> 0\<rbrakk> \<Longrightarrow> inverse a \<in> Reals"
huffman@20584
   327
apply (auto simp add: Reals_def)
huffman@20584
   328
apply (rule range_eqI)
huffman@20584
   329
apply (erule nonzero_of_real_inverse [symmetric])
huffman@20584
   330
done
huffman@20584
   331
huffman@20584
   332
lemma Reals_inverse [simp]:
huffman@20584
   333
  fixes a :: "'a::{real_div_algebra,division_by_zero}"
huffman@20584
   334
  shows "a \<in> Reals \<Longrightarrow> inverse a \<in> Reals"
huffman@20584
   335
apply (auto simp add: Reals_def)
huffman@20584
   336
apply (rule range_eqI)
huffman@20584
   337
apply (rule of_real_inverse [symmetric])
huffman@20584
   338
done
huffman@20584
   339
huffman@20584
   340
lemma nonzero_Reals_divide:
huffman@20584
   341
  fixes a b :: "'a::real_field"
huffman@20584
   342
  shows "\<lbrakk>a \<in> Reals; b \<in> Reals; b \<noteq> 0\<rbrakk> \<Longrightarrow> a / b \<in> Reals"
huffman@20584
   343
apply (auto simp add: Reals_def)
huffman@20584
   344
apply (rule range_eqI)
huffman@20584
   345
apply (erule nonzero_of_real_divide [symmetric])
huffman@20584
   346
done
huffman@20584
   347
huffman@20584
   348
lemma Reals_divide [simp]:
huffman@20584
   349
  fixes a b :: "'a::{real_field,division_by_zero}"
huffman@20584
   350
  shows "\<lbrakk>a \<in> Reals; b \<in> Reals\<rbrakk> \<Longrightarrow> a / b \<in> Reals"
huffman@20584
   351
apply (auto simp add: Reals_def)
huffman@20584
   352
apply (rule range_eqI)
huffman@20584
   353
apply (rule of_real_divide [symmetric])
huffman@20584
   354
done
huffman@20584
   355
huffman@20722
   356
lemma Reals_power [simp]:
huffman@20722
   357
  fixes a :: "'a::{real_algebra_1,recpower}"
huffman@20722
   358
  shows "a \<in> Reals \<Longrightarrow> a ^ n \<in> Reals"
huffman@20722
   359
apply (auto simp add: Reals_def)
huffman@20722
   360
apply (rule range_eqI)
huffman@20722
   361
apply (rule of_real_power [symmetric])
huffman@20722
   362
done
huffman@20722
   363
huffman@20554
   364
lemma Reals_cases [cases set: Reals]:
huffman@20554
   365
  assumes "q \<in> \<real>"
huffman@20554
   366
  obtains (of_real) r where "q = of_real r"
huffman@20554
   367
  unfolding Reals_def
huffman@20554
   368
proof -
huffman@20554
   369
  from `q \<in> \<real>` have "q \<in> range of_real" unfolding Reals_def .
huffman@20554
   370
  then obtain r where "q = of_real r" ..
huffman@20554
   371
  then show thesis ..
huffman@20554
   372
qed
huffman@20554
   373
huffman@20554
   374
lemma Reals_induct [case_names of_real, induct set: Reals]:
huffman@20554
   375
  "q \<in> \<real> \<Longrightarrow> (\<And>r. P (of_real r)) \<Longrightarrow> P q"
huffman@20554
   376
  by (rule Reals_cases) auto
huffman@20554
   377
huffman@20504
   378
huffman@20504
   379
subsection {* Real normed vector spaces *}
huffman@20504
   380
huffman@22636
   381
class norm = type +
huffman@22636
   382
  fixes norm :: "'a \<Rightarrow> real"
huffman@20504
   383
huffman@22636
   384
instance real :: norm
huffman@22636
   385
  real_norm_def [simp]: "norm r \<equiv> \<bar>r\<bar>" ..
huffman@20554
   386
huffman@22852
   387
axclass real_normed_vector < real_vector, norm
huffman@20533
   388
  norm_ge_zero [simp]: "0 \<le> norm x"
huffman@20533
   389
  norm_eq_zero [simp]: "(norm x = 0) = (x = 0)"
huffman@20533
   390
  norm_triangle_ineq: "norm (x + y) \<le> norm x + norm y"
huffman@21809
   391
  norm_scaleR: "norm (scaleR a x) = \<bar>a\<bar> * norm x"
huffman@20504
   392
huffman@20584
   393
axclass real_normed_algebra < real_algebra, real_normed_vector
huffman@20533
   394
  norm_mult_ineq: "norm (x * y) \<le> norm x * norm y"
huffman@20504
   395
huffman@22852
   396
axclass real_normed_algebra_1 < real_algebra_1, real_normed_algebra
huffman@22852
   397
  norm_one [simp]: "norm 1 = 1"
huffman@22852
   398
huffman@22852
   399
axclass real_normed_div_algebra < real_div_algebra, real_normed_vector
huffman@20533
   400
  norm_mult: "norm (x * y) = norm x * norm y"
huffman@20504
   401
huffman@20584
   402
axclass real_normed_field < real_field, real_normed_div_algebra
huffman@20584
   403
huffman@22852
   404
instance real_normed_div_algebra < real_normed_algebra_1
huffman@20554
   405
proof
huffman@20554
   406
  fix x y :: 'a
huffman@20554
   407
  show "norm (x * y) \<le> norm x * norm y"
huffman@20554
   408
    by (simp add: norm_mult)
huffman@22852
   409
next
huffman@22852
   410
  have "norm (1 * 1::'a) = norm (1::'a) * norm (1::'a)"
huffman@22852
   411
    by (rule norm_mult)
huffman@22852
   412
  thus "norm (1::'a) = 1" by simp
huffman@20554
   413
qed
huffman@20554
   414
huffman@20584
   415
instance real :: real_normed_field
huffman@22852
   416
apply (intro_classes, unfold real_norm_def real_scaleR_def)
huffman@20554
   417
apply (rule abs_ge_zero)
huffman@20554
   418
apply (rule abs_eq_0)
huffman@20554
   419
apply (rule abs_triangle_ineq)
huffman@22852
   420
apply (rule abs_mult)
huffman@20554
   421
apply (rule abs_mult)
huffman@20554
   422
done
huffman@20504
   423
huffman@22852
   424
lemma norm_zero [simp]: "norm (0::'a::real_normed_vector) = 0"
huffman@20504
   425
by simp
huffman@20504
   426
huffman@22852
   427
lemma zero_less_norm_iff [simp]:
huffman@22852
   428
  fixes x :: "'a::real_normed_vector"
huffman@22852
   429
  shows "(0 < norm x) = (x \<noteq> 0)"
huffman@20504
   430
by (simp add: order_less_le)
huffman@20504
   431
huffman@22852
   432
lemma norm_not_less_zero [simp]:
huffman@22852
   433
  fixes x :: "'a::real_normed_vector"
huffman@22852
   434
  shows "\<not> norm x < 0"
huffman@20828
   435
by (simp add: linorder_not_less)
huffman@20828
   436
huffman@22852
   437
lemma norm_le_zero_iff [simp]:
huffman@22852
   438
  fixes x :: "'a::real_normed_vector"
huffman@22852
   439
  shows "(norm x \<le> 0) = (x = 0)"
huffman@20828
   440
by (simp add: order_le_less)
huffman@20828
   441
huffman@20504
   442
lemma norm_minus_cancel [simp]:
huffman@20584
   443
  fixes x :: "'a::real_normed_vector"
huffman@20584
   444
  shows "norm (- x) = norm x"
huffman@20504
   445
proof -
huffman@21809
   446
  have "norm (- x) = norm (scaleR (- 1) x)"
huffman@20504
   447
    by (simp only: scaleR_minus_left scaleR_one)
huffman@20533
   448
  also have "\<dots> = \<bar>- 1\<bar> * norm x"
huffman@20504
   449
    by (rule norm_scaleR)
huffman@20504
   450
  finally show ?thesis by simp
huffman@20504
   451
qed
huffman@20504
   452
huffman@20504
   453
lemma norm_minus_commute:
huffman@20584
   454
  fixes a b :: "'a::real_normed_vector"
huffman@20584
   455
  shows "norm (a - b) = norm (b - a)"
huffman@20504
   456
proof -
huffman@22898
   457
  have "norm (- (b - a)) = norm (b - a)"
huffman@22898
   458
    by (rule norm_minus_cancel)
huffman@22898
   459
  thus ?thesis by simp
huffman@20504
   460
qed
huffman@20504
   461
huffman@20504
   462
lemma norm_triangle_ineq2:
huffman@20584
   463
  fixes a b :: "'a::real_normed_vector"
huffman@20533
   464
  shows "norm a - norm b \<le> norm (a - b)"
huffman@20504
   465
proof -
huffman@20533
   466
  have "norm (a - b + b) \<le> norm (a - b) + norm b"
huffman@20504
   467
    by (rule norm_triangle_ineq)
huffman@22898
   468
  thus ?thesis by simp
huffman@20504
   469
qed
huffman@20504
   470
huffman@20584
   471
lemma norm_triangle_ineq3:
huffman@20584
   472
  fixes a b :: "'a::real_normed_vector"
huffman@20584
   473
  shows "\<bar>norm a - norm b\<bar> \<le> norm (a - b)"
huffman@20584
   474
apply (subst abs_le_iff)
huffman@20584
   475
apply auto
huffman@20584
   476
apply (rule norm_triangle_ineq2)
huffman@20584
   477
apply (subst norm_minus_commute)
huffman@20584
   478
apply (rule norm_triangle_ineq2)
huffman@20584
   479
done
huffman@20584
   480
huffman@20504
   481
lemma norm_triangle_ineq4:
huffman@20584
   482
  fixes a b :: "'a::real_normed_vector"
huffman@20533
   483
  shows "norm (a - b) \<le> norm a + norm b"
huffman@20504
   484
proof -
huffman@22898
   485
  have "norm (a + - b) \<le> norm a + norm (- b)"
huffman@20504
   486
    by (rule norm_triangle_ineq)
huffman@22898
   487
  thus ?thesis
huffman@22898
   488
    by (simp only: diff_minus norm_minus_cancel)
huffman@22898
   489
qed
huffman@22898
   490
huffman@22898
   491
lemma norm_diff_ineq:
huffman@22898
   492
  fixes a b :: "'a::real_normed_vector"
huffman@22898
   493
  shows "norm a - norm b \<le> norm (a + b)"
huffman@22898
   494
proof -
huffman@22898
   495
  have "norm a - norm (- b) \<le> norm (a - - b)"
huffman@22898
   496
    by (rule norm_triangle_ineq2)
huffman@22898
   497
  thus ?thesis by simp
huffman@20504
   498
qed
huffman@20504
   499
huffman@20551
   500
lemma norm_diff_triangle_ineq:
huffman@20551
   501
  fixes a b c d :: "'a::real_normed_vector"
huffman@20551
   502
  shows "norm ((a + b) - (c + d)) \<le> norm (a - c) + norm (b - d)"
huffman@20551
   503
proof -
huffman@20551
   504
  have "norm ((a + b) - (c + d)) = norm ((a - c) + (b - d))"
huffman@20551
   505
    by (simp add: diff_minus add_ac)
huffman@20551
   506
  also have "\<dots> \<le> norm (a - c) + norm (b - d)"
huffman@20551
   507
    by (rule norm_triangle_ineq)
huffman@20551
   508
  finally show ?thesis .
huffman@20551
   509
qed
huffman@20551
   510
huffman@22857
   511
lemma abs_norm_cancel [simp]:
huffman@22857
   512
  fixes a :: "'a::real_normed_vector"
huffman@22857
   513
  shows "\<bar>norm a\<bar> = norm a"
huffman@22857
   514
by (rule abs_of_nonneg [OF norm_ge_zero])
huffman@22857
   515
huffman@22880
   516
lemma norm_add_less:
huffman@22880
   517
  fixes x y :: "'a::real_normed_vector"
huffman@22880
   518
  shows "\<lbrakk>norm x < r; norm y < s\<rbrakk> \<Longrightarrow> norm (x + y) < r + s"
huffman@22880
   519
by (rule order_le_less_trans [OF norm_triangle_ineq add_strict_mono])
huffman@22880
   520
huffman@22880
   521
lemma norm_mult_less:
huffman@22880
   522
  fixes x y :: "'a::real_normed_algebra"
huffman@22880
   523
  shows "\<lbrakk>norm x < r; norm y < s\<rbrakk> \<Longrightarrow> norm (x * y) < r * s"
huffman@22880
   524
apply (rule order_le_less_trans [OF norm_mult_ineq])
huffman@22880
   525
apply (simp add: mult_strict_mono')
huffman@22880
   526
done
huffman@22880
   527
huffman@22857
   528
lemma norm_of_real [simp]:
huffman@22857
   529
  "norm (of_real r :: 'a::real_normed_algebra_1) = \<bar>r\<bar>"
huffman@22852
   530
unfolding of_real_def by (simp add: norm_scaleR)
huffman@20560
   531
huffman@22876
   532
lemma norm_number_of [simp]:
huffman@22876
   533
  "norm (number_of w::'a::{number_ring,real_normed_algebra_1})
huffman@22876
   534
    = \<bar>number_of w\<bar>"
huffman@22876
   535
by (subst of_real_number_of_eq [symmetric], rule norm_of_real)
huffman@22876
   536
huffman@22876
   537
lemma norm_of_int [simp]:
huffman@22876
   538
  "norm (of_int z::'a::real_normed_algebra_1) = \<bar>of_int z\<bar>"
huffman@22876
   539
by (subst of_real_of_int_eq [symmetric], rule norm_of_real)
huffman@22876
   540
huffman@22876
   541
lemma norm_of_nat [simp]:
huffman@22876
   542
  "norm (of_nat n::'a::real_normed_algebra_1) = of_nat n"
huffman@22876
   543
apply (subst of_real_of_nat_eq [symmetric])
huffman@22876
   544
apply (subst norm_of_real, simp)
huffman@22876
   545
done
huffman@22876
   546
huffman@20504
   547
lemma nonzero_norm_inverse:
huffman@20504
   548
  fixes a :: "'a::real_normed_div_algebra"
huffman@20533
   549
  shows "a \<noteq> 0 \<Longrightarrow> norm (inverse a) = inverse (norm a)"
huffman@20504
   550
apply (rule inverse_unique [symmetric])
huffman@20504
   551
apply (simp add: norm_mult [symmetric])
huffman@20504
   552
done
huffman@20504
   553
huffman@20504
   554
lemma norm_inverse:
huffman@20504
   555
  fixes a :: "'a::{real_normed_div_algebra,division_by_zero}"
huffman@20533
   556
  shows "norm (inverse a) = inverse (norm a)"
huffman@20504
   557
apply (case_tac "a = 0", simp)
huffman@20504
   558
apply (erule nonzero_norm_inverse)
huffman@20504
   559
done
huffman@20504
   560
huffman@20584
   561
lemma nonzero_norm_divide:
huffman@20584
   562
  fixes a b :: "'a::real_normed_field"
huffman@20584
   563
  shows "b \<noteq> 0 \<Longrightarrow> norm (a / b) = norm a / norm b"
huffman@20584
   564
by (simp add: divide_inverse norm_mult nonzero_norm_inverse)
huffman@20584
   565
huffman@20584
   566
lemma norm_divide:
huffman@20584
   567
  fixes a b :: "'a::{real_normed_field,division_by_zero}"
huffman@20584
   568
  shows "norm (a / b) = norm a / norm b"
huffman@20584
   569
by (simp add: divide_inverse norm_mult norm_inverse)
huffman@20584
   570
huffman@22852
   571
lemma norm_power_ineq:
huffman@22852
   572
  fixes x :: "'a::{real_normed_algebra_1,recpower}"
huffman@22852
   573
  shows "norm (x ^ n) \<le> norm x ^ n"
huffman@22852
   574
proof (induct n)
huffman@22852
   575
  case 0 show "norm (x ^ 0) \<le> norm x ^ 0" by simp
huffman@22852
   576
next
huffman@22852
   577
  case (Suc n)
huffman@22852
   578
  have "norm (x * x ^ n) \<le> norm x * norm (x ^ n)"
huffman@22852
   579
    by (rule norm_mult_ineq)
huffman@22852
   580
  also from Suc have "\<dots> \<le> norm x * norm x ^ n"
huffman@22852
   581
    using norm_ge_zero by (rule mult_left_mono)
huffman@22852
   582
  finally show "norm (x ^ Suc n) \<le> norm x ^ Suc n"
huffman@22852
   583
    by (simp add: power_Suc)
huffman@22852
   584
qed
huffman@22852
   585
huffman@20684
   586
lemma norm_power:
huffman@20684
   587
  fixes x :: "'a::{real_normed_div_algebra,recpower}"
huffman@20684
   588
  shows "norm (x ^ n) = norm x ^ n"
wenzelm@20772
   589
by (induct n) (simp_all add: power_Suc norm_mult)
huffman@20684
   590
huffman@22442
   591
huffman@22972
   592
subsection {* Sign function *}
huffman@22972
   593
huffman@22972
   594
definition
huffman@22972
   595
  sgn :: "'a::real_normed_vector \<Rightarrow> 'a" where
huffman@22972
   596
  "sgn x = scaleR (inverse (norm x)) x"
huffman@22972
   597
huffman@22972
   598
lemma norm_sgn: "norm (sgn x) = (if x = 0 then 0 else 1)"
huffman@22972
   599
unfolding sgn_def by (simp add: norm_scaleR)
huffman@22972
   600
huffman@22972
   601
lemma sgn_zero [simp]: "sgn 0 = 0"
huffman@22972
   602
unfolding sgn_def by simp
huffman@22972
   603
huffman@22972
   604
lemma sgn_zero_iff: "(sgn x = 0) = (x = 0)"
huffman@22973
   605
unfolding sgn_def by simp
huffman@22972
   606
huffman@22972
   607
lemma sgn_minus: "sgn (- x) = - sgn x"
huffman@22972
   608
unfolding sgn_def by simp
huffman@22972
   609
huffman@22973
   610
lemma sgn_scaleR: "sgn (scaleR r x) = scaleR (sgn r) (sgn x)"
huffman@22973
   611
unfolding sgn_def by (simp add: norm_scaleR mult_ac)
huffman@22973
   612
huffman@22972
   613
lemma sgn_one [simp]: "sgn (1::'a::real_normed_algebra_1) = 1"
huffman@22972
   614
unfolding sgn_def by simp
huffman@22972
   615
huffman@22972
   616
lemma sgn_of_real:
huffman@22972
   617
  "sgn (of_real r::'a::real_normed_algebra_1) = of_real (sgn r)"
huffman@22972
   618
unfolding of_real_def by (simp only: sgn_scaleR sgn_one)
huffman@22972
   619
huffman@22973
   620
lemma sgn_mult:
huffman@22973
   621
  fixes x y :: "'a::real_normed_div_algebra"
huffman@22973
   622
  shows "sgn (x * y) = sgn x * sgn y"
huffman@22973
   623
unfolding sgn_def by (simp add: norm_mult mult_commute)
huffman@22973
   624
huffman@22972
   625
lemma real_sgn_eq: "sgn (x::real) = x / \<bar>x\<bar>"
huffman@22973
   626
unfolding sgn_def by (simp add: divide_inverse)
huffman@22972
   627
huffman@22972
   628
lemma real_sgn_pos: "0 < (x::real) \<Longrightarrow> sgn x = 1"
huffman@22972
   629
unfolding real_sgn_eq by simp
huffman@22972
   630
huffman@22972
   631
lemma real_sgn_neg: "(x::real) < 0 \<Longrightarrow> sgn x = -1"
huffman@22972
   632
unfolding real_sgn_eq by simp
huffman@22972
   633
huffman@22972
   634
huffman@22442
   635
subsection {* Bounded Linear and Bilinear Operators *}
huffman@22442
   636
huffman@22442
   637
locale bounded_linear = additive +
huffman@22442
   638
  constrains f :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_vector"
huffman@22442
   639
  assumes scaleR: "f (scaleR r x) = scaleR r (f x)"
huffman@22442
   640
  assumes bounded: "\<exists>K. \<forall>x. norm (f x) \<le> norm x * K"
huffman@22442
   641
huffman@22442
   642
lemma (in bounded_linear) pos_bounded:
huffman@22442
   643
  "\<exists>K>0. \<forall>x. norm (f x) \<le> norm x * K"
huffman@22442
   644
proof -
huffman@22442
   645
  obtain K where K: "\<And>x. norm (f x) \<le> norm x * K"
huffman@22442
   646
    using bounded by fast
huffman@22442
   647
  show ?thesis
huffman@22442
   648
  proof (intro exI impI conjI allI)
huffman@22442
   649
    show "0 < max 1 K"
huffman@22442
   650
      by (rule order_less_le_trans [OF zero_less_one le_maxI1])
huffman@22442
   651
  next
huffman@22442
   652
    fix x
huffman@22442
   653
    have "norm (f x) \<le> norm x * K" using K .
huffman@22442
   654
    also have "\<dots> \<le> norm x * max 1 K"
huffman@22442
   655
      by (rule mult_left_mono [OF le_maxI2 norm_ge_zero])
huffman@22442
   656
    finally show "norm (f x) \<le> norm x * max 1 K" .
huffman@22442
   657
  qed
huffman@22442
   658
qed
huffman@22442
   659
huffman@22442
   660
lemma (in bounded_linear) nonneg_bounded:
huffman@22442
   661
  "\<exists>K\<ge>0. \<forall>x. norm (f x) \<le> norm x * K"
huffman@22442
   662
proof -
huffman@22442
   663
  from pos_bounded
huffman@22442
   664
  show ?thesis by (auto intro: order_less_imp_le)
huffman@22442
   665
qed
huffman@22442
   666
huffman@22442
   667
locale bounded_bilinear =
huffman@22442
   668
  fixes prod :: "['a::real_normed_vector, 'b::real_normed_vector]
huffman@22442
   669
                 \<Rightarrow> 'c::real_normed_vector"
huffman@22442
   670
    (infixl "**" 70)
huffman@22442
   671
  assumes add_left: "prod (a + a') b = prod a b + prod a' b"
huffman@22442
   672
  assumes add_right: "prod a (b + b') = prod a b + prod a b'"
huffman@22442
   673
  assumes scaleR_left: "prod (scaleR r a) b = scaleR r (prod a b)"
huffman@22442
   674
  assumes scaleR_right: "prod a (scaleR r b) = scaleR r (prod a b)"
huffman@22442
   675
  assumes bounded: "\<exists>K. \<forall>a b. norm (prod a b) \<le> norm a * norm b * K"
huffman@22442
   676
huffman@22442
   677
lemma (in bounded_bilinear) pos_bounded:
huffman@22442
   678
  "\<exists>K>0. \<forall>a b. norm (a ** b) \<le> norm a * norm b * K"
huffman@22442
   679
apply (cut_tac bounded, erule exE)
huffman@22442
   680
apply (rule_tac x="max 1 K" in exI, safe)
huffman@22442
   681
apply (rule order_less_le_trans [OF zero_less_one le_maxI1])
huffman@22442
   682
apply (drule spec, drule spec, erule order_trans)
huffman@22442
   683
apply (rule mult_left_mono [OF le_maxI2])
huffman@22442
   684
apply (intro mult_nonneg_nonneg norm_ge_zero)
huffman@22442
   685
done
huffman@22442
   686
huffman@22442
   687
lemma (in bounded_bilinear) nonneg_bounded:
huffman@22442
   688
  "\<exists>K\<ge>0. \<forall>a b. norm (a ** b) \<le> norm a * norm b * K"
huffman@22442
   689
proof -
huffman@22442
   690
  from pos_bounded
huffman@22442
   691
  show ?thesis by (auto intro: order_less_imp_le)
huffman@22442
   692
qed
huffman@22442
   693
huffman@22442
   694
lemma (in bounded_bilinear) additive_right: "additive (\<lambda>b. prod a b)"
huffman@22442
   695
by (rule additive.intro, rule add_right)
huffman@22442
   696
huffman@22442
   697
lemma (in bounded_bilinear) additive_left: "additive (\<lambda>a. prod a b)"
huffman@22442
   698
by (rule additive.intro, rule add_left)
huffman@22442
   699
huffman@22442
   700
lemma (in bounded_bilinear) zero_left: "prod 0 b = 0"
huffman@22442
   701
by (rule additive.zero [OF additive_left])
huffman@22442
   702
huffman@22442
   703
lemma (in bounded_bilinear) zero_right: "prod a 0 = 0"
huffman@22442
   704
by (rule additive.zero [OF additive_right])
huffman@22442
   705
huffman@22442
   706
lemma (in bounded_bilinear) minus_left: "prod (- a) b = - prod a b"
huffman@22442
   707
by (rule additive.minus [OF additive_left])
huffman@22442
   708
huffman@22442
   709
lemma (in bounded_bilinear) minus_right: "prod a (- b) = - prod a b"
huffman@22442
   710
by (rule additive.minus [OF additive_right])
huffman@22442
   711
huffman@22442
   712
lemma (in bounded_bilinear) diff_left:
huffman@22442
   713
  "prod (a - a') b = prod a b - prod a' b"
huffman@22442
   714
by (rule additive.diff [OF additive_left])
huffman@22442
   715
huffman@22442
   716
lemma (in bounded_bilinear) diff_right:
huffman@22442
   717
  "prod a (b - b') = prod a b - prod a b'"
huffman@22442
   718
by (rule additive.diff [OF additive_right])
huffman@22442
   719
huffman@22442
   720
lemma (in bounded_bilinear) bounded_linear_left:
huffman@22442
   721
  "bounded_linear (\<lambda>a. a ** b)"
huffman@22442
   722
apply (unfold_locales)
huffman@22442
   723
apply (rule add_left)
huffman@22442
   724
apply (rule scaleR_left)
huffman@22442
   725
apply (cut_tac bounded, safe)
huffman@22442
   726
apply (rule_tac x="norm b * K" in exI)
huffman@22442
   727
apply (simp add: mult_ac)
huffman@22442
   728
done
huffman@22442
   729
huffman@22442
   730
lemma (in bounded_bilinear) bounded_linear_right:
huffman@22442
   731
  "bounded_linear (\<lambda>b. a ** b)"
huffman@22442
   732
apply (unfold_locales)
huffman@22442
   733
apply (rule add_right)
huffman@22442
   734
apply (rule scaleR_right)
huffman@22442
   735
apply (cut_tac bounded, safe)
huffman@22442
   736
apply (rule_tac x="norm a * K" in exI)
huffman@22442
   737
apply (simp add: mult_ac)
huffman@22442
   738
done
huffman@22442
   739
huffman@22442
   740
lemma (in bounded_bilinear) prod_diff_prod:
huffman@22442
   741
  "(x ** y - a ** b) = (x - a) ** (y - b) + (x - a) ** b + a ** (y - b)"
huffman@22442
   742
by (simp add: diff_left diff_right)
huffman@22442
   743
huffman@22442
   744
interpretation bounded_bilinear_mult:
huffman@22442
   745
  bounded_bilinear ["op * :: 'a \<Rightarrow> 'a \<Rightarrow> 'a::real_normed_algebra"]
huffman@22442
   746
apply (rule bounded_bilinear.intro)
huffman@22442
   747
apply (rule left_distrib)
huffman@22442
   748
apply (rule right_distrib)
huffman@22442
   749
apply (rule mult_scaleR_left)
huffman@22442
   750
apply (rule mult_scaleR_right)
huffman@22442
   751
apply (rule_tac x="1" in exI)
huffman@22442
   752
apply (simp add: norm_mult_ineq)
huffman@22442
   753
done
huffman@22442
   754
huffman@22442
   755
interpretation bounded_linear_mult_left:
huffman@22442
   756
  bounded_linear ["(\<lambda>x::'a::real_normed_algebra. x * y)"]
huffman@22442
   757
by (rule bounded_bilinear_mult.bounded_linear_left)
huffman@22442
   758
huffman@22442
   759
interpretation bounded_linear_mult_right:
huffman@22442
   760
  bounded_linear ["(\<lambda>y::'a::real_normed_algebra. x * y)"]
huffman@22442
   761
by (rule bounded_bilinear_mult.bounded_linear_right)
huffman@22442
   762
huffman@22442
   763
interpretation bounded_bilinear_scaleR:
huffman@22442
   764
  bounded_bilinear ["scaleR"]
huffman@22442
   765
apply (rule bounded_bilinear.intro)
huffman@22442
   766
apply (rule scaleR_left_distrib)
huffman@22442
   767
apply (rule scaleR_right_distrib)
huffman@22973
   768
apply simp
huffman@22442
   769
apply (rule scaleR_left_commute)
huffman@22442
   770
apply (rule_tac x="1" in exI)
huffman@22442
   771
apply (simp add: norm_scaleR)
huffman@22442
   772
done
huffman@22442
   773
huffman@22625
   774
interpretation bounded_linear_of_real:
huffman@22625
   775
  bounded_linear ["\<lambda>r. of_real r"]
huffman@22625
   776
apply (unfold of_real_def)
huffman@22625
   777
apply (rule bounded_bilinear_scaleR.bounded_linear_left)
huffman@22625
   778
done
huffman@22625
   779
huffman@20504
   780
end