src/HOL/Hahn_Banach/Hahn_Banach.thy
author hoelzl
Thu Sep 02 10:14:32 2010 +0200 (2010-09-02)
changeset 39072 1030b1a166ef
parent 32960 69916a850301
child 44190 fe5504984937
permissions -rw-r--r--
Add lessThan_Suc_eq_insert_0
wenzelm@31795
     1
(*  Title:      HOL/Hahn_Banach/Hahn_Banach.thy
bauerg@9374
     2
    Author:     Gertrud Bauer, TU Munich
bauerg@9374
     3
*)
bauerg@9374
     4
bauerg@9374
     5
header {* The Hahn-Banach Theorem *}
bauerg@9374
     6
wenzelm@31795
     7
theory Hahn_Banach
wenzelm@31795
     8
imports Hahn_Banach_Lemmas
wenzelm@27612
     9
begin
bauerg@9374
    10
bauerg@9374
    11
text {*
wenzelm@10687
    12
  We present the proof of two different versions of the Hahn-Banach
bauerg@9374
    13
  Theorem, closely following \cite[\S36]{Heuser:1986}.
bauerg@9374
    14
*}
bauerg@9374
    15
bauerg@9374
    16
subsection {* The Hahn-Banach Theorem for vector spaces *}
bauerg@9374
    17
bauerg@9374
    18
text {*
wenzelm@10687
    19
  \textbf{Hahn-Banach Theorem.} Let @{text F} be a subspace of a real
wenzelm@10687
    20
  vector space @{text E}, let @{text p} be a semi-norm on @{text E},
wenzelm@10687
    21
  and @{text f} be a linear form defined on @{text F} such that @{text
wenzelm@10687
    22
  f} is bounded by @{text p}, i.e.  @{text "\<forall>x \<in> F. f x \<le> p x"}.  Then
wenzelm@10687
    23
  @{text f} can be extended to a linear form @{text h} on @{text E}
wenzelm@10687
    24
  such that @{text h} is norm-preserving, i.e. @{text h} is also
wenzelm@10687
    25
  bounded by @{text p}.
wenzelm@10687
    26
wenzelm@10687
    27
  \bigskip
wenzelm@10687
    28
  \textbf{Proof Sketch.}
wenzelm@10687
    29
  \begin{enumerate}
wenzelm@10687
    30
wenzelm@10687
    31
  \item Define @{text M} as the set of norm-preserving extensions of
wenzelm@10687
    32
  @{text f} to subspaces of @{text E}. The linear forms in @{text M}
wenzelm@10687
    33
  are ordered by domain extension.
bauerg@9374
    34
wenzelm@10687
    35
  \item We show that every non-empty chain in @{text M} has an upper
wenzelm@10687
    36
  bound in @{text M}.
wenzelm@10687
    37
wenzelm@10687
    38
  \item With Zorn's Lemma we conclude that there is a maximal function
wenzelm@10687
    39
  @{text g} in @{text M}.
wenzelm@10687
    40
wenzelm@10687
    41
  \item The domain @{text H} of @{text g} is the whole space @{text
wenzelm@10687
    42
  E}, as shown by classical contradiction:
wenzelm@10687
    43
wenzelm@10687
    44
  \begin{itemize}
wenzelm@10687
    45
wenzelm@10687
    46
  \item Assuming @{text g} is not defined on whole @{text E}, it can
wenzelm@10687
    47
  still be extended in a norm-preserving way to a super-space @{text
wenzelm@10687
    48
  H'} of @{text H}.
wenzelm@10687
    49
wenzelm@10687
    50
  \item Thus @{text g} can not be maximal. Contradiction!
wenzelm@10687
    51
wenzelm@10687
    52
  \end{itemize}
wenzelm@10687
    53
  \end{enumerate}
bauerg@9374
    54
*}
bauerg@9374
    55
wenzelm@31795
    56
theorem Hahn_Banach:
ballarin@27611
    57
  assumes E: "vectorspace E" and "subspace F E"
ballarin@27611
    58
    and "seminorm E p" and "linearform F f"
wenzelm@13515
    59
  assumes fp: "\<forall>x \<in> F. f x \<le> p x"
wenzelm@13515
    60
  shows "\<exists>h. linearform E h \<and> (\<forall>x \<in> F. h x = f x) \<and> (\<forall>x \<in> E. h x \<le> p x)"
wenzelm@10687
    61
    -- {* Let @{text E} be a vector space, @{text F} a subspace of @{text E}, @{text p} a seminorm on @{text E}, *}
wenzelm@10687
    62
    -- {* and @{text f} a linear form on @{text F} such that @{text f} is bounded by @{text p}, *}
wenzelm@10687
    63
    -- {* then @{text f} can be extended to a linear form @{text h} on @{text E} in a norm-preserving way. \skp *}
wenzelm@9035
    64
proof -
ballarin@29234
    65
  interpret vectorspace E by fact
ballarin@29234
    66
  interpret subspace F E by fact
ballarin@29234
    67
  interpret seminorm E p by fact
ballarin@29234
    68
  interpret linearform F f by fact
wenzelm@10687
    69
  def M \<equiv> "norm_pres_extensions E p F f"
wenzelm@27612
    70
  then have M: "M = \<dots>" by (simp only:)
ballarin@27611
    71
  from E have F: "vectorspace F" ..
wenzelm@23378
    72
  note FE = `F \<unlhd> E`
wenzelm@9035
    73
  {
wenzelm@13515
    74
    fix c assume cM: "c \<in> chain M" and ex: "\<exists>x. x \<in> c"
wenzelm@9503
    75
    have "\<Union>c \<in> M"
wenzelm@13515
    76
      -- {* Show that every non-empty chain @{text c} of @{text M} has an upper bound in @{text M}: *}
wenzelm@13515
    77
      -- {* @{text "\<Union>c"} is greater than any element of the chain @{text c}, so it suffices to show @{text "\<Union>c \<in> M"}. *}
wenzelm@27612
    78
      unfolding M_def
wenzelm@27612
    79
    proof (rule norm_pres_extensionI)
wenzelm@13515
    80
      let ?H = "domain (\<Union>c)"
wenzelm@13515
    81
      let ?h = "funct (\<Union>c)"
bauerg@8084
    82
wenzelm@13515
    83
      have a: "graph ?H ?h = \<Union>c"
wenzelm@13515
    84
      proof (rule graph_domain_funct)
wenzelm@13515
    85
        fix x y z assume "(x, y) \<in> \<Union>c" and "(x, z) \<in> \<Union>c"
wenzelm@13515
    86
        with M_def cM show "z = y" by (rule sup_definite)
wenzelm@9035
    87
      qed
wenzelm@13515
    88
      moreover from M cM a have "linearform ?H ?h"
wenzelm@13515
    89
        by (rule sup_lf)
wenzelm@23378
    90
      moreover from a M cM ex FE E have "?H \<unlhd> E"
wenzelm@13515
    91
        by (rule sup_subE)
wenzelm@23378
    92
      moreover from a M cM ex FE have "F \<unlhd> ?H"
wenzelm@13515
    93
        by (rule sup_supF)
wenzelm@13515
    94
      moreover from a M cM ex have "graph F f \<subseteq> graph ?H ?h"
wenzelm@13515
    95
        by (rule sup_ext)
wenzelm@13515
    96
      moreover from a M cM have "\<forall>x \<in> ?H. ?h x \<le> p x"
wenzelm@13515
    97
        by (rule sup_norm_pres)
wenzelm@13515
    98
      ultimately show "\<exists>H h. \<Union>c = graph H h
wenzelm@13515
    99
          \<and> linearform H h
wenzelm@13515
   100
          \<and> H \<unlhd> E
wenzelm@13515
   101
          \<and> F \<unlhd> H
wenzelm@13515
   102
          \<and> graph F f \<subseteq> graph H h
wenzelm@13515
   103
          \<and> (\<forall>x \<in> H. h x \<le> p x)" by blast
wenzelm@9035
   104
    qed
wenzelm@9035
   105
  }
wenzelm@27612
   106
  then have "\<exists>g \<in> M. \<forall>x \<in> M. g \<subseteq> x \<longrightarrow> g = x"
wenzelm@10687
   107
  -- {* With Zorn's Lemma we can conclude that there is a maximal element in @{text M}. \skp *}
wenzelm@9035
   108
  proof (rule Zorn's_Lemma)
wenzelm@13515
   109
      -- {* We show that @{text M} is non-empty: *}
wenzelm@13515
   110
    show "graph F f \<in> M"
wenzelm@27612
   111
      unfolding M_def
wenzelm@27612
   112
    proof (rule norm_pres_extensionI2)
wenzelm@23378
   113
      show "linearform F f" by fact
wenzelm@23378
   114
      show "F \<unlhd> E" by fact
wenzelm@13515
   115
      from F show "F \<unlhd> F" by (rule vectorspace.subspace_refl)
wenzelm@13515
   116
      show "graph F f \<subseteq> graph F f" ..
wenzelm@23378
   117
      show "\<forall>x\<in>F. f x \<le> p x" by fact
wenzelm@13515
   118
    qed
wenzelm@9035
   119
  qed
wenzelm@23378
   120
  then obtain g where gM: "g \<in> M" and gx: "\<forall>x \<in> M. g \<subseteq> x \<longrightarrow> g = x"
wenzelm@13515
   121
    by blast
wenzelm@27612
   122
  from gM obtain H h where
wenzelm@13515
   123
      g_rep: "g = graph H h"
wenzelm@13515
   124
    and linearform: "linearform H h"
wenzelm@13515
   125
    and HE: "H \<unlhd> E" and FH: "F \<unlhd> H"
wenzelm@13515
   126
    and graphs: "graph F f \<subseteq> graph H h"
wenzelm@27612
   127
    and hp: "\<forall>x \<in> H. h x \<le> p x" unfolding M_def ..
wenzelm@10687
   128
      -- {* @{text g} is a norm-preserving extension of @{text f}, in other words: *}
wenzelm@10687
   129
      -- {* @{text g} is the graph of some linear form @{text h} defined on a subspace @{text H} of @{text E}, *}
wenzelm@10687
   130
      -- {* and @{text h} is an extension of @{text f} that is again bounded by @{text p}. \skp *}
wenzelm@23378
   131
  from HE E have H: "vectorspace H"
wenzelm@13547
   132
    by (rule subspace.vectorspace)
wenzelm@13515
   133
wenzelm@13515
   134
  have HE_eq: "H = E"
wenzelm@10687
   135
    -- {* We show that @{text h} is defined on whole @{text E} by classical contradiction. \skp *}
wenzelm@13515
   136
  proof (rule classical)
wenzelm@13515
   137
    assume neq: "H \<noteq> E"
wenzelm@10687
   138
      -- {* Assume @{text h} is not defined on whole @{text E}. Then show that @{text h} can be extended *}
wenzelm@10687
   139
      -- {* in a norm-preserving way to a function @{text h'} with the graph @{text g'}. \skp *}
wenzelm@13515
   140
    have "\<exists>g' \<in> M. g \<subseteq> g' \<and> g \<noteq> g'"
wenzelm@13515
   141
    proof -
wenzelm@13515
   142
      from HE have "H \<subseteq> E" ..
wenzelm@13515
   143
      with neq obtain x' where x'E: "x' \<in> E" and "x' \<notin> H" by blast
wenzelm@13515
   144
      obtain x': "x' \<noteq> 0"
wenzelm@13515
   145
      proof
wenzelm@13515
   146
        show "x' \<noteq> 0"
wenzelm@13515
   147
        proof
wenzelm@13515
   148
          assume "x' = 0"
wenzelm@13515
   149
          with H have "x' \<in> H" by (simp only: vectorspace.zero)
wenzelm@23378
   150
          with `x' \<notin> H` show False by contradiction
wenzelm@9475
   151
        qed
wenzelm@13515
   152
      qed
wenzelm@13515
   153
wenzelm@13515
   154
      def H' \<equiv> "H + lin x'"
wenzelm@10687
   155
        -- {* Define @{text H'} as the direct sum of @{text H} and the linear closure of @{text x'}. \skp *}
wenzelm@13515
   156
      have HH': "H \<unlhd> H'"
wenzelm@13515
   157
      proof (unfold H'_def)
wenzelm@23378
   158
        from x'E have "vectorspace (lin x')" ..
wenzelm@13515
   159
        with H show "H \<unlhd> H + lin x'" ..
wenzelm@13515
   160
      qed
wenzelm@13515
   161
wenzelm@13515
   162
      obtain xi where
wenzelm@23378
   163
        xi: "\<forall>y \<in> H. - p (y + x') - h y \<le> xi
wenzelm@13515
   164
          \<and> xi \<le> p (y + x') - h y"
wenzelm@10687
   165
        -- {* Pick a real number @{text \<xi>} that fulfills certain inequations; this will *}
wenzelm@10687
   166
        -- {* be used to establish that @{text h'} is a norm-preserving extension of @{text h}.
wenzelm@9475
   167
           \label{ex-xi-use}\skp *}
wenzelm@13515
   168
      proof -
wenzelm@13515
   169
        from H have "\<exists>xi. \<forall>y \<in> H. - p (y + x') - h y \<le> xi
wenzelm@13515
   170
            \<and> xi \<le> p (y + x') - h y"
wenzelm@13515
   171
        proof (rule ex_xi)
wenzelm@13515
   172
          fix u v assume u: "u \<in> H" and v: "v \<in> H"
wenzelm@13515
   173
          with HE have uE: "u \<in> E" and vE: "v \<in> E" by auto
wenzelm@13515
   174
          from H u v linearform have "h v - h u = h (v - u)"
wenzelm@13547
   175
            by (simp add: linearform.diff)
wenzelm@13515
   176
          also from hp and H u v have "\<dots> \<le> p (v - u)"
wenzelm@13515
   177
            by (simp only: vectorspace.diff_closed)
wenzelm@13515
   178
          also from x'E uE vE have "v - u = x' + - x' + v + - u"
wenzelm@13515
   179
            by (simp add: diff_eq1)
wenzelm@13515
   180
          also from x'E uE vE have "\<dots> = v + x' + - (u + x')"
wenzelm@13515
   181
            by (simp add: add_ac)
wenzelm@13515
   182
          also from x'E uE vE have "\<dots> = (v + x') - (u + x')"
wenzelm@13515
   183
            by (simp add: diff_eq1)
wenzelm@13547
   184
          also from x'E uE vE E have "p \<dots> \<le> p (v + x') + p (u + x')"
wenzelm@13515
   185
            by (simp add: diff_subadditive)
wenzelm@13515
   186
          finally have "h v - h u \<le> p (v + x') + p (u + x')" .
wenzelm@13547
   187
          then show "- p (u + x') - h u \<le> p (v + x') - h v" by simp
wenzelm@13515
   188
        qed
wenzelm@23378
   189
        then show thesis by (blast intro: that)
wenzelm@13515
   190
      qed
wenzelm@13515
   191
wenzelm@13515
   192
      def h' \<equiv> "\<lambda>x. let (y, a) =
wenzelm@13515
   193
          SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H in h y + a * xi"
wenzelm@13515
   194
        -- {* Define the extension @{text h'} of @{text h} to @{text H'} using @{text \<xi>}. \skp *}
wenzelm@13515
   195
wenzelm@13515
   196
      have "g \<subseteq> graph H' h' \<and> g \<noteq> graph H' h'"
wenzelm@13515
   197
        -- {* @{text h'} is an extension of @{text h} \dots \skp *}
wenzelm@13515
   198
      proof
wenzelm@13515
   199
        show "g \<subseteq> graph H' h'"
wenzelm@9475
   200
        proof -
wenzelm@13515
   201
          have  "graph H h \<subseteq> graph H' h'"
wenzelm@13515
   202
          proof (rule graph_extI)
wenzelm@13515
   203
            fix t assume t: "t \<in> H"
wenzelm@23378
   204
            from E HE t have "(SOME (y, a). t = y + a \<cdot> x' \<and> y \<in> H) = (t, 0)"
wenzelm@32960
   205
              using `x' \<notin> H` `x' \<in> E` `x' \<noteq> 0` by (rule decomp_H'_H)
wenzelm@13515
   206
            with h'_def show "h t = h' t" by (simp add: Let_def)
wenzelm@13515
   207
          next
wenzelm@13515
   208
            from HH' show "H \<subseteq> H'" ..
wenzelm@9475
   209
          qed
wenzelm@13515
   210
          with g_rep show ?thesis by (simp only:)
wenzelm@9475
   211
        qed
wenzelm@9475
   212
wenzelm@13515
   213
        show "g \<noteq> graph H' h'"
wenzelm@13515
   214
        proof -
wenzelm@13515
   215
          have "graph H h \<noteq> graph H' h'"
wenzelm@9475
   216
          proof
wenzelm@13515
   217
            assume eq: "graph H h = graph H' h'"
wenzelm@13515
   218
            have "x' \<in> H'"
wenzelm@32960
   219
              unfolding H'_def
wenzelm@27612
   220
            proof
wenzelm@13515
   221
              from H show "0 \<in> H" by (rule vectorspace.zero)
wenzelm@13515
   222
              from x'E show "x' \<in> lin x'" by (rule x_lin_x)
wenzelm@13515
   223
              from x'E show "x' = 0 + x'" by simp
bauerg@9261
   224
            qed
wenzelm@27612
   225
            then have "(x', h' x') \<in> graph H' h'" ..
wenzelm@13515
   226
            with eq have "(x', h' x') \<in> graph H h" by (simp only:)
wenzelm@27612
   227
            then have "x' \<in> H" ..
wenzelm@23378
   228
            with `x' \<notin> H` show False by contradiction
wenzelm@9035
   229
          qed
wenzelm@13515
   230
          with g_rep show ?thesis by simp
wenzelm@9035
   231
        qed
bauerg@9256
   232
      qed
wenzelm@13515
   233
      moreover have "graph H' h' \<in> M"
wenzelm@13515
   234
        -- {* and @{text h'} is norm-preserving. \skp *}
wenzelm@13515
   235
      proof (unfold M_def)
wenzelm@13515
   236
        show "graph H' h' \<in> norm_pres_extensions E p F f"
wenzelm@13515
   237
        proof (rule norm_pres_extensionI2)
wenzelm@23378
   238
          show "linearform H' h'"
wenzelm@32960
   239
            using h'_def H'_def HE linearform `x' \<notin> H` `x' \<in> E` `x' \<noteq> 0` E
wenzelm@32960
   240
            by (rule h'_lf)
wenzelm@13515
   241
          show "H' \<unlhd> E"
wenzelm@32960
   242
          unfolding H'_def
wenzelm@23378
   243
          proof
wenzelm@23378
   244
            show "H \<unlhd> E" by fact
wenzelm@23378
   245
            show "vectorspace E" by fact
wenzelm@13515
   246
            from x'E show "lin x' \<unlhd> E" ..
wenzelm@13515
   247
          qed
wenzelm@23378
   248
          from H `F \<unlhd> H` HH' show FH': "F \<unlhd> H'"
wenzelm@13515
   249
            by (rule vectorspace.subspace_trans)
wenzelm@13515
   250
          show "graph F f \<subseteq> graph H' h'"
wenzelm@13515
   251
          proof (rule graph_extI)
wenzelm@13515
   252
            fix x assume x: "x \<in> F"
wenzelm@13515
   253
            with graphs have "f x = h x" ..
wenzelm@13515
   254
            also have "\<dots> = h x + 0 * xi" by simp
wenzelm@13515
   255
            also have "\<dots> = (let (y, a) = (x, 0) in h y + a * xi)"
wenzelm@13515
   256
              by (simp add: Let_def)
wenzelm@13515
   257
            also have "(x, 0) =
wenzelm@13515
   258
                (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)"
wenzelm@32960
   259
              using E HE
wenzelm@13515
   260
            proof (rule decomp_H'_H [symmetric])
wenzelm@13515
   261
              from FH x show "x \<in> H" ..
wenzelm@13515
   262
              from x' show "x' \<noteq> 0" .
wenzelm@32960
   263
              show "x' \<notin> H" by fact
wenzelm@32960
   264
              show "x' \<in> E" by fact
wenzelm@13515
   265
            qed
wenzelm@13515
   266
            also have
wenzelm@13515
   267
              "(let (y, a) = (SOME (y, a). x = y + a \<cdot> x' \<and> y \<in> H)
wenzelm@13515
   268
              in h y + a * xi) = h' x" by (simp only: h'_def)
wenzelm@13515
   269
            finally show "f x = h' x" .
wenzelm@13515
   270
          next
wenzelm@13515
   271
            from FH' show "F \<subseteq> H'" ..
wenzelm@13515
   272
          qed
wenzelm@23378
   273
          show "\<forall>x \<in> H'. h' x \<le> p x"
wenzelm@32960
   274
            using h'_def H'_def `x' \<notin> H` `x' \<in> E` `x' \<noteq> 0` E HE
wenzelm@32960
   275
              `seminorm E p` linearform and hp xi
wenzelm@32960
   276
            by (rule h'_norm_pres)
wenzelm@13515
   277
        qed
wenzelm@13515
   278
      qed
wenzelm@13515
   279
      ultimately show ?thesis ..
wenzelm@9475
   280
    qed
wenzelm@27612
   281
    then have "\<not> (\<forall>x \<in> M. g \<subseteq> x \<longrightarrow> g = x)" by simp
wenzelm@13515
   282
      -- {* So the graph @{text g} of @{text h} cannot be maximal. Contradiction! \skp *}
wenzelm@23378
   283
    with gx show "H = E" by contradiction
wenzelm@9035
   284
  qed
wenzelm@13515
   285
wenzelm@13515
   286
  from HE_eq and linearform have "linearform E h"
wenzelm@13515
   287
    by (simp only:)
wenzelm@13515
   288
  moreover have "\<forall>x \<in> F. h x = f x"
wenzelm@13515
   289
  proof
wenzelm@13515
   290
    fix x assume "x \<in> F"
wenzelm@13515
   291
    with graphs have "f x = h x" ..
wenzelm@13515
   292
    then show "h x = f x" ..
wenzelm@13515
   293
  qed
wenzelm@13515
   294
  moreover from HE_eq and hp have "\<forall>x \<in> E. h x \<le> p x"
wenzelm@13515
   295
    by (simp only:)
wenzelm@13515
   296
  ultimately show ?thesis by blast
wenzelm@9475
   297
qed
bauerg@9374
   298
bauerg@9374
   299
bauerg@9374
   300
subsection  {* Alternative formulation *}
bauerg@9374
   301
wenzelm@10687
   302
text {*
wenzelm@10687
   303
  The following alternative formulation of the Hahn-Banach
wenzelm@31795
   304
  Theorem\label{abs-Hahn-Banach} uses the fact that for a real linear
wenzelm@10687
   305
  form @{text f} and a seminorm @{text p} the following inequations
wenzelm@10687
   306
  are equivalent:\footnote{This was shown in lemma @{thm [source]
wenzelm@10687
   307
  abs_ineq_iff} (see page \pageref{abs-ineq-iff}).}
wenzelm@10687
   308
  \begin{center}
wenzelm@10687
   309
  \begin{tabular}{lll}
wenzelm@10687
   310
  @{text "\<forall>x \<in> H. \<bar>h x\<bar> \<le> p x"} & and &
wenzelm@10687
   311
  @{text "\<forall>x \<in> H. h x \<le> p x"} \\
wenzelm@10687
   312
  \end{tabular}
wenzelm@10687
   313
  \end{center}
bauerg@9374
   314
*}
bauerg@9374
   315
wenzelm@31795
   316
theorem abs_Hahn_Banach:
ballarin@27611
   317
  assumes E: "vectorspace E" and FE: "subspace F E"
ballarin@27611
   318
    and lf: "linearform F f" and sn: "seminorm E p"
wenzelm@13515
   319
  assumes fp: "\<forall>x \<in> F. \<bar>f x\<bar> \<le> p x"
wenzelm@13515
   320
  shows "\<exists>g. linearform E g
wenzelm@13515
   321
    \<and> (\<forall>x \<in> F. g x = f x)
wenzelm@10687
   322
    \<and> (\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x)"
bauerg@9374
   323
proof -
ballarin@29234
   324
  interpret vectorspace E by fact
ballarin@29234
   325
  interpret subspace F E by fact
ballarin@29234
   326
  interpret linearform F f by fact
ballarin@29234
   327
  interpret seminorm E p by fact
wenzelm@27612
   328
  have "\<exists>g. linearform E g \<and> (\<forall>x \<in> F. g x = f x) \<and> (\<forall>x \<in> E. g x \<le> p x)"
wenzelm@27612
   329
    using E FE sn lf
wenzelm@31795
   330
  proof (rule Hahn_Banach)
wenzelm@13515
   331
    show "\<forall>x \<in> F. f x \<le> p x"
wenzelm@23378
   332
      using FE E sn lf and fp by (rule abs_ineq_iff [THEN iffD1])
wenzelm@13515
   333
  qed
wenzelm@23378
   334
  then obtain g where lg: "linearform E g" and *: "\<forall>x \<in> F. g x = f x"
wenzelm@23378
   335
      and **: "\<forall>x \<in> E. g x \<le> p x" by blast
wenzelm@13515
   336
  have "\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x"
wenzelm@27612
   337
    using _ E sn lg **
wenzelm@13515
   338
  proof (rule abs_ineq_iff [THEN iffD2])
wenzelm@13515
   339
    show "E \<unlhd> E" ..
wenzelm@13515
   340
  qed
wenzelm@23378
   341
  with lg * show ?thesis by blast
wenzelm@9475
   342
qed
wenzelm@13515
   343
bauerg@9374
   344
bauerg@9374
   345
subsection {* The Hahn-Banach Theorem for normed spaces *}
bauerg@9374
   346
wenzelm@10687
   347
text {*
wenzelm@10687
   348
  Every continuous linear form @{text f} on a subspace @{text F} of a
wenzelm@10687
   349
  norm space @{text E}, can be extended to a continuous linear form
wenzelm@10687
   350
  @{text g} on @{text E} such that @{text "\<parallel>f\<parallel> = \<parallel>g\<parallel>"}.
wenzelm@10687
   351
*}
bauerg@9374
   352
wenzelm@31795
   353
theorem norm_Hahn_Banach:
ballarin@27611
   354
  fixes V and norm ("\<parallel>_\<parallel>")
ballarin@27611
   355
  fixes B defines "\<And>V f. B V f \<equiv> {0} \<union> {\<bar>f x\<bar> / \<parallel>x\<parallel> | x. x \<noteq> 0 \<and> x \<in> V}"
ballarin@27611
   356
  fixes fn_norm ("\<parallel>_\<parallel>\<hyphen>_" [0, 1000] 999)
ballarin@27611
   357
  defines "\<And>V f. \<parallel>f\<parallel>\<hyphen>V \<equiv> \<Squnion>(B V f)"
ballarin@27611
   358
  assumes E_norm: "normed_vectorspace E norm" and FE: "subspace F E"
ballarin@27611
   359
    and linearform: "linearform F f" and "continuous F norm f"
wenzelm@13515
   360
  shows "\<exists>g. linearform E g
wenzelm@13515
   361
     \<and> continuous E norm g
wenzelm@10687
   362
     \<and> (\<forall>x \<in> F. g x = f x)
wenzelm@13515
   363
     \<and> \<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F"
wenzelm@9475
   364
proof -
ballarin@29234
   365
  interpret normed_vectorspace E norm by fact
ballarin@29234
   366
  interpret normed_vectorspace_with_fn_norm E norm B fn_norm
ballarin@27611
   367
    by (auto simp: B_def fn_norm_def) intro_locales
ballarin@29234
   368
  interpret subspace F E by fact
ballarin@29234
   369
  interpret linearform F f by fact
ballarin@29234
   370
  interpret continuous F norm f by fact
haftmann@28823
   371
  have E: "vectorspace E" by intro_locales
haftmann@28823
   372
  have F: "vectorspace F" by rule intro_locales
ballarin@14214
   373
  have F_norm: "normed_vectorspace F norm"
wenzelm@23378
   374
    using FE E_norm by (rule subspace_normed_vs)
wenzelm@13547
   375
  have ge_zero: "0 \<le> \<parallel>f\<parallel>\<hyphen>F"
ballarin@27611
   376
    by (rule normed_vectorspace_with_fn_norm.fn_norm_ge_zero
ballarin@27611
   377
      [OF normed_vectorspace_with_fn_norm.intro,
ballarin@27611
   378
       OF F_norm `continuous F norm f` , folded B_def fn_norm_def])
wenzelm@13515
   379
  txt {* We define a function @{text p} on @{text E} as follows:
wenzelm@13515
   380
    @{text "p x = \<parallel>f\<parallel> \<cdot> \<parallel>x\<parallel>"} *}
wenzelm@13515
   381
  def p \<equiv> "\<lambda>x. \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
wenzelm@13515
   382
wenzelm@13515
   383
  txt {* @{text p} is a seminorm on @{text E}: *}
wenzelm@13515
   384
  have q: "seminorm E p"
wenzelm@13515
   385
  proof
wenzelm@13515
   386
    fix x y a assume x: "x \<in> E" and y: "y \<in> E"
wenzelm@27612
   387
    
wenzelm@13515
   388
    txt {* @{text p} is positive definite: *}
wenzelm@27612
   389
    have "0 \<le> \<parallel>f\<parallel>\<hyphen>F" by (rule ge_zero)
wenzelm@27612
   390
    moreover from x have "0 \<le> \<parallel>x\<parallel>" ..
bauerg@14710
   391
    ultimately show "0 \<le> p x"  
bauerg@14710
   392
      by (simp add: p_def zero_le_mult_iff)
wenzelm@13515
   393
wenzelm@13515
   394
    txt {* @{text p} is absolutely homogenous: *}
wenzelm@9475
   395
wenzelm@13515
   396
    show "p (a \<cdot> x) = \<bar>a\<bar> * p x"
wenzelm@13515
   397
    proof -
wenzelm@13547
   398
      have "p (a \<cdot> x) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>a \<cdot> x\<parallel>" by (simp only: p_def)
wenzelm@13547
   399
      also from x have "\<parallel>a \<cdot> x\<parallel> = \<bar>a\<bar> * \<parallel>x\<parallel>" by (rule abs_homogenous)
wenzelm@13547
   400
      also have "\<parallel>f\<parallel>\<hyphen>F * (\<bar>a\<bar> * \<parallel>x\<parallel>) = \<bar>a\<bar> * (\<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>)" by simp
wenzelm@13547
   401
      also have "\<dots> = \<bar>a\<bar> * p x" by (simp only: p_def)
wenzelm@13515
   402
      finally show ?thesis .
wenzelm@13515
   403
    qed
wenzelm@13515
   404
wenzelm@13515
   405
    txt {* Furthermore, @{text p} is subadditive: *}
wenzelm@9475
   406
wenzelm@13515
   407
    show "p (x + y) \<le> p x + p y"
wenzelm@13515
   408
    proof -
wenzelm@13547
   409
      have "p (x + y) = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel>" by (simp only: p_def)
bauerg@14710
   410
      also have a: "0 \<le> \<parallel>f\<parallel>\<hyphen>F" by (rule ge_zero)
bauerg@14710
   411
      from x y have "\<parallel>x + y\<parallel> \<le> \<parallel>x\<parallel> + \<parallel>y\<parallel>" ..
bauerg@14710
   412
      with a have " \<parallel>f\<parallel>\<hyphen>F * \<parallel>x + y\<parallel> \<le> \<parallel>f\<parallel>\<hyphen>F * (\<parallel>x\<parallel> + \<parallel>y\<parallel>)"
bauerg@14710
   413
        by (simp add: mult_left_mono)
paulson@14334
   414
      also have "\<dots> = \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel> + \<parallel>f\<parallel>\<hyphen>F * \<parallel>y\<parallel>" by (simp only: right_distrib)
wenzelm@13547
   415
      also have "\<dots> = p x + p y" by (simp only: p_def)
wenzelm@13515
   416
      finally show ?thesis .
wenzelm@13515
   417
    qed
wenzelm@13515
   418
  qed
wenzelm@9475
   419
wenzelm@13515
   420
  txt {* @{text f} is bounded by @{text p}. *}
bauerg@9374
   421
wenzelm@13515
   422
  have "\<forall>x \<in> F. \<bar>f x\<bar> \<le> p x"
wenzelm@13515
   423
  proof
wenzelm@13515
   424
    fix x assume "x \<in> F"
wenzelm@27612
   425
    with `continuous F norm f` and linearform
wenzelm@13515
   426
    show "\<bar>f x\<bar> \<le> p x"
wenzelm@27612
   427
      unfolding p_def by (rule normed_vectorspace_with_fn_norm.fn_norm_le_cong
ballarin@27611
   428
        [OF normed_vectorspace_with_fn_norm.intro,
ballarin@27611
   429
         OF F_norm, folded B_def fn_norm_def])
wenzelm@13515
   430
  qed
wenzelm@9475
   431
wenzelm@13515
   432
  txt {* Using the fact that @{text p} is a seminorm and @{text f} is bounded
wenzelm@13515
   433
    by @{text p} we can apply the Hahn-Banach Theorem for real vector
wenzelm@13515
   434
    spaces. So @{text f} can be extended in a norm-preserving way to
wenzelm@13515
   435
    some function @{text g} on the whole vector space @{text E}. *}
wenzelm@9475
   436
wenzelm@13515
   437
  with E FE linearform q obtain g where
wenzelm@27612
   438
      linearformE: "linearform E g"
wenzelm@27612
   439
    and a: "\<forall>x \<in> F. g x = f x"
wenzelm@27612
   440
    and b: "\<forall>x \<in> E. \<bar>g x\<bar> \<le> p x"
wenzelm@31795
   441
    by (rule abs_Hahn_Banach [elim_format]) iprover
wenzelm@9475
   442
wenzelm@13515
   443
  txt {* We furthermore have to show that @{text g} is also continuous: *}
wenzelm@13515
   444
wenzelm@13515
   445
  have g_cont: "continuous E norm g" using linearformE
wenzelm@9475
   446
  proof
wenzelm@9503
   447
    fix x assume "x \<in> E"
wenzelm@13515
   448
    with b show "\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
wenzelm@13515
   449
      by (simp only: p_def)
wenzelm@10687
   450
  qed
bauerg@9374
   451
wenzelm@13515
   452
  txt {* To complete the proof, we show that @{text "\<parallel>g\<parallel> = \<parallel>f\<parallel>"}. *}
wenzelm@9475
   453
wenzelm@13515
   454
  have "\<parallel>g\<parallel>\<hyphen>E = \<parallel>f\<parallel>\<hyphen>F"
wenzelm@9475
   455
  proof (rule order_antisym)
wenzelm@10687
   456
    txt {*
wenzelm@10687
   457
      First we show @{text "\<parallel>g\<parallel> \<le> \<parallel>f\<parallel>"}.  The function norm @{text
wenzelm@10687
   458
      "\<parallel>g\<parallel>"} is defined as the smallest @{text "c \<in> \<real>"} such that
wenzelm@10687
   459
      \begin{center}
wenzelm@10687
   460
      \begin{tabular}{l}
wenzelm@10687
   461
      @{text "\<forall>x \<in> E. \<bar>g x\<bar> \<le> c \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
   462
      \end{tabular}
wenzelm@10687
   463
      \end{center}
wenzelm@10687
   464
      \noindent Furthermore holds
wenzelm@10687
   465
      \begin{center}
wenzelm@10687
   466
      \begin{tabular}{l}
wenzelm@10687
   467
      @{text "\<forall>x \<in> E. \<bar>g x\<bar> \<le> \<parallel>f\<parallel> \<cdot> \<parallel>x\<parallel>"}
wenzelm@10687
   468
      \end{tabular}
wenzelm@10687
   469
      \end{center}
wenzelm@9475
   470
    *}
wenzelm@10687
   471
wenzelm@13515
   472
    have "\<forall>x \<in> E. \<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
wenzelm@9475
   473
    proof
wenzelm@10687
   474
      fix x assume "x \<in> E"
wenzelm@13515
   475
      with b show "\<bar>g x\<bar> \<le> \<parallel>f\<parallel>\<hyphen>F * \<parallel>x\<parallel>"
wenzelm@13515
   476
        by (simp only: p_def)
bauerg@9374
   477
    qed
ballarin@15206
   478
    from g_cont this ge_zero
wenzelm@13515
   479
    show "\<parallel>g\<parallel>\<hyphen>E \<le> \<parallel>f\<parallel>\<hyphen>F"
wenzelm@13547
   480
      by (rule fn_norm_least [of g, folded B_def fn_norm_def])
bauerg@9374
   481
wenzelm@13515
   482
    txt {* The other direction is achieved by a similar argument. *}
wenzelm@13515
   483
wenzelm@13547
   484
    show "\<parallel>f\<parallel>\<hyphen>F \<le> \<parallel>g\<parallel>\<hyphen>E"
ballarin@27611
   485
    proof (rule normed_vectorspace_with_fn_norm.fn_norm_least
wenzelm@32960
   486
        [OF normed_vectorspace_with_fn_norm.intro,
wenzelm@32960
   487
         OF F_norm, folded B_def fn_norm_def])
wenzelm@13547
   488
      show "\<forall>x \<in> F. \<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>"
wenzelm@13547
   489
      proof
wenzelm@32960
   490
        fix x assume x: "x \<in> F"
wenzelm@32960
   491
        from a x have "g x = f x" ..
wenzelm@32960
   492
        then have "\<bar>f x\<bar> = \<bar>g x\<bar>" by (simp only:)
wenzelm@32960
   493
        also from g_cont
wenzelm@32960
   494
        have "\<dots> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>"
wenzelm@32960
   495
        proof (rule fn_norm_le_cong [OF _ linearformE, folded B_def fn_norm_def])
wenzelm@32960
   496
          from FE x show "x \<in> E" ..
wenzelm@32960
   497
        qed
wenzelm@32960
   498
        finally show "\<bar>f x\<bar> \<le> \<parallel>g\<parallel>\<hyphen>E * \<parallel>x\<parallel>" .
bauerg@9374
   499
      qed
wenzelm@13547
   500
      show "0 \<le> \<parallel>g\<parallel>\<hyphen>E"
wenzelm@32960
   501
        using g_cont
wenzelm@32960
   502
        by (rule fn_norm_ge_zero [of g, folded B_def fn_norm_def])
wenzelm@23378
   503
      show "continuous F norm f" by fact
wenzelm@10687
   504
    qed
bauerg@9374
   505
  qed
wenzelm@13547
   506
  with linearformE a g_cont show ?thesis by blast
wenzelm@9475
   507
qed
bauerg@9374
   508
wenzelm@9475
   509
end