src/HOL/Multivariate_Analysis/Operator_Norm.thy
author hoelzl
Tue, 05 Nov 2013 09:45:02 +0100
changeset 55715 c4159fe6fa46
parent 54825 63892cfef47f
child 57565 7696903b9e61
permissions -rw-r--r--
move Lubs from HOL to HOL-Library (replaced by conditionally complete lattices)
wenzelm@42830
     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@44991
     8
imports Linear_Algebra
huffman@36581
     9
begin
huffman@36581
    10
hoelzl@55715
    11
definition "onorm f = (SUP x:{x. norm x = 1}. norm (f x))"
huffman@36581
    12
huffman@36581
    13
lemma norm_bound_generalize:
wenzelm@54390
    14
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
huffman@36581
    15
  assumes lf: "linear f"
wenzelm@54390
    16
  shows "(\<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> b) \<longleftrightarrow> (\<forall>x. norm (f x) \<le> b * norm x)"
wenzelm@54390
    17
  (is "?lhs \<longleftrightarrow> ?rhs")
wenzelm@54390
    18
proof
wenzelm@54390
    19
  assume H: ?rhs
wenzelm@54390
    20
  {
wenzelm@54390
    21
    fix x :: "'a"
wenzelm@54390
    22
    assume x: "norm x = 1"
wenzelm@54825
    23
    from H[rule_format, of x] x have "norm (f x) \<le> b"
wenzelm@54825
    24
      by simp
wenzelm@54390
    25
  }
wenzelm@54390
    26
  then show ?lhs by blast
wenzelm@54390
    27
next
wenzelm@54390
    28
  assume H: ?lhs
wenzelm@54390
    29
  have bp: "b \<ge> 0"
wenzelm@54390
    30
    apply -
wenzelm@54390
    31
    apply (rule order_trans [OF norm_ge_zero])
wenzelm@54390
    32
    apply (rule H[rule_format, of "SOME x::'a. x \<in> Basis"])
wenzelm@54390
    33
    apply (auto intro: SOME_Basis norm_Basis)
wenzelm@54390
    34
    done
wenzelm@54390
    35
  {
wenzelm@54390
    36
    fix x :: "'a"
wenzelm@54390
    37
    {
wenzelm@54390
    38
      assume "x = 0"
wenzelm@54390
    39
      then have "norm (f x) \<le> b * norm x"
wenzelm@54390
    40
        by (simp add: linear_0[OF lf] bp)
wenzelm@54390
    41
    }
wenzelm@54390
    42
    moreover
wenzelm@54390
    43
    {
wenzelm@54390
    44
      assume x0: "x \<noteq> 0"
wenzelm@54825
    45
      then have n0: "norm x \<noteq> 0"
wenzelm@54825
    46
        by (metis norm_eq_zero)
wenzelm@54390
    47
      let ?c = "1/ norm x"
wenzelm@54825
    48
      have "norm (?c *\<^sub>R x) = 1"
wenzelm@54825
    49
        using x0 by (simp add: n0)
wenzelm@54825
    50
      with H have "norm (f (?c *\<^sub>R x)) \<le> b"
wenzelm@54825
    51
        by blast
wenzelm@54390
    52
      then have "?c * norm (f x) \<le> b"
wenzelm@54390
    53
        by (simp add: linear_cmul[OF lf])
wenzelm@54390
    54
      then have "norm (f x) \<le> b * norm x"
wenzelm@54825
    55
        using n0 norm_ge_zero[of x]
wenzelm@54825
    56
        by (auto simp add: field_simps)
wenzelm@54390
    57
    }
wenzelm@54825
    58
    ultimately have "norm (f x) \<le> b * norm x"
wenzelm@54825
    59
      by blast
wenzelm@54390
    60
  }
wenzelm@54390
    61
  then show ?rhs by blast
wenzelm@54390
    62
qed
huffman@36581
    63
huffman@36581
    64
lemma onorm:
hoelzl@37489
    65
  fixes f:: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
huffman@36581
    66
  assumes lf: "linear f"
wenzelm@54390
    67
  shows "norm (f x) \<le> onorm f * norm x"
wenzelm@54390
    68
    and "\<forall>x. norm (f x) \<le> b * norm x \<Longrightarrow> onorm f \<le> b"
wenzelm@54390
    69
proof -
hoelzl@55715
    70
  let ?S = "(\<lambda>x. norm (f x))`{x. norm x = 1}"
wenzelm@54390
    71
  have "norm (f (SOME i. i \<in> Basis)) \<in> ?S"
wenzelm@54390
    72
    by (auto intro!: exI[of _ "SOME i. i \<in> Basis"] norm_Basis SOME_Basis)
wenzelm@54825
    73
  then have Se: "?S \<noteq> {}"
wenzelm@54825
    74
    by auto
hoelzl@55715
    75
  from linear_bounded[OF lf] have b: "bdd_above ?S"
hoelzl@55715
    76
    unfolding norm_bound_generalize[OF lf, symmetric] by auto
hoelzl@55715
    77
  then show "norm (f x) \<le> onorm f * norm x"
wenzelm@54390
    78
    apply -
wenzelm@54390
    79
    apply (rule spec[where x = x])
wenzelm@54390
    80
    unfolding norm_bound_generalize[OF lf, symmetric]
hoelzl@55715
    81
    apply (auto simp: onorm_def intro!: cSUP_upper)
wenzelm@54390
    82
    done
wenzelm@54825
    83
  show "\<forall>x. norm (f x) \<le> b * norm x \<Longrightarrow> onorm f \<le> b"
wenzelm@54390
    84
    unfolding norm_bound_generalize[OF lf, symmetric]
hoelzl@55715
    85
    using Se by (auto simp: onorm_def intro!: cSUP_least b)
huffman@36581
    86
qed
huffman@36581
    87
wenzelm@54390
    88
lemma onorm_pos_le:
wenzelm@54825
    89
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
wenzelm@54825
    90
  assumes lf: "linear f"
wenzelm@54390
    91
  shows "0 \<le> onorm f"
wenzelm@54390
    92
  using order_trans[OF norm_ge_zero onorm(1)[OF lf, of "SOME i. i \<in> Basis"]]
hoelzl@51541
    93
  by (simp add: SOME_Basis)
huffman@36581
    94
wenzelm@54390
    95
lemma onorm_eq_0:
wenzelm@54825
    96
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
wenzelm@54825
    97
  assumes lf: "linear f"
huffman@36581
    98
  shows "onorm f = 0 \<longleftrightarrow> (\<forall>x. f x = 0)"
huffman@36581
    99
  using onorm[OF lf]
huffman@36581
   100
  apply (auto simp add: onorm_pos_le)
huffman@36581
   101
  apply atomize
huffman@36581
   102
  apply (erule allE[where x="0::real"])
huffman@36581
   103
  using onorm_pos_le[OF lf]
huffman@36581
   104
  apply arith
huffman@36581
   105
  done
huffman@36581
   106
hoelzl@55715
   107
lemma onorm_const: "onorm (\<lambda>x::'a::euclidean_space. y::'b::euclidean_space) = norm y"
hoelzl@55715
   108
  using SOME_Basis by (auto simp add: onorm_def intro!: cSUP_const norm_Basis)
huffman@36581
   109
wenzelm@54390
   110
lemma onorm_pos_lt:
wenzelm@54825
   111
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
wenzelm@54825
   112
  assumes lf: "linear f"
wenzelm@54825
   113
  shows "0 < onorm f \<longleftrightarrow> \<not> (\<forall>x. f x = 0)"
huffman@36581
   114
  unfolding onorm_eq_0[OF lf, symmetric]
huffman@36581
   115
  using onorm_pos_le[OF lf] by arith
huffman@36581
   116
huffman@36581
   117
lemma onorm_compose:
wenzelm@54825
   118
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
wenzelm@54825
   119
    and g :: "'k::euclidean_space \<Rightarrow> 'n::euclidean_space"
wenzelm@54825
   120
  assumes lf: "linear f"
wenzelm@54825
   121
    and lg: "linear g"
wenzelm@54825
   122
  shows "onorm (f \<circ> g) \<le> onorm f * onorm g"
wenzelm@54390
   123
    apply (rule onorm(2)[OF linear_compose[OF lg lf], rule_format])
wenzelm@54390
   124
    unfolding o_def
wenzelm@54390
   125
    apply (subst mult_assoc)
wenzelm@54390
   126
    apply (rule order_trans)
wenzelm@54390
   127
    apply (rule onorm(1)[OF lf])
wenzelm@54390
   128
    apply (rule mult_left_mono)
wenzelm@54390
   129
    apply (rule onorm(1)[OF lg])
wenzelm@54390
   130
    apply (rule onorm_pos_le[OF lf])
wenzelm@54390
   131
    done
huffman@36581
   132
wenzelm@54390
   133
lemma onorm_neg_lemma:
wenzelm@54825
   134
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
wenzelm@54825
   135
  assumes lf: "linear f"
huffman@36581
   136
  shows "onorm (\<lambda>x. - f x) \<le> onorm f"
huffman@36581
   137
  using onorm[OF linear_compose_neg[OF lf]] onorm[OF lf]
huffman@36581
   138
  unfolding norm_minus_cancel by metis
huffman@36581
   139
wenzelm@54390
   140
lemma onorm_neg:
wenzelm@54825
   141
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
wenzelm@54825
   142
  assumes lf: "linear f"
huffman@36581
   143
  shows "onorm (\<lambda>x. - f x) = onorm f"
huffman@36581
   144
  using onorm_neg_lemma[OF lf] onorm_neg_lemma[OF linear_compose_neg[OF lf]]
huffman@36581
   145
  by simp
huffman@36581
   146
huffman@36581
   147
lemma onorm_triangle:
wenzelm@54825
   148
  fixes f g :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
wenzelm@54825
   149
  assumes lf: "linear f"
wenzelm@54390
   150
    and lg: "linear g"
wenzelm@54390
   151
  shows "onorm (\<lambda>x. f x + g x) \<le> onorm f + onorm g"
huffman@36581
   152
  apply(rule onorm(2)[OF linear_compose_add[OF lf lg], rule_format])
huffman@36581
   153
  apply (rule order_trans)
huffman@36581
   154
  apply (rule norm_triangle_ineq)
huffman@36581
   155
  apply (simp add: distrib)
huffman@36581
   156
  apply (rule add_mono)
huffman@36581
   157
  apply (rule onorm(1)[OF lf])
huffman@36581
   158
  apply (rule onorm(1)[OF lg])
huffman@36581
   159
  done
huffman@36581
   160
wenzelm@54390
   161
lemma onorm_triangle_le:
wenzelm@54825
   162
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
wenzelm@54825
   163
  assumes "linear f"
wenzelm@54825
   164
    and "linear g"
wenzelm@54825
   165
    and "onorm f + onorm g \<le> e"
wenzelm@54825
   166
  shows "onorm (\<lambda>x. f x + g x) \<le> e"
huffman@36581
   167
  apply (rule order_trans)
huffman@36581
   168
  apply (rule onorm_triangle)
wenzelm@54825
   169
  apply (rule assms)+
huffman@36581
   170
  done
huffman@36581
   171
wenzelm@54390
   172
lemma onorm_triangle_lt:
wenzelm@54825
   173
  fixes f g :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
wenzelm@54825
   174
  assumes "linear f"
wenzelm@54825
   175
    and "linear g"
wenzelm@54825
   176
    and "onorm f + onorm g < e"
wenzelm@54825
   177
  shows "onorm (\<lambda>x. f x + g x) < e"
huffman@36581
   178
  apply (rule order_le_less_trans)
huffman@36581
   179
  apply (rule onorm_triangle)
wenzelm@54825
   180
  apply (rule assms)+
wenzelm@54390
   181
  done
huffman@36581
   182
huffman@36581
   183
end