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