src/HOL/Real/HahnBanach/FunctionNorm.thy
author paulson
Thu Jan 01 10:06:32 2004 +0100 (2004-01-01)
changeset 14334 6137d24eef79
parent 14254 342634f38451
child 14710 247615bfffb8
permissions -rw-r--r--
tweaking of lemmas in RealDef, RealOrd
wenzelm@7566
     1
(*  Title:      HOL/Real/HahnBanach/FunctionNorm.thy
wenzelm@7566
     2
    ID:         $Id$
wenzelm@7566
     3
    Author:     Gertrud Bauer, TU Munich
wenzelm@7566
     4
*)
wenzelm@7535
     5
wenzelm@9035
     6
header {* The norm of a function *}
wenzelm@7808
     7
wenzelm@9035
     8
theory FunctionNorm = NormedSpace + FunctionOrder:
wenzelm@7535
     9
wenzelm@9035
    10
subsection {* Continuous linear forms*}
wenzelm@7917
    11
wenzelm@10687
    12
text {*
wenzelm@11472
    13
  A linear form @{text f} on a normed vector space @{text "(V, \<parallel>\<cdot>\<parallel>)"}
wenzelm@13515
    14
  is \emph{continuous}, iff it is bounded, i.e.
wenzelm@10687
    15
  \begin{center}
wenzelm@11472
    16
  @{text "\<exists>c \<in> R. \<forall>x \<in> V. \<bar>f x\<bar> \<le> c \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
    17
  \end{center}
wenzelm@10687
    18
  In our application no other functions than linear forms are
wenzelm@10687
    19
  considered, so we can define continuous linear forms as bounded
wenzelm@10687
    20
  linear forms:
wenzelm@9035
    21
*}
wenzelm@7535
    22
wenzelm@13515
    23
locale continuous = var V + norm_syntax + linearform +
wenzelm@13515
    24
  assumes bounded: "\<exists>c. \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>"
wenzelm@7535
    25
ballarin@14254
    26
declare continuous.intro [intro?] continuous_axioms.intro [intro?]
ballarin@14254
    27
wenzelm@10687
    28
lemma continuousI [intro]:
wenzelm@13515
    29
  includes norm_syntax + linearform
wenzelm@13515
    30
  assumes r: "\<And>x. x \<in> V \<Longrightarrow> \<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>"
wenzelm@13515
    31
  shows "continuous V norm f"
wenzelm@13515
    32
proof
wenzelm@13515
    33
  show "linearform V f" .
wenzelm@13515
    34
  from r have "\<exists>c. \<forall>x\<in>V. \<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" by blast
wenzelm@13515
    35
  then show "continuous_axioms V norm f" ..
wenzelm@13515
    36
qed
wenzelm@7535
    37
wenzelm@11472
    38
wenzelm@13515
    39
subsection {* The norm of a linear form *}
wenzelm@7917
    40
wenzelm@10687
    41
text {*
wenzelm@10687
    42
  The least real number @{text c} for which holds
wenzelm@10687
    43
  \begin{center}
wenzelm@11472
    44
  @{text "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
    45
  \end{center}
wenzelm@10687
    46
  is called the \emph{norm} of @{text f}.
wenzelm@7917
    47
wenzelm@11472
    48
  For non-trivial vector spaces @{text "V \<noteq> {0}"} the norm can be
wenzelm@10687
    49
  defined as
wenzelm@10687
    50
  \begin{center}
wenzelm@11472
    51
  @{text "\<parallel>f\<parallel> = \<sup>x \<noteq> 0. \<bar>f x\<bar> / \<parallel>x\<parallel>"}
wenzelm@10687
    52
  \end{center}
wenzelm@7917
    53
wenzelm@10687
    54
  For the case @{text "V = {0}"} the supremum would be taken from an
wenzelm@11472
    55
  empty set. Since @{text \<real>} is unbounded, there would be no supremum.
wenzelm@10687
    56
  To avoid this situation it must be guaranteed that there is an
wenzelm@11472
    57
  element in this set. This element must be @{text "{} \<ge> 0"} so that
wenzelm@13547
    58
  @{text fn_norm} has the norm properties. Furthermore it does not
wenzelm@13547
    59
  have to change the norm in all other cases, so it must be @{text 0},
wenzelm@13547
    60
  as all other elements are @{text "{} \<ge> 0"}.
wenzelm@7917
    61
wenzelm@13515
    62
  Thus we define the set @{text B} where the supremum is taken from as
wenzelm@13515
    63
  follows:
wenzelm@10687
    64
  \begin{center}
wenzelm@11472
    65
  @{text "{0} \<union> {\<bar>f x\<bar> / \<parallel>x\<parallel>. x \<noteq> 0 \<and> x \<in> F}"}
wenzelm@10687
    66
  \end{center}
wenzelm@10687
    67
wenzelm@13547
    68
  @{text fn_norm} is equal to the supremum of @{text B}, if the
wenzelm@13515
    69
  supremum exists (otherwise it is undefined).
wenzelm@9035
    70
*}
wenzelm@7917
    71
wenzelm@13547
    72
locale fn_norm = norm_syntax +
wenzelm@13547
    73
  fixes B defines "B V f \<equiv> {0} \<union> {\<bar>f x\<bar> / \<parallel>x\<parallel> | x. x \<noteq> 0 \<and> x \<in> V}"
wenzelm@13547
    74
  fixes fn_norm ("\<parallel>_\<parallel>\<hyphen>_" [0, 1000] 999)
wenzelm@13515
    75
  defines "\<parallel>f\<parallel>\<hyphen>V \<equiv> \<Squnion>(B V f)"
wenzelm@7535
    76
wenzelm@13547
    77
lemma (in fn_norm) B_not_empty [intro]: "0 \<in> B V f"
wenzelm@13547
    78
  by (simp add: B_def)
wenzelm@7917
    79
wenzelm@10687
    80
text {*
wenzelm@10687
    81
  The following lemma states that every continuous linear form on a
wenzelm@11472
    82
  normed space @{text "(V, \<parallel>\<cdot>\<parallel>)"} has a function norm.
wenzelm@10687
    83
*}
wenzelm@10687
    84
wenzelm@13547
    85
lemma (in normed_vectorspace) fn_norm_works:   (* FIXME bug with "(in fn_norm)" !? *)
wenzelm@13547
    86
  includes fn_norm + continuous
wenzelm@13515
    87
  shows "lub (B V f) (\<parallel>f\<parallel>\<hyphen>V)"
wenzelm@13515
    88
proof -
wenzelm@10687
    89
  txt {* The existence of the supremum is shown using the
wenzelm@13515
    90
    completeness of the reals. Completeness means, that every
wenzelm@13515
    91
    non-empty bounded set of reals has a supremum. *}
wenzelm@13515
    92
  have "\<exists>a. lub (B V f) a"
wenzelm@13515
    93
  proof (rule real_complete)
wenzelm@10687
    94
    txt {* First we have to show that @{text B} is non-empty: *}
wenzelm@13515
    95
    have "0 \<in> B V f" ..
wenzelm@13515
    96
    thus "\<exists>x. x \<in> B V f" ..
wenzelm@7535
    97
wenzelm@10687
    98
    txt {* Then we have to show that @{text B} is bounded: *}
wenzelm@13515
    99
    show "\<exists>c. \<forall>y \<in> B V f. y \<le> c"
wenzelm@13515
   100
    proof -
wenzelm@10687
   101
      txt {* We know that @{text f} is bounded by some value @{text c}. *}
wenzelm@13515
   102
      from bounded obtain c where c: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" ..
wenzelm@7535
   103
wenzelm@13515
   104
      txt {* To prove the thesis, we have to show that there is some
wenzelm@13515
   105
        @{text b}, such that @{text "y \<le> b"} for all @{text "y \<in>
wenzelm@13515
   106
        B"}. Due to the definition of @{text B} there are two cases. *}
wenzelm@7917
   107
wenzelm@13515
   108
      def b \<equiv> "max c 0"
wenzelm@13515
   109
      have "\<forall>y \<in> B V f. y \<le> b"
wenzelm@13515
   110
      proof
wenzelm@13515
   111
        fix y assume y: "y \<in> B V f"
wenzelm@13515
   112
        show "y \<le> b"
wenzelm@13515
   113
        proof cases
wenzelm@13515
   114
          assume "y = 0"
wenzelm@13515
   115
          thus ?thesis by (unfold b_def) arith
wenzelm@13515
   116
        next
wenzelm@13515
   117
          txt {* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
wenzelm@13515
   118
            @{text "x \<in> V"} with @{text "x \<noteq> 0"}. *}
wenzelm@13515
   119
          assume "y \<noteq> 0"
wenzelm@13515
   120
          with y obtain x where y_rep: "y = \<bar>f x\<bar> * inverse \<parallel>x\<parallel>"
wenzelm@13515
   121
              and x: "x \<in> V" and neq: "x \<noteq> 0"
wenzelm@13515
   122
            by (auto simp add: B_def real_divide_def)
wenzelm@13515
   123
          from x neq have gt: "0 < \<parallel>x\<parallel>" ..
wenzelm@7917
   124
wenzelm@13515
   125
          txt {* The thesis follows by a short calculation using the
wenzelm@13515
   126
            fact that @{text f} is bounded. *}
wenzelm@13515
   127
wenzelm@13515
   128
          note y_rep
wenzelm@13515
   129
          also have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<le> (c * \<parallel>x\<parallel>) * inverse \<parallel>x\<parallel>"
paulson@14334
   130
          proof (rule mult_right_mono)
wenzelm@13515
   131
            from c show "\<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" ..
paulson@14334
   132
            from gt have "0 < inverse \<parallel>x\<parallel>" 
paulson@14334
   133
              by (rule positive_imp_inverse_positive)
wenzelm@13515
   134
            thus "0 \<le> inverse \<parallel>x\<parallel>" by (rule order_less_imp_le)
wenzelm@13515
   135
          qed
wenzelm@13515
   136
          also have "\<dots> = c * (\<parallel>x\<parallel> * inverse \<parallel>x\<parallel>)"
wenzelm@13515
   137
            by (rule real_mult_assoc)
wenzelm@13515
   138
          also
wenzelm@13515
   139
          from gt have "\<parallel>x\<parallel> \<noteq> 0" by simp
wenzelm@13515
   140
          hence "\<parallel>x\<parallel> * inverse \<parallel>x\<parallel> = 1" by (simp add: real_mult_inv_right1)
wenzelm@13515
   141
          also have "c * 1 \<le> b" by (simp add: b_def le_maxI1)
wenzelm@13515
   142
          finally show "y \<le> b" .
wenzelm@9035
   143
        qed
wenzelm@13515
   144
      qed
wenzelm@13515
   145
      thus ?thesis ..
wenzelm@9035
   146
    qed
wenzelm@9035
   147
  qed
wenzelm@13547
   148
  then show ?thesis by (unfold fn_norm_def) (rule the_lubI_ex)
wenzelm@13515
   149
qed
wenzelm@13515
   150
wenzelm@13547
   151
lemma (in normed_vectorspace) fn_norm_ub [iff?]:
wenzelm@13547
   152
  includes fn_norm + continuous
wenzelm@13515
   153
  assumes b: "b \<in> B V f"
wenzelm@13515
   154
  shows "b \<le> \<parallel>f\<parallel>\<hyphen>V"
wenzelm@13515
   155
proof -
wenzelm@13547
   156
  have "lub (B V f) (\<parallel>f\<parallel>\<hyphen>V)"
ballarin@14214
   157
    by (unfold B_def fn_norm_def) (rule fn_norm_works [OF _ continuous.intro])
wenzelm@13515
   158
  from this and b show ?thesis ..
wenzelm@13515
   159
qed
wenzelm@13515
   160
wenzelm@13547
   161
lemma (in normed_vectorspace) fn_norm_leastB:
wenzelm@13547
   162
  includes fn_norm + continuous
wenzelm@13515
   163
  assumes b: "\<And>b. b \<in> B V f \<Longrightarrow> b \<le> y"
wenzelm@13515
   164
  shows "\<parallel>f\<parallel>\<hyphen>V \<le> y"
wenzelm@13515
   165
proof -
wenzelm@13547
   166
  have "lub (B V f) (\<parallel>f\<parallel>\<hyphen>V)"
ballarin@14214
   167
    by (unfold B_def fn_norm_def) (rule fn_norm_works [OF _ continuous.intro])
wenzelm@13515
   168
  from this and b show ?thesis ..
wenzelm@9035
   169
qed
wenzelm@7535
   170
wenzelm@11472
   171
text {* The norm of a continuous function is always @{text "\<ge> 0"}. *}
wenzelm@7917
   172
wenzelm@13547
   173
lemma (in normed_vectorspace) fn_norm_ge_zero [iff]:
wenzelm@13547
   174
  includes fn_norm + continuous
wenzelm@13515
   175
  shows "0 \<le> \<parallel>f\<parallel>\<hyphen>V"
wenzelm@9035
   176
proof -
wenzelm@10687
   177
  txt {* The function norm is defined as the supremum of @{text B}.
wenzelm@13515
   178
    So it is @{text "\<ge> 0"} if all elements in @{text B} are @{text "\<ge>
wenzelm@13515
   179
    0"}, provided the supremum exists and @{text B} is not empty. *}
wenzelm@13547
   180
  have "lub (B V f) (\<parallel>f\<parallel>\<hyphen>V)"
ballarin@14214
   181
    by (unfold B_def fn_norm_def) (rule fn_norm_works [OF _ continuous.intro])
wenzelm@13515
   182
  moreover have "0 \<in> B V f" ..
wenzelm@13515
   183
  ultimately show ?thesis ..
wenzelm@9035
   184
qed
wenzelm@10687
   185
wenzelm@10687
   186
text {*
wenzelm@10687
   187
  \medskip The fundamental property of function norms is:
wenzelm@10687
   188
  \begin{center}
wenzelm@11472
   189
  @{text "\<bar>f x\<bar> \<le> \<parallel>f\<parallel> \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
   190
  \end{center}
wenzelm@9035
   191
*}
wenzelm@7917
   192
wenzelm@13547
   193
lemma (in normed_vectorspace) fn_norm_le_cong:
wenzelm@13547
   194
  includes fn_norm + continuous + linearform
wenzelm@13515
   195
  assumes x: "x \<in> V"
wenzelm@13515
   196
  shows "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>V * \<parallel>x\<parallel>"
wenzelm@13515
   197
proof cases
wenzelm@13515
   198
  assume "x = 0"
wenzelm@13515
   199
  then have "\<bar>f x\<bar> = \<bar>f 0\<bar>" by simp
wenzelm@13515
   200
  also have "f 0 = 0" ..
wenzelm@13515
   201
  also have "\<bar>\<dots>\<bar> = 0" by simp
wenzelm@13515
   202
  also have "\<dots> \<le> \<parallel>f\<parallel>\<hyphen>V * \<parallel>x\<parallel>"
wenzelm@13515
   203
  proof (rule real_le_mult_order1a)
ballarin@14214
   204
    show "0 \<le> \<parallel>f\<parallel>\<hyphen>V"
ballarin@14214
   205
      by (unfold B_def fn_norm_def)
ballarin@14214
   206
        (rule fn_norm_ge_zero [OF _ continuous.intro])
wenzelm@13515
   207
    show "0 \<le> norm x" ..
wenzelm@13515
   208
  qed
wenzelm@13515
   209
  finally show "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>V * \<parallel>x\<parallel>" .
wenzelm@13515
   210
next
wenzelm@13515
   211
  assume "x \<noteq> 0"
wenzelm@13515
   212
  with x have neq: "\<parallel>x\<parallel> \<noteq> 0" by simp
wenzelm@13515
   213
  then have "\<bar>f x\<bar> = (\<bar>f x\<bar> * inverse \<parallel>x\<parallel>) * \<parallel>x\<parallel>" by simp
wenzelm@13515
   214
  also have "\<dots> \<le>  \<parallel>f\<parallel>\<hyphen>V * \<parallel>x\<parallel>"
paulson@14334
   215
  proof (rule mult_right_mono)
wenzelm@13515
   216
    from x show "0 \<le> \<parallel>x\<parallel>" ..
wenzelm@13547
   217
    from x and neq have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<in> B V f"
wenzelm@13547
   218
      by (auto simp add: B_def real_divide_def)
wenzelm@13547
   219
    then show "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>V"
ballarin@14214
   220
      by (unfold B_def fn_norm_def) (rule fn_norm_ub [OF _ continuous.intro])
wenzelm@9035
   221
  qed
wenzelm@13515
   222
  finally show ?thesis .
wenzelm@9035
   223
qed
wenzelm@7535
   224
wenzelm@10687
   225
text {*
wenzelm@10687
   226
  \medskip The function norm is the least positive real number for
wenzelm@10687
   227
  which the following inequation holds:
wenzelm@10687
   228
  \begin{center}
wenzelm@13515
   229
    @{text "\<bar>f x\<bar> \<le> c \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
   230
  \end{center}
wenzelm@9035
   231
*}
wenzelm@7917
   232
wenzelm@13547
   233
lemma (in normed_vectorspace) fn_norm_least [intro?]:
wenzelm@13547
   234
  includes fn_norm + continuous
wenzelm@13515
   235
  assumes ineq: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" and ge: "0 \<le> c"
wenzelm@13515
   236
  shows "\<parallel>f\<parallel>\<hyphen>V \<le> c"
wenzelm@13547
   237
proof (rule fn_norm_leastB [folded B_def fn_norm_def])
wenzelm@13515
   238
  fix b assume b: "b \<in> B V f"
wenzelm@13515
   239
  show "b \<le> c"
wenzelm@13515
   240
  proof cases
wenzelm@13515
   241
    assume "b = 0"
wenzelm@13515
   242
    with ge show ?thesis by simp
wenzelm@13515
   243
  next
wenzelm@13515
   244
    assume "b \<noteq> 0"
wenzelm@13515
   245
    with b obtain x where b_rep: "b = \<bar>f x\<bar> * inverse \<parallel>x\<parallel>"
wenzelm@13515
   246
        and x_neq: "x \<noteq> 0" and x: "x \<in> V"
wenzelm@13515
   247
      by (auto simp add: B_def real_divide_def)
wenzelm@13515
   248
    note b_rep
wenzelm@13515
   249
    also have "\<bar>f x\<bar> * inverse \<parallel>x\<parallel> \<le> (c * \<parallel>x\<parallel>) * inverse \<parallel>x\<parallel>"
paulson@14334
   250
    proof (rule mult_right_mono)
wenzelm@13515
   251
      have "0 < \<parallel>x\<parallel>" ..
wenzelm@13515
   252
      then show "0 \<le> inverse \<parallel>x\<parallel>" by simp
wenzelm@13515
   253
      from ineq and x show "\<bar>f x\<bar> \<le> c * \<parallel>x\<parallel>" ..
wenzelm@13515
   254
    qed
wenzelm@13515
   255
    also have "\<dots> = c"
wenzelm@13515
   256
    proof -
wenzelm@13515
   257
      from x_neq and x have "\<parallel>x\<parallel> \<noteq> 0" by simp
wenzelm@13515
   258
      then show ?thesis by simp
wenzelm@13515
   259
    qed
wenzelm@13515
   260
    finally show ?thesis .
wenzelm@9035
   261
  qed
ballarin@14214
   262
qed (simp_all! add: continuous_def)
wenzelm@7535
   263
wenzelm@10687
   264
end