src/HOL/Multivariate_Analysis/Operator_Norm.thy
author wenzelm
Wed Aug 28 23:41:21 2013 +0200 (2013-08-28)
changeset 53253 220f306f5c4e
parent 51475 ebf9d4fd00ba
child 53688 63892cfef47f
permissions -rw-r--r--
tuned proofs;
wenzelm@41959
     1
(*  Title:      HOL/Multivariate_Analysis/Operator_Norm.thy
huffman@36581
     2
    Author:     Amine Chaieb, University of Cambridge
huffman@36581
     3
*)
huffman@36581
     4
huffman@36581
     5
header {* Operator Norm *}
huffman@36581
     6
huffman@36581
     7
theory Operator_Norm
huffman@44133
     8
imports Linear_Algebra
huffman@36581
     9
begin
huffman@36581
    10
huffman@36581
    11
definition "onorm f = Sup {norm (f x)| x. norm x = 1}"
huffman@36581
    12
huffman@36581
    13
lemma norm_bound_generalize:
wenzelm@53253
    14
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
huffman@36581
    15
  assumes lf: "linear f"
wenzelm@53253
    16
  shows "(\<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> b) \<longleftrightarrow> (\<forall>x. norm (f x) \<le> b * norm x)"
wenzelm@53253
    17
  (is "?lhs \<longleftrightarrow> ?rhs")
wenzelm@53253
    18
proof
wenzelm@53253
    19
  assume H: ?rhs
wenzelm@53253
    20
  {
wenzelm@53253
    21
    fix x :: "'a"
wenzelm@53253
    22
    assume x: "norm x = 1"
wenzelm@53253
    23
    from H[rule_format, of x] x have "norm (f x) \<le> b" by simp
wenzelm@53253
    24
  }
wenzelm@53253
    25
  then show ?lhs by blast
wenzelm@53253
    26
next
wenzelm@53253
    27
  assume H: ?lhs
wenzelm@53253
    28
  have bp: "b \<ge> 0"
wenzelm@53253
    29
    apply -
wenzelm@53253
    30
    apply (rule order_trans [OF norm_ge_zero])
wenzelm@53253
    31
    apply (rule H[rule_format, of "SOME x::'a. x \<in> Basis"])
wenzelm@53253
    32
    apply (auto intro: SOME_Basis norm_Basis)
wenzelm@53253
    33
    done
wenzelm@53253
    34
  {
wenzelm@53253
    35
    fix x :: "'a"
wenzelm@53253
    36
    {
wenzelm@53253
    37
      assume "x = 0"
wenzelm@53253
    38
      then have "norm (f x) \<le> b * norm x"
wenzelm@53253
    39
        by (simp add: linear_0[OF lf] bp)
wenzelm@53253
    40
    }
wenzelm@53253
    41
    moreover
wenzelm@53253
    42
    {
wenzelm@53253
    43
      assume x0: "x \<noteq> 0"
wenzelm@53253
    44
      then have n0: "norm x \<noteq> 0" by (metis norm_eq_zero)
wenzelm@53253
    45
      let ?c = "1/ norm x"
wenzelm@53253
    46
      have "norm (?c *\<^sub>R x) = 1" using x0 by (simp add: n0)
wenzelm@53253
    47
      with H have "norm (f (?c *\<^sub>R x)) \<le> b" by blast
wenzelm@53253
    48
      then have "?c * norm (f x) \<le> b"
wenzelm@53253
    49
        by (simp add: linear_cmul[OF lf])
wenzelm@53253
    50
      then have "norm (f x) \<le> b * norm x"
wenzelm@53253
    51
        using n0 norm_ge_zero[of x] by (auto simp add: field_simps)
wenzelm@53253
    52
    }
wenzelm@53253
    53
    ultimately have "norm (f x) \<le> b * norm x" by blast
wenzelm@53253
    54
  }
wenzelm@53253
    55
  then show ?rhs by blast
wenzelm@53253
    56
qed
huffman@36581
    57
huffman@36581
    58
lemma onorm:
hoelzl@37489
    59
  fixes f:: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
huffman@36581
    60
  assumes lf: "linear f"
wenzelm@53253
    61
  shows "norm (f x) \<le> onorm f * norm x"
wenzelm@53253
    62
    and "\<forall>x. norm (f x) \<le> b * norm x \<Longrightarrow> onorm f \<le> b"
wenzelm@53253
    63
proof -
wenzelm@53253
    64
  let ?S = "{norm (f x) |x. norm x = 1}"
wenzelm@53253
    65
  have "norm (f (SOME i. i \<in> Basis)) \<in> ?S"
wenzelm@53253
    66
    by (auto intro!: exI[of _ "SOME i. i \<in> Basis"] norm_Basis SOME_Basis)
wenzelm@53253
    67
  then have Se: "?S \<noteq> {}" by auto
wenzelm@53253
    68
  from linear_bounded[OF lf] have b: "\<exists> b. ?S *<= b"
wenzelm@53253
    69
    unfolding norm_bound_generalize[OF lf, symmetric] by (auto simp add: setle_def)
wenzelm@53253
    70
  from isLub_cSup[OF Se b, unfolded onorm_def[symmetric]]
wenzelm@53253
    71
  show "norm (f x) <= onorm f * norm x"
wenzelm@53253
    72
    apply -
wenzelm@53253
    73
    apply (rule spec[where x = x])
wenzelm@53253
    74
    unfolding norm_bound_generalize[OF lf, symmetric]
wenzelm@53253
    75
    apply (auto simp add: isLub_def isUb_def leastP_def setge_def setle_def)
wenzelm@53253
    76
    done
wenzelm@53253
    77
  show "\<forall>x. norm (f x) <= b * norm x \<Longrightarrow> onorm f <= b"
wenzelm@53253
    78
    using isLub_cSup[OF Se b, unfolded onorm_def[symmetric]]
wenzelm@53253
    79
    unfolding norm_bound_generalize[OF lf, symmetric]
wenzelm@53253
    80
    by (auto simp add: isLub_def isUb_def leastP_def setge_def setle_def)
huffman@36581
    81
qed
huffman@36581
    82
wenzelm@53253
    83
lemma onorm_pos_le:
wenzelm@53253
    84
  assumes lf: "linear (f::'n::euclidean_space \<Rightarrow> 'm::euclidean_space)"
wenzelm@53253
    85
  shows "0 \<le> onorm f"
wenzelm@53253
    86
  using order_trans[OF norm_ge_zero onorm(1)[OF lf, of "SOME i. i \<in> Basis"]]
hoelzl@50526
    87
  by (simp add: SOME_Basis)
huffman@36581
    88
wenzelm@53253
    89
lemma onorm_eq_0:
wenzelm@53253
    90
  assumes lf: "linear (f::'a::euclidean_space \<Rightarrow> 'b::euclidean_space)"
huffman@36581
    91
  shows "onorm f = 0 \<longleftrightarrow> (\<forall>x. f x = 0)"
huffman@36581
    92
  using onorm[OF lf]
huffman@36581
    93
  apply (auto simp add: onorm_pos_le)
huffman@36581
    94
  apply atomize
huffman@36581
    95
  apply (erule allE[where x="0::real"])
huffman@36581
    96
  using onorm_pos_le[OF lf]
huffman@36581
    97
  apply arith
huffman@36581
    98
  done
huffman@36581
    99
hoelzl@37489
   100
lemma onorm_const: "onorm(\<lambda>x::'a::euclidean_space. (y::'b::euclidean_space)) = norm y"
wenzelm@53253
   101
proof -
hoelzl@37489
   102
  let ?f = "\<lambda>x::'a. (y::'b)"
huffman@36581
   103
  have th: "{norm (?f x)| x. norm x = 1} = {norm y}"
hoelzl@50526
   104
    by (auto simp: SOME_Basis intro!: exI[of _ "SOME i. i \<in> Basis"])
huffman@36581
   105
  show ?thesis
huffman@36581
   106
    unfolding onorm_def th
wenzelm@53253
   107
    apply (rule cSup_unique)
wenzelm@53253
   108
    apply (simp_all  add: setle_def)
wenzelm@53253
   109
    done
huffman@36581
   110
qed
huffman@36581
   111
wenzelm@53253
   112
lemma onorm_pos_lt:
wenzelm@53253
   113
  assumes lf: "linear (f::'a::euclidean_space \<Rightarrow> 'b::euclidean_space)"
huffman@36581
   114
  shows "0 < onorm f \<longleftrightarrow> ~(\<forall>x. f x = 0)"
huffman@36581
   115
  unfolding onorm_eq_0[OF lf, symmetric]
huffman@36581
   116
  using onorm_pos_le[OF lf] by arith
huffman@36581
   117
huffman@36581
   118
lemma onorm_compose:
hoelzl@37489
   119
  assumes lf: "linear (f::'n::euclidean_space \<Rightarrow> 'm::euclidean_space)"
wenzelm@53253
   120
    and lg: "linear (g::'k::euclidean_space \<Rightarrow> 'n::euclidean_space)"
wenzelm@53253
   121
  shows "onorm (f o g) \<le> onorm f * onorm g"
wenzelm@53253
   122
    apply (rule onorm(2)[OF linear_compose[OF lg lf], rule_format])
wenzelm@53253
   123
    unfolding o_def
wenzelm@53253
   124
    apply (subst mult_assoc)
wenzelm@53253
   125
    apply (rule order_trans)
wenzelm@53253
   126
    apply (rule onorm(1)[OF lf])
wenzelm@53253
   127
    apply (rule mult_left_mono)
wenzelm@53253
   128
    apply (rule onorm(1)[OF lg])
wenzelm@53253
   129
    apply (rule onorm_pos_le[OF lf])
wenzelm@53253
   130
    done
huffman@36581
   131
wenzelm@53253
   132
lemma onorm_neg_lemma:
wenzelm@53253
   133
  assumes lf: "linear (f::'a::euclidean_space \<Rightarrow> 'b::euclidean_space)"
huffman@36581
   134
  shows "onorm (\<lambda>x. - f x) \<le> onorm f"
huffman@36581
   135
  using onorm[OF linear_compose_neg[OF lf]] onorm[OF lf]
huffman@36581
   136
  unfolding norm_minus_cancel by metis
huffman@36581
   137
wenzelm@53253
   138
lemma onorm_neg:
wenzelm@53253
   139
  assumes lf: "linear (f::'a::euclidean_space \<Rightarrow> 'b::euclidean_space)"
huffman@36581
   140
  shows "onorm (\<lambda>x. - f x) = onorm f"
huffman@36581
   141
  using onorm_neg_lemma[OF lf] onorm_neg_lemma[OF linear_compose_neg[OF lf]]
huffman@36581
   142
  by simp
huffman@36581
   143
huffman@36581
   144
lemma onorm_triangle:
wenzelm@53253
   145
  assumes lf: "linear (f::'n::euclidean_space \<Rightarrow> 'm::euclidean_space)"
wenzelm@53253
   146
    and lg: "linear g"
wenzelm@53253
   147
  shows "onorm (\<lambda>x. f x + g x) \<le> onorm f + onorm g"
huffman@36581
   148
  apply(rule onorm(2)[OF linear_compose_add[OF lf lg], rule_format])
huffman@36581
   149
  apply (rule order_trans)
huffman@36581
   150
  apply (rule norm_triangle_ineq)
huffman@36581
   151
  apply (simp add: distrib)
huffman@36581
   152
  apply (rule add_mono)
huffman@36581
   153
  apply (rule onorm(1)[OF lf])
huffman@36581
   154
  apply (rule onorm(1)[OF lg])
huffman@36581
   155
  done
huffman@36581
   156
wenzelm@53253
   157
lemma onorm_triangle_le:
wenzelm@53253
   158
  "linear (f::'n::euclidean_space \<Rightarrow> 'm::euclidean_space) \<Longrightarrow>
wenzelm@53253
   159
    linear g \<Longrightarrow> onorm f + onorm g \<le> e \<Longrightarrow> onorm (\<lambda>x. f x + g x) \<le> e"
huffman@36581
   160
  apply (rule order_trans)
huffman@36581
   161
  apply (rule onorm_triangle)
huffman@36581
   162
  apply assumption+
huffman@36581
   163
  done
huffman@36581
   164
wenzelm@53253
   165
lemma onorm_triangle_lt:
wenzelm@53253
   166
  "linear (f::'n::euclidean_space \<Rightarrow> 'm::euclidean_space) \<Longrightarrow> linear g \<Longrightarrow>
wenzelm@53253
   167
    onorm f + onorm g < e \<Longrightarrow> onorm(\<lambda>x. f x + g x) < e"
huffman@36581
   168
  apply (rule order_le_less_trans)
huffman@36581
   169
  apply (rule onorm_triangle)
wenzelm@53253
   170
  apply assumption+
wenzelm@53253
   171
  done
huffman@36581
   172
huffman@36581
   173
end