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