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