src/HOL/Real/HahnBanach/FunctionNorm.thy
changeset 12018 ec054019c910
parent 11701 3d51fbf81c17
child 13515 a6a7025fd7e8
equal deleted inserted replaced
12017:78b8f9e13300 12018:ec054019c910
    71 *}
    71 *}
    72 
    72 
    73 constdefs
    73 constdefs
    74   B :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> ('a::{plus, minus, zero} \<Rightarrow> real) \<Rightarrow> real set"
    74   B :: "'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> ('a::{plus, minus, zero} \<Rightarrow> real) \<Rightarrow> real set"
    75   "B V norm f \<equiv>
    75   "B V norm f \<equiv>
    76   {Numeral0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
    76   {0} \<union> {\<bar>f x\<bar> * inverse (norm x) | x. x \<noteq> 0 \<and> x \<in> V}"
    77 
    77 
    78 text {*
    78 text {*
    79   @{text n} is the function norm of @{text f}, iff @{text n} is the
    79   @{text n} is the function norm of @{text f}, iff @{text n} is the
    80   supremum of @{text B}.
    80   supremum of @{text B}.
    81 *}
    81 *}
    95   "function_norm f V norm \<equiv> Sup UNIV (B V norm f)"
    95   "function_norm f V norm \<equiv> Sup UNIV (B V norm f)"
    96 
    96 
    97 syntax
    97 syntax
    98   function_norm :: "('a \<Rightarrow> real) \<Rightarrow> 'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> real"  ("\<parallel>_\<parallel>_,_")
    98   function_norm :: "('a \<Rightarrow> real) \<Rightarrow> 'a set \<Rightarrow> ('a \<Rightarrow> real) \<Rightarrow> real"  ("\<parallel>_\<parallel>_,_")
    99 
    99 
   100 lemma B_not_empty: "Numeral0 \<in> B V norm f"
   100 lemma B_not_empty: "0 \<in> B V norm f"
   101   by (unfold B_def) blast
   101   by (unfold B_def) blast
   102 
   102 
   103 text {*
   103 text {*
   104   The following lemma states that every continuous linear form on a
   104   The following lemma states that every continuous linear form on a
   105   normed space @{text "(V, \<parallel>\<cdot>\<parallel>)"} has a function norm.
   105   normed space @{text "(V, \<parallel>\<cdot>\<parallel>)"} has a function norm.
   123 
   123 
   124     txt {* First we have to show that @{text B} is non-empty: *}
   124     txt {* First we have to show that @{text B} is non-empty: *}
   125 
   125 
   126     show "\<exists>X. X \<in> B V norm f"
   126     show "\<exists>X. X \<in> B V norm f"
   127     proof
   127     proof
   128       show "Numeral0 \<in> (B V norm f)" by (unfold B_def) blast
   128       show "0 \<in> (B V norm f)" by (unfold B_def) blast
   129     qed
   129     qed
   130 
   130 
   131     txt {* Then we have to show that @{text B} is bounded: *}
   131     txt {* Then we have to show that @{text B} is bounded: *}
   132 
   132 
   133     from e show "\<exists>Y. isUb UNIV (B V norm f) Y"
   133     from e show "\<exists>Y. isUb UNIV (B V norm f) Y"
   134     proof
   134     proof
   135 
   135 
   136       txt {* We know that @{text f} is bounded by some value @{text c}. *}
   136       txt {* We know that @{text f} is bounded by some value @{text c}. *}
   137 
   137 
   138       fix c assume a: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
   138       fix c assume a: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
   139       def b \<equiv> "max c Numeral0"
   139       def b \<equiv> "max c 0"
   140 
   140 
   141       show "?thesis"
   141       show "?thesis"
   142       proof (intro exI isUbI setleI ballI, unfold B_def,
   142       proof (intro exI isUbI setleI ballI, unfold B_def,
   143         elim UnE CollectE exE conjE singletonE)
   143         elim UnE CollectE exE conjE singletonE)
   144 
   144 
   146         constant @{text b}, such that @{text "y \<le> b"} for all
   146         constant @{text b}, such that @{text "y \<le> b"} for all
   147         @{text "y \<in> B"}. Due to the definition of @{text B} there are
   147         @{text "y \<in> B"}. Due to the definition of @{text B} there are
   148         two cases for @{text "y \<in> B"}.  If @{text "y = 0"} then
   148         two cases for @{text "y \<in> B"}.  If @{text "y = 0"} then
   149         @{text "y \<le> max c 0"}: *}
   149         @{text "y \<le> max c 0"}: *}
   150 
   150 
   151         fix y assume "y = (Numeral0::real)"
   151         fix y assume "y = (0::real)"
   152         show "y \<le> b" by (simp! add: le_maxI2)
   152         show "y \<le> b" by (simp! add: le_maxI2)
   153 
   153 
   154         txt {* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
   154         txt {* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
   155         @{text "x \<in> V"} with @{text "x \<noteq> 0"}. *}
   155         @{text "x \<in> V"} with @{text "x \<noteq> 0"}. *}
   156 
   156 
   162         fact that @{text f} is bounded. *}
   162         fact that @{text f} is bounded. *}
   163 
   163 
   164         assume "y = \<bar>f x\<bar> * inverse (norm x)"
   164         assume "y = \<bar>f x\<bar> * inverse (norm x)"
   165         also have "... \<le> c * norm x * inverse (norm x)"
   165         also have "... \<le> c * norm x * inverse (norm x)"
   166         proof (rule real_mult_le_le_mono2)
   166         proof (rule real_mult_le_le_mono2)
   167           show "Numeral0 \<le> inverse (norm x)"
   167           show "0 \<le> inverse (norm x)"
   168             by (rule order_less_imp_le, rule real_inverse_gt_zero1,
   168             by (rule order_less_imp_le, rule real_inverse_gt_0,
   169                 rule normed_vs_norm_gt_zero)
   169                 rule normed_vs_norm_gt_zero)
   170           from a show "\<bar>f x\<bar> \<le> c * norm x" ..
   170           from a show "\<bar>f x\<bar> \<le> c * norm x" ..
   171         qed
   171         qed
   172         also have "... = c * (norm x * inverse (norm x))"
   172         also have "... = c * (norm x * inverse (norm x))"
   173           by (rule real_mult_assoc)
   173           by (rule real_mult_assoc)
   174         also have "(norm x * inverse (norm x)) = (Numeral1::real)"
   174         also have "(norm x * inverse (norm x)) = (1::real)"
   175         proof (rule real_mult_inv_right1)
   175         proof (rule real_mult_inv_right1)
   176           show nz: "norm x \<noteq> Numeral0"
   176           show nz: "norm x \<noteq> 0"
   177             by (rule not_sym, rule lt_imp_not_eq,
   177             by (rule not_sym, rule lt_imp_not_eq,
   178               rule normed_vs_norm_gt_zero)
   178               rule normed_vs_norm_gt_zero)
   179         qed
   179         qed
   180         also have "c * ... \<le> b " by (simp! add: le_maxI1)
   180         also have "c * ... \<le> b " by (simp! add: le_maxI1)
   181         finally show "y \<le> b" .
   181         finally show "y \<le> b" .
   186 
   186 
   187 text {* The norm of a continuous function is always @{text "\<ge> 0"}. *}
   187 text {* The norm of a continuous function is always @{text "\<ge> 0"}. *}
   188 
   188 
   189 lemma fnorm_ge_zero [intro?]:
   189 lemma fnorm_ge_zero [intro?]:
   190   "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm
   190   "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm
   191    \<Longrightarrow> Numeral0 \<le> \<parallel>f\<parallel>V,norm"
   191    \<Longrightarrow> 0 \<le> \<parallel>f\<parallel>V,norm"
   192 proof -
   192 proof -
   193   assume c: "is_continuous V norm f"
   193   assume c: "is_continuous V norm f"
   194      and n: "is_normed_vectorspace V norm"
   194      and n: "is_normed_vectorspace V norm"
   195 
   195 
   196   txt {* The function norm is defined as the supremum of @{text B}.
   196   txt {* The function norm is defined as the supremum of @{text B}.
   198   @{text "\<ge> 0"}, provided the supremum exists and @{text B} is not
   198   @{text "\<ge> 0"}, provided the supremum exists and @{text B} is not
   199   empty. *}
   199   empty. *}
   200 
   200 
   201   show ?thesis
   201   show ?thesis
   202   proof (unfold function_norm_def, rule sup_ub1)
   202   proof (unfold function_norm_def, rule sup_ub1)
   203     show "\<forall>x \<in> (B V norm f). Numeral0 \<le> x"
   203     show "\<forall>x \<in> (B V norm f). 0 \<le> x"
   204     proof (intro ballI, unfold B_def,
   204     proof (intro ballI, unfold B_def,
   205            elim UnE singletonE CollectE exE conjE)
   205            elim UnE singletonE CollectE exE conjE)
   206       fix x r
   206       fix x r
   207       assume "x \<in> V"  "x \<noteq> 0"
   207       assume "x \<in> V"  "x \<noteq> 0"
   208         and r: "r = \<bar>f x\<bar> * inverse (norm x)"
   208         and r: "r = \<bar>f x\<bar> * inverse (norm x)"
   209 
   209 
   210       have ge: "Numeral0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
   210       have ge: "0 \<le> \<bar>f x\<bar>" by (simp! only: abs_ge_zero)
   211       have "Numeral0 \<le> inverse (norm x)"
   211       have "0 \<le> inverse (norm x)"
   212         by (rule order_less_imp_le, rule real_inverse_gt_zero1, rule)(***
   212         by (rule order_less_imp_le, rule real_inverse_gt_0, rule)(***
   213         proof (rule order_less_imp_le);
   213         proof (rule order_less_imp_le);
   214           show "Numeral0 < inverse (norm x)";
   214           show "0 < inverse (norm x)";
   215           proof (rule real_inverse_gt_zero);
   215           proof (rule real_inverse_gt_zero);
   216             show "Numeral0 < norm x"; ..;
   216             show "0 < norm x"; ..;
   217           qed;
   217           qed;
   218         qed; ***)
   218         qed; ***)
   219       with ge show "Numeral0 \<le> r"
   219       with ge show "0 \<le> r"
   220        by (simp only: r, rule real_le_mult_order1a)
   220        by (simp only: r, rule real_le_mult_order1a)
   221     qed (simp!)
   221     qed (simp!)
   222 
   222 
   223     txt {* Since @{text f} is continuous the function norm exists: *}
   223     txt {* Since @{text f} is continuous the function norm exists: *}
   224 
   224 
   226     thus "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"
   226     thus "is_Sup UNIV (B V norm f) (Sup UNIV (B V norm f))"
   227       by (unfold is_function_norm_def function_norm_def)
   227       by (unfold is_function_norm_def function_norm_def)
   228 
   228 
   229     txt {* @{text B} is non-empty by construction: *}
   229     txt {* @{text B} is non-empty by construction: *}
   230 
   230 
   231     show "Numeral0 \<in> B V norm f" by (rule B_not_empty)
   231     show "0 \<in> B V norm f" by (rule B_not_empty)
   232   qed
   232   qed
   233 qed
   233 qed
   234 
   234 
   235 text {*
   235 text {*
   236   \medskip The fundamental property of function norms is:
   236   \medskip The fundamental property of function norms is:
   256     linearity of @{text f}: for every linear function holds
   256     linearity of @{text f}: for every linear function holds
   257     @{text "f 0 = 0"}. *}
   257     @{text "f 0 = 0"}. *}
   258 
   258 
   259     assume "x = 0"
   259     assume "x = 0"
   260     have "\<bar>f x\<bar> = \<bar>f 0\<bar>" by (simp!)
   260     have "\<bar>f x\<bar> = \<bar>f 0\<bar>" by (simp!)
   261     also from v continuous_linearform have "f 0 = Numeral0" ..
   261     also from v continuous_linearform have "f 0 = 0" ..
   262     also note abs_zero
   262     also note abs_zero
   263     also have "Numeral0 \<le> \<parallel>f\<parallel>V,norm * norm x"
   263     also have "0 \<le> \<parallel>f\<parallel>V,norm * norm x"
   264     proof (rule real_le_mult_order1a)
   264     proof (rule real_le_mult_order1a)
   265       show "Numeral0 \<le> \<parallel>f\<parallel>V,norm" ..
   265       show "0 \<le> \<parallel>f\<parallel>V,norm" ..
   266       show "Numeral0 \<le> norm x" ..
   266       show "0 \<le> norm x" ..
   267     qed
   267     qed
   268     finally
   268     finally
   269     show "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>V,norm * norm x" .
   269     show "\<bar>f x\<bar> \<le> \<parallel>f\<parallel>V,norm * norm x" .
   270 
   270 
   271   next
   271   next
   272     assume "x \<noteq> 0"
   272     assume "x \<noteq> 0"
   273     have n: "Numeral0 < norm x" ..
   273     have n: "0 < norm x" ..
   274     hence nz: "norm x \<noteq> Numeral0"
   274     hence nz: "norm x \<noteq> 0"
   275       by (simp only: lt_imp_not_eq)
   275       by (simp only: lt_imp_not_eq)
   276 
   276 
   277     txt {* For the case @{text "x \<noteq> 0"} we derive the following fact
   277     txt {* For the case @{text "x \<noteq> 0"} we derive the following fact
   278     from the definition of the function norm:*}
   278     from the definition of the function norm:*}
   279 
   279 
   287             conjI, simp)
   287             conjI, simp)
   288     qed
   288     qed
   289 
   289 
   290     txt {* The thesis now follows by a short calculation: *}
   290     txt {* The thesis now follows by a short calculation: *}
   291 
   291 
   292     have "\<bar>f x\<bar> = \<bar>f x\<bar> * Numeral1" by (simp!)
   292     have "\<bar>f x\<bar> = \<bar>f x\<bar> * 1" by (simp!)
   293     also from nz have "Numeral1 = inverse (norm x) * norm x"
   293     also from nz have "1 = inverse (norm x) * norm x"
   294       by (simp add: real_mult_inv_left1)
   294       by (simp add: real_mult_inv_left1)
   295     also have "\<bar>f x\<bar> * ... = \<bar>f x\<bar> * inverse (norm x) * norm x"
   295     also have "\<bar>f x\<bar> * ... = \<bar>f x\<bar> * inverse (norm x) * norm x"
   296       by (simp! add: real_mult_assoc)
   296       by (simp! add: real_mult_assoc)
   297     also from n l have "... \<le> \<parallel>f\<parallel>V,norm * norm x"
   297     also from n l have "... \<le> \<parallel>f\<parallel>V,norm * norm x"
   298       by (simp add: real_mult_le_le_mono2)
   298       by (simp add: real_mult_le_le_mono2)
   308   \end{center}
   308   \end{center}
   309 *}
   309 *}
   310 
   310 
   311 lemma fnorm_le_ub:
   311 lemma fnorm_le_ub:
   312   "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm \<Longrightarrow>
   312   "is_continuous V norm f \<Longrightarrow> is_normed_vectorspace V norm \<Longrightarrow>
   313      \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> Numeral0 \<le> c
   313      \<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x \<Longrightarrow> 0 \<le> c
   314   \<Longrightarrow> \<parallel>f\<parallel>V,norm \<le> c"
   314   \<Longrightarrow> \<parallel>f\<parallel>V,norm \<le> c"
   315 proof (unfold function_norm_def)
   315 proof (unfold function_norm_def)
   316   assume "is_normed_vectorspace V norm"
   316   assume "is_normed_vectorspace V norm"
   317   assume c: "is_continuous V norm f"
   317   assume c: "is_continuous V norm f"
   318   assume fb: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
   318   assume fb: "\<forall>x \<in> V. \<bar>f x\<bar> \<le> c * norm x"
   319     and "Numeral0 \<le> c"
   319     and "0 \<le> c"
   320 
   320 
   321   txt {* Suppose the inequation holds for some @{text "c \<ge> 0"}.  If
   321   txt {* Suppose the inequation holds for some @{text "c \<ge> 0"}.  If
   322   @{text c} is an upper bound of @{text B}, then @{text c} is greater
   322   @{text c} is an upper bound of @{text B}, then @{text c} is greater
   323   than the function norm since the function norm is the least upper
   323   than the function norm since the function norm is the least upper
   324   bound.  *}
   324   bound.  *}
   338       thus le: "y \<le> c"
   338       thus le: "y \<le> c"
   339       proof (unfold B_def, elim UnE CollectE exE conjE singletonE)
   339       proof (unfold B_def, elim UnE CollectE exE conjE singletonE)
   340 
   340 
   341        txt {* The first case for @{text "y \<in> B"} is @{text "y = 0"}. *}
   341        txt {* The first case for @{text "y \<in> B"} is @{text "y = 0"}. *}
   342 
   342 
   343         assume "y = Numeral0"
   343         assume "y = 0"
   344         show "y \<le> c" by (blast!)
   344         show "y \<le> c" by (blast!)
   345 
   345 
   346         txt{* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
   346         txt{* The second case is @{text "y = \<bar>f x\<bar> / \<parallel>x\<parallel>"} for some
   347         @{text "x \<in> V"} with @{text "x \<noteq> 0"}. *}
   347         @{text "x \<in> V"} with @{text "x \<noteq> 0"}. *}
   348 
   348 
   349       next
   349       next
   350         fix x
   350         fix x
   351         assume "x \<in> V"  "x \<noteq> 0"
   351         assume "x \<in> V"  "x \<noteq> 0"
   352 
   352 
   353         have lz: "Numeral0 < norm x"
   353         have lz: "0 < norm x"
   354           by (simp! add: normed_vs_norm_gt_zero)
   354           by (simp! add: normed_vs_norm_gt_zero)
   355 
   355 
   356         have nz: "norm x \<noteq> Numeral0"
   356         have nz: "norm x \<noteq> 0"
   357         proof (rule not_sym)
   357         proof (rule not_sym)
   358           from lz show "Numeral0 \<noteq> norm x"
   358           from lz show "0 \<noteq> norm x"
   359             by (simp! add: order_less_imp_not_eq)
   359             by (simp! add: order_less_imp_not_eq)
   360         qed
   360         qed
   361 
   361 
   362         from lz have "Numeral0 < inverse (norm x)"
   362         from lz have "0 < inverse (norm x)"
   363           by (simp! add: real_inverse_gt_zero1)
   363           by (simp! add: real_inverse_gt_0)
   364         hence inverse_gez: "Numeral0 \<le> inverse (norm x)"
   364         hence inverse_gez: "0 \<le> inverse (norm x)"
   365           by (rule order_less_imp_le)
   365           by (rule order_less_imp_le)
   366 
   366 
   367         assume "y = \<bar>f x\<bar> * inverse (norm x)"
   367         assume "y = \<bar>f x\<bar> * inverse (norm x)"
   368         also from inverse_gez have "... \<le> c * norm x * inverse (norm x)"
   368         also from inverse_gez have "... \<le> c * norm x * inverse (norm x)"
   369           proof (rule real_mult_le_le_mono2)
   369           proof (rule real_mult_le_le_mono2)