src/HOL/Multivariate_Analysis/Bounded_Linear_Function.thy
author wenzelm
Sun Feb 14 16:29:30 2016 +0100 (2016-02-14)
changeset 62311 73bebf642d3b
parent 62127 d8e7738bd2e9
child 62390 842917225d56
permissions -rw-r--r--
more antiquotations;
immler@61915
     1
(*  Title:      HOL/Multivariate_Analysis/Bounded_Linear_Function.thy
immler@61915
     2
    Author:     Fabian Immler, TU M√ľnchen
immler@61915
     3
*)
immler@61915
     4
wenzelm@61975
     5
section \<open>Bounded Linear Function\<close>
immler@61915
     6
immler@61915
     7
theory Bounded_Linear_Function
immler@61915
     8
imports
immler@61915
     9
  Topology_Euclidean_Space
immler@61915
    10
  Operator_Norm
immler@61915
    11
begin
immler@61915
    12
wenzelm@61975
    13
subsection \<open>Intro rules for @{term bounded_linear}\<close>
immler@61915
    14
immler@61915
    15
named_theorems bounded_linear_intros
immler@61915
    16
immler@61915
    17
lemma onorm_inner_left:
immler@61915
    18
  assumes "bounded_linear r"
immler@61915
    19
  shows "onorm (\<lambda>x. r x \<bullet> f) \<le> onorm r * norm f"
immler@61915
    20
proof (rule onorm_bound)
immler@61915
    21
  fix x
immler@61915
    22
  have "norm (r x \<bullet> f) \<le> norm (r x) * norm f"
immler@61915
    23
    by (simp add: Cauchy_Schwarz_ineq2)
immler@61915
    24
  also have "\<dots> \<le> onorm r * norm x * norm f"
immler@61915
    25
    by (intro mult_right_mono onorm assms norm_ge_zero)
immler@61915
    26
  finally show "norm (r x \<bullet> f) \<le> onorm r * norm f * norm x"
immler@61915
    27
    by (simp add: ac_simps)
immler@61915
    28
qed (intro mult_nonneg_nonneg norm_ge_zero onorm_pos_le assms)
immler@61915
    29
immler@61915
    30
lemma onorm_inner_right:
immler@61915
    31
  assumes "bounded_linear r"
immler@61915
    32
  shows "onorm (\<lambda>x. f \<bullet> r x) \<le> norm f * onorm r"
immler@61915
    33
  apply (subst inner_commute)
immler@61915
    34
  apply (rule onorm_inner_left[OF assms, THEN order_trans])
immler@61915
    35
  apply simp
immler@61915
    36
  done
immler@61915
    37
immler@61915
    38
lemmas [bounded_linear_intros] =
immler@61915
    39
  bounded_linear_zero
immler@61915
    40
  bounded_linear_add
immler@61915
    41
  bounded_linear_const_mult
immler@61915
    42
  bounded_linear_mult_const
immler@61915
    43
  bounded_linear_scaleR_const
immler@61915
    44
  bounded_linear_const_scaleR
immler@61915
    45
  bounded_linear_ident
immler@61915
    46
  bounded_linear_setsum
immler@61915
    47
  bounded_linear_Pair
immler@61915
    48
  bounded_linear_sub
immler@61915
    49
  bounded_linear_fst_comp
immler@61915
    50
  bounded_linear_snd_comp
immler@61915
    51
  bounded_linear_inner_left_comp
immler@61915
    52
  bounded_linear_inner_right_comp
immler@61915
    53
immler@61915
    54
immler@61915
    55
subsection \<open>declaration of derivative/continuous/tendsto introduction rules for bounded linear functions\<close>
immler@61915
    56
immler@61915
    57
attribute_setup bounded_linear =
immler@61915
    58
  \<open>Scan.succeed (Thm.declaration_attribute (fn thm =>
immler@61915
    59
    fold (fn (r, s) => Named_Theorems.add_thm s (thm RS r))
immler@61915
    60
      [
wenzelm@62311
    61
        (@{thm bounded_linear.has_derivative}, @{named_theorems derivative_intros}),
wenzelm@62311
    62
        (@{thm bounded_linear.tendsto}, @{named_theorems tendsto_intros}),
wenzelm@62311
    63
        (@{thm bounded_linear.continuous}, @{named_theorems continuous_intros}),
wenzelm@62311
    64
        (@{thm bounded_linear.continuous_on}, @{named_theorems continuous_intros}),
wenzelm@62311
    65
        (@{thm bounded_linear.uniformly_continuous_on}, @{named_theorems continuous_intros}),
wenzelm@62311
    66
        (@{thm bounded_linear_compose}, @{named_theorems bounded_linear_intros})
immler@61915
    67
      ]))\<close>
immler@61915
    68
immler@61915
    69
attribute_setup bounded_bilinear =
immler@61915
    70
  \<open>Scan.succeed (Thm.declaration_attribute (fn thm =>
immler@61915
    71
    fold (fn (r, s) => Named_Theorems.add_thm s (thm RS r))
immler@61915
    72
      [
wenzelm@62311
    73
        (@{thm bounded_bilinear.FDERIV}, @{named_theorems derivative_intros}),
wenzelm@62311
    74
        (@{thm bounded_bilinear.tendsto}, @{named_theorems tendsto_intros}),
wenzelm@62311
    75
        (@{thm bounded_bilinear.continuous}, @{named_theorems continuous_intros}),
wenzelm@62311
    76
        (@{thm bounded_bilinear.continuous_on}, @{named_theorems continuous_intros}),
immler@61915
    77
        (@{thm bounded_linear_compose[OF bounded_bilinear.bounded_linear_left]},
wenzelm@62311
    78
          @{named_theorems bounded_linear_intros}),
immler@61915
    79
        (@{thm bounded_linear_compose[OF bounded_bilinear.bounded_linear_right]},
wenzelm@62311
    80
          @{named_theorems bounded_linear_intros}),
immler@61915
    81
        (@{thm bounded_linear.uniformly_continuous_on[OF bounded_bilinear.bounded_linear_left]},
wenzelm@62311
    82
          @{named_theorems continuous_intros}),
immler@61915
    83
        (@{thm bounded_linear.uniformly_continuous_on[OF bounded_bilinear.bounded_linear_right]},
wenzelm@62311
    84
          @{named_theorems continuous_intros})
immler@61915
    85
      ]))\<close>
immler@61915
    86
immler@61915
    87
immler@61915
    88
subsection \<open>type of bounded linear functions\<close>
immler@61915
    89
immler@61915
    90
typedef (overloaded) ('a, 'b) blinfun ("(_ \<Rightarrow>\<^sub>L /_)" [22, 21] 21) =
immler@61915
    91
  "{f::'a::real_normed_vector\<Rightarrow>'b::real_normed_vector. bounded_linear f}"
immler@61915
    92
  morphisms blinfun_apply Blinfun
immler@61915
    93
  by (blast intro: bounded_linear_intros)
immler@61915
    94
immler@61915
    95
declare [[coercion
immler@61915
    96
    "blinfun_apply :: ('a::real_normed_vector \<Rightarrow>\<^sub>L'b::real_normed_vector) \<Rightarrow> 'a \<Rightarrow> 'b"]]
immler@61915
    97
immler@61915
    98
lemma bounded_linear_blinfun_apply[bounded_linear_intros]:
immler@61915
    99
  "bounded_linear g \<Longrightarrow> bounded_linear (\<lambda>x. blinfun_apply f (g x))"
immler@61915
   100
  by (metis blinfun_apply mem_Collect_eq bounded_linear_compose)
immler@61915
   101
immler@61915
   102
setup_lifting type_definition_blinfun
immler@61915
   103
immler@61915
   104
lemma blinfun_eqI: "(\<And>i. blinfun_apply x i = blinfun_apply y i) \<Longrightarrow> x = y"
immler@61915
   105
  by transfer auto
immler@61915
   106
immler@61915
   107
lemma bounded_linear_Blinfun_apply: "bounded_linear f \<Longrightarrow> blinfun_apply (Blinfun f) = f"
immler@61915
   108
  by (auto simp: Blinfun_inverse)
immler@61915
   109
immler@61915
   110
immler@61915
   111
subsection \<open>type class instantiations\<close>
immler@61915
   112
immler@61915
   113
instantiation blinfun :: (real_normed_vector, real_normed_vector) real_normed_vector
immler@61915
   114
begin
immler@61915
   115
immler@61915
   116
lift_definition norm_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> real" is onorm .
immler@61915
   117
immler@61915
   118
lift_definition minus_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   119
  is "\<lambda>f g x. f x - g x"
immler@61915
   120
  by (rule bounded_linear_sub)
immler@61915
   121
immler@61915
   122
definition dist_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> real"
immler@61915
   123
  where "dist_blinfun a b = norm (a - b)"
immler@61915
   124
hoelzl@62101
   125
definition [code del]:
hoelzl@62101
   126
  "(uniformity :: (('a \<Rightarrow>\<^sub>L 'b) \<times> ('a \<Rightarrow>\<^sub>L 'b)) filter) = (INF e:{0 <..}. principal {(x, y). dist x y < e})"
hoelzl@62101
   127
immler@61915
   128
definition open_blinfun :: "('a \<Rightarrow>\<^sub>L 'b) set \<Rightarrow> bool"
hoelzl@62101
   129
  where [code del]: "open_blinfun S = (\<forall>x\<in>S. \<forall>\<^sub>F (x', y) in uniformity. x' = x \<longrightarrow> y \<in> S)"
immler@61915
   130
immler@61915
   131
lift_definition uminus_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b" is "\<lambda>f x. - f x"
immler@61915
   132
  by (rule bounded_linear_minus)
immler@61915
   133
immler@61915
   134
lift_definition zero_blinfun :: "'a \<Rightarrow>\<^sub>L 'b" is "\<lambda>x. 0"
immler@61915
   135
  by (rule bounded_linear_zero)
immler@61915
   136
immler@61915
   137
lift_definition plus_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   138
  is "\<lambda>f g x. f x + g x"
immler@61915
   139
  by (metis bounded_linear_add)
immler@61915
   140
immler@61915
   141
lift_definition scaleR_blinfun::"real \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b" is "\<lambda>r f x. r *\<^sub>R f x"
immler@61915
   142
  by (metis bounded_linear_compose bounded_linear_scaleR_right)
immler@61915
   143
immler@61915
   144
definition sgn_blinfun :: "'a \<Rightarrow>\<^sub>L 'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   145
  where "sgn_blinfun x = scaleR (inverse (norm x)) x"
immler@61915
   146
immler@61915
   147
instance
immler@61915
   148
  apply standard
hoelzl@62101
   149
  unfolding dist_blinfun_def open_blinfun_def sgn_blinfun_def uniformity_blinfun_def
hoelzl@62101
   150
  apply (rule refl | (transfer, force simp: onorm_triangle onorm_scaleR onorm_eq_0 algebra_simps))+
immler@61915
   151
  done
immler@61915
   152
immler@61915
   153
end
immler@61915
   154
hoelzl@62102
   155
declare uniformity_Abort[where 'a="('a :: real_normed_vector) \<Rightarrow>\<^sub>L ('b :: real_normed_vector)", code]
hoelzl@62102
   156
immler@61915
   157
lemma norm_blinfun_eqI:
immler@61915
   158
  assumes "n \<le> norm (blinfun_apply f x) / norm x"
immler@61915
   159
  assumes "\<And>x. norm (blinfun_apply f x) \<le> n * norm x"
immler@61915
   160
  assumes "0 \<le> n"
immler@61915
   161
  shows "norm f = n"
immler@61915
   162
  by (auto simp: norm_blinfun_def
immler@61915
   163
    intro!: antisym onorm_bound assms order_trans[OF _ le_onorm]
immler@61915
   164
    bounded_linear_intros)
immler@61915
   165
immler@61915
   166
lemma norm_blinfun: "norm (blinfun_apply f x) \<le> norm f * norm x"
immler@61915
   167
  by transfer (rule onorm)
immler@61915
   168
immler@61915
   169
lemma norm_blinfun_bound: "0 \<le> b \<Longrightarrow> (\<And>x. norm (blinfun_apply f x) \<le> b * norm x) \<Longrightarrow> norm f \<le> b"
immler@61915
   170
  by transfer (rule onorm_bound)
immler@61915
   171
immler@61915
   172
lemma bounded_bilinear_blinfun_apply[bounded_bilinear]: "bounded_bilinear blinfun_apply"
immler@61915
   173
proof
immler@61915
   174
  fix f g::"'a \<Rightarrow>\<^sub>L 'b" and a b::'a and r::real
immler@61915
   175
  show "(f + g) a = f a + g a" "(r *\<^sub>R f) a = r *\<^sub>R f a"
immler@61915
   176
    by (transfer, simp)+
immler@61915
   177
  interpret bounded_linear f for f::"'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   178
    by (auto intro!: bounded_linear_intros)
immler@61915
   179
  show "f (a + b) = f a + f b" "f (r *\<^sub>R a) = r *\<^sub>R f a"
immler@61915
   180
    by (simp_all add: add scaleR)
immler@61915
   181
  show "\<exists>K. \<forall>a b. norm (blinfun_apply a b) \<le> norm a * norm b * K"
immler@61915
   182
    by (auto intro!: exI[where x=1] norm_blinfun)
immler@61915
   183
qed
immler@61915
   184
immler@61915
   185
interpretation blinfun: bounded_bilinear blinfun_apply
immler@61915
   186
  by (rule bounded_bilinear_blinfun_apply)
immler@61915
   187
immler@61915
   188
lemmas bounded_linear_apply_blinfun[intro, simp] = blinfun.bounded_linear_left
immler@61915
   189
immler@61915
   190
immler@61915
   191
context bounded_bilinear
immler@61915
   192
begin
immler@61915
   193
immler@61915
   194
named_theorems bilinear_simps
immler@61915
   195
immler@61915
   196
lemmas [bilinear_simps] =
immler@61915
   197
  add_left
immler@61915
   198
  add_right
immler@61915
   199
  diff_left
immler@61915
   200
  diff_right
immler@61915
   201
  minus_left
immler@61915
   202
  minus_right
immler@61915
   203
  scaleR_left
immler@61915
   204
  scaleR_right
immler@61915
   205
  zero_left
immler@61915
   206
  zero_right
immler@61915
   207
  setsum_left
immler@61915
   208
  setsum_right
immler@61915
   209
immler@61915
   210
end
immler@61915
   211
immler@61915
   212
immler@61915
   213
instance blinfun :: (banach, banach) banach
immler@61915
   214
proof
immler@61915
   215
  fix X::"nat \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   216
  assume "Cauchy X"
immler@61915
   217
  {
immler@61915
   218
    fix x::'a
immler@61915
   219
    {
immler@61915
   220
      fix x::'a
immler@61915
   221
      assume "norm x \<le> 1"
immler@61915
   222
      have "Cauchy (\<lambda>n. X n x)"
immler@61915
   223
      proof (rule CauchyI)
immler@61915
   224
        fix e::real
immler@61915
   225
        assume "0 < e"
wenzelm@61975
   226
        from CauchyD[OF \<open>Cauchy X\<close> \<open>0 < e\<close>] obtain M
immler@61915
   227
          where M: "\<And>m n. m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> norm (X m - X n) < e"
immler@61915
   228
          by auto
immler@61915
   229
        show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (X m x - X n x) < e"
immler@61915
   230
        proof (safe intro!: exI[where x=M])
immler@61915
   231
          fix m n
immler@61915
   232
          assume le: "M \<le> m" "M \<le> n"
immler@61915
   233
          have "norm (X m x - X n x) = norm ((X m - X n) x)"
immler@61915
   234
            by (simp add: blinfun.bilinear_simps)
immler@61915
   235
          also have "\<dots> \<le> norm (X m - X n) * norm x"
immler@61915
   236
             by (rule norm_blinfun)
immler@61915
   237
          also have "\<dots> \<le> norm (X m - X n) * 1"
wenzelm@61975
   238
            using \<open>norm x \<le> 1\<close> norm_ge_zero by (rule mult_left_mono)
immler@61915
   239
          also have "\<dots> = norm (X m - X n)" by simp
immler@61915
   240
          also have "\<dots> < e" using le by fact
immler@61915
   241
          finally show "norm (X m x - X n x) < e" .
immler@61915
   242
        qed
immler@61915
   243
      qed
immler@61915
   244
      hence "convergent (\<lambda>n. X n x)"
immler@61915
   245
        by (metis Cauchy_convergent_iff)
immler@61915
   246
    } note convergent_norm1 = this
immler@61915
   247
    def y \<equiv> "x /\<^sub>R norm x"
immler@61915
   248
    have y: "norm y \<le> 1" and xy: "x = norm x *\<^sub>R y"
immler@61915
   249
      by (simp_all add: y_def inverse_eq_divide)
immler@61915
   250
    have "convergent (\<lambda>n. norm x *\<^sub>R X n y)"
immler@61915
   251
      by (intro bounded_bilinear.convergent[OF bounded_bilinear_scaleR] convergent_const
immler@61915
   252
        convergent_norm1 y)
immler@61915
   253
    also have "(\<lambda>n. norm x *\<^sub>R X n y) = (\<lambda>n. X n x)"
immler@61915
   254
      by (subst xy) (simp add: blinfun.bilinear_simps)
immler@61915
   255
    finally have "convergent (\<lambda>n. X n x)" .
immler@61915
   256
  }
wenzelm@61969
   257
  then obtain v where v: "\<And>x. (\<lambda>n. X n x) \<longlonglongrightarrow> v x"
immler@61915
   258
    unfolding convergent_def
immler@61915
   259
    by metis
immler@61915
   260
immler@61915
   261
  have "Cauchy (\<lambda>n. norm (X n))"
immler@61915
   262
  proof (rule CauchyI)
immler@61915
   263
    fix e::real
immler@61915
   264
    assume "e > 0"
wenzelm@61975
   265
    from CauchyD[OF \<open>Cauchy X\<close> \<open>0 < e\<close>] obtain M
immler@61915
   266
      where M: "\<And>m n. m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> norm (X m - X n) < e"
immler@61915
   267
      by auto
immler@61915
   268
    show "\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (norm (X m) - norm (X n)) < e"
immler@61915
   269
    proof (safe intro!: exI[where x=M])
immler@61915
   270
      fix m n assume mn: "m \<ge> M" "n \<ge> M"
immler@61915
   271
      have "norm (norm (X m) - norm (X n)) \<le> norm (X m - X n)"
immler@61915
   272
        by (metis norm_triangle_ineq3 real_norm_def)
immler@61915
   273
      also have "\<dots> < e" using mn by fact
immler@61915
   274
      finally show "norm (norm (X m) - norm (X n)) < e" .
immler@61915
   275
    qed
immler@61915
   276
  qed
wenzelm@61969
   277
  then obtain K where K: "(\<lambda>n. norm (X n)) \<longlonglongrightarrow> K"
immler@61915
   278
    unfolding Cauchy_convergent_iff convergent_def
immler@61915
   279
    by metis
immler@61915
   280
immler@61915
   281
  have "bounded_linear v"
immler@61915
   282
  proof
immler@61915
   283
    fix x y and r::real
immler@61915
   284
    from tendsto_add[OF v[of x] v [of y]] v[of "x + y", unfolded blinfun.bilinear_simps]
immler@61915
   285
      tendsto_scaleR[OF tendsto_const[of r] v[of x]] v[of "r *\<^sub>R x", unfolded blinfun.bilinear_simps]
immler@61915
   286
    show "v (x + y) = v x + v y" "v (r *\<^sub>R x) = r *\<^sub>R v x"
immler@61915
   287
      by (metis (poly_guards_query) LIMSEQ_unique)+
immler@61915
   288
    show "\<exists>K. \<forall>x. norm (v x) \<le> norm x * K"
immler@61915
   289
    proof (safe intro!: exI[where x=K])
immler@61915
   290
      fix x
immler@61915
   291
      have "norm (v x) \<le> K * norm x"
immler@61915
   292
        by (rule tendsto_le[OF _ tendsto_mult[OF K tendsto_const] tendsto_norm[OF v]])
immler@61915
   293
          (auto simp: norm_blinfun)
immler@61915
   294
      thus "norm (v x) \<le> norm x * K"
immler@61915
   295
        by (simp add: ac_simps)
immler@61915
   296
    qed
immler@61915
   297
  qed
wenzelm@61969
   298
  hence Bv: "\<And>x. (\<lambda>n. X n x) \<longlonglongrightarrow> Blinfun v x"
immler@61915
   299
    by (auto simp: bounded_linear_Blinfun_apply v)
immler@61915
   300
wenzelm@61969
   301
  have "X \<longlonglongrightarrow> Blinfun v"
immler@61915
   302
  proof (rule LIMSEQ_I)
immler@61915
   303
    fix r::real assume "r > 0"
immler@61915
   304
    def r' \<equiv> "r / 2"
wenzelm@61975
   305
    have "0 < r'" "r' < r" using \<open>r > 0\<close> by (simp_all add: r'_def)
wenzelm@61975
   306
    from CauchyD[OF \<open>Cauchy X\<close> \<open>r' > 0\<close>]
immler@61915
   307
    obtain M where M: "\<And>m n. m \<ge> M \<Longrightarrow> n \<ge> M \<Longrightarrow> norm (X m - X n) < r'"
immler@61915
   308
      by metis
immler@61915
   309
    show "\<exists>no. \<forall>n\<ge>no. norm (X n - Blinfun v) < r"
immler@61915
   310
    proof (safe intro!: exI[where x=M])
immler@61915
   311
      fix n assume n: "M \<le> n"
immler@61915
   312
      have "norm (X n - Blinfun v) \<le> r'"
immler@61915
   313
      proof (rule norm_blinfun_bound)
immler@61915
   314
        fix x
immler@61915
   315
        have "eventually (\<lambda>m. m \<ge> M) sequentially"
immler@61915
   316
          by (metis eventually_ge_at_top)
immler@61915
   317
        hence ev_le: "eventually (\<lambda>m. norm (X n x - X m x) \<le> r' * norm x) sequentially"
immler@61915
   318
        proof eventually_elim
immler@61915
   319
          case (elim m)
immler@61915
   320
          have "norm (X n x - X m x) = norm ((X n - X m) x)"
immler@61915
   321
            by (simp add: blinfun.bilinear_simps)
immler@61915
   322
          also have "\<dots> \<le> norm ((X n - X m)) * norm x"
immler@61915
   323
            by (rule norm_blinfun)
immler@61915
   324
          also have "\<dots> \<le> r' * norm x"
immler@61915
   325
            using M[OF n elim] by (simp add: mult_right_mono)
immler@61915
   326
          finally show ?case .
immler@61915
   327
        qed
wenzelm@61969
   328
        have tendsto_v: "(\<lambda>m. norm (X n x - X m x)) \<longlonglongrightarrow> norm (X n x - Blinfun v x)"
immler@61915
   329
          by (auto intro!: tendsto_intros Bv)
immler@61915
   330
        show "norm ((X n - Blinfun v) x) \<le> r' * norm x"
immler@61915
   331
          by (auto intro!: tendsto_ge_const tendsto_v ev_le simp: blinfun.bilinear_simps)
wenzelm@61975
   332
      qed (simp add: \<open>0 < r'\<close> less_imp_le)
immler@61915
   333
      thus "norm (X n - Blinfun v) < r"
wenzelm@61975
   334
        by (metis \<open>r' < r\<close> le_less_trans)
immler@61915
   335
    qed
immler@61915
   336
  qed
immler@61915
   337
  thus "convergent X"
immler@61915
   338
    by (rule convergentI)
immler@61915
   339
qed
immler@61915
   340
wenzelm@61975
   341
subsection \<open>On Euclidean Space\<close>
immler@61915
   342
immler@61915
   343
lemma Zfun_setsum:
immler@61915
   344
  assumes "finite s"
immler@61915
   345
  assumes f: "\<And>i. i \<in> s \<Longrightarrow> Zfun (f i) F"
immler@61915
   346
  shows "Zfun (\<lambda>x. setsum (\<lambda>i. f i x) s) F"
immler@61915
   347
  using assms by induct (auto intro!: Zfun_zero Zfun_add)
immler@61915
   348
immler@61915
   349
lemma norm_blinfun_euclidean_le:
immler@61915
   350
  fixes a::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::real_normed_vector"
immler@61915
   351
  shows "norm a \<le> setsum (\<lambda>x. norm (a x)) Basis"
immler@61915
   352
  apply (rule norm_blinfun_bound)
immler@61915
   353
   apply (simp add: setsum_nonneg)
immler@61915
   354
  apply (subst euclidean_representation[symmetric, where 'a='a])
immler@61915
   355
  apply (simp only: blinfun.bilinear_simps setsum_left_distrib)
immler@61915
   356
  apply (rule order.trans[OF norm_setsum setsum_mono])
immler@61915
   357
  apply (simp add: abs_mult mult_right_mono ac_simps Basis_le_norm)
immler@61915
   358
  done
immler@61915
   359
immler@61915
   360
lemma tendsto_componentwise1:
immler@61915
   361
  fixes a::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::real_normed_vector"
immler@61915
   362
    and b::"'c \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
wenzelm@61973
   363
  assumes "(\<And>j. j \<in> Basis \<Longrightarrow> ((\<lambda>n. b n j) \<longlongrightarrow> a j) F)"
wenzelm@61973
   364
  shows "(b \<longlongrightarrow> a) F"
immler@61915
   365
proof -
immler@61915
   366
  have "\<And>j. j \<in> Basis \<Longrightarrow> Zfun (\<lambda>x. norm (b x j - a j)) F"
immler@61915
   367
    using assms unfolding tendsto_Zfun_iff Zfun_norm_iff .
immler@61915
   368
  hence "Zfun (\<lambda>x. \<Sum>j\<in>Basis. norm (b x j - a j)) F"
immler@61915
   369
    by (auto intro!: Zfun_setsum)
immler@61915
   370
  thus ?thesis
immler@61915
   371
    unfolding tendsto_Zfun_iff
immler@61915
   372
    by (rule Zfun_le)
immler@61915
   373
      (auto intro!: order_trans[OF norm_blinfun_euclidean_le] simp: blinfun.bilinear_simps)
immler@61915
   374
qed
immler@61915
   375
immler@61915
   376
lift_definition
immler@61915
   377
  blinfun_of_matrix::"('b::euclidean_space \<Rightarrow> 'a::euclidean_space \<Rightarrow> real) \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   378
  is "\<lambda>a x. \<Sum>i\<in>Basis. \<Sum>j\<in>Basis. ((x \<bullet> j) * a i j) *\<^sub>R i"
immler@61915
   379
  by (intro bounded_linear_intros)
immler@61915
   380
immler@61915
   381
lemma blinfun_of_matrix_works:
immler@61915
   382
  fixes f::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::euclidean_space"
immler@61915
   383
  shows "blinfun_of_matrix (\<lambda>i j. (f j) \<bullet> i) = f"
immler@61915
   384
proof (transfer, rule,  rule euclidean_eqI)
immler@61915
   385
  fix f::"'a \<Rightarrow> 'b" and x::'a and b::'b assume "bounded_linear f" and b: "b \<in> Basis"
immler@61915
   386
  then interpret bounded_linear f by simp
immler@61915
   387
  have "(\<Sum>j\<in>Basis. \<Sum>i\<in>Basis. (x \<bullet> i * (f i \<bullet> j)) *\<^sub>R j) \<bullet> b
immler@61915
   388
    = (\<Sum>j\<in>Basis. if j = b then (\<Sum>i\<in>Basis. (x \<bullet> i * (f i \<bullet> j))) else 0)"
immler@61915
   389
    using b
immler@61915
   390
    by (auto simp add: algebra_simps inner_setsum_left inner_Basis split: split_if intro!: setsum.cong)
immler@61915
   391
  also have "\<dots> = (\<Sum>i\<in>Basis. (x \<bullet> i * (f i \<bullet> b)))"
immler@61915
   392
    using b by (simp add: setsum.delta)
immler@61915
   393
  also have "\<dots> = f x \<bullet> b"
immler@61915
   394
    by (subst linear_componentwise[symmetric]) (unfold_locales, rule)
immler@61915
   395
  finally show "(\<Sum>j\<in>Basis. \<Sum>i\<in>Basis. (x \<bullet> i * (f i \<bullet> j)) *\<^sub>R j) \<bullet> b = f x \<bullet> b" .
immler@61915
   396
qed
immler@61915
   397
immler@61915
   398
lemma blinfun_of_matrix_apply:
immler@61915
   399
  "blinfun_of_matrix a x = (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. ((x \<bullet> j) * a i j) *\<^sub>R i)"
immler@61915
   400
  by transfer simp
immler@61915
   401
immler@61915
   402
lemma blinfun_of_matrix_minus: "blinfun_of_matrix x - blinfun_of_matrix y = blinfun_of_matrix (x - y)"
immler@61915
   403
  by transfer (auto simp: algebra_simps setsum_subtractf)
immler@61915
   404
immler@61915
   405
lemma norm_blinfun_of_matrix:
wenzelm@61945
   406
  "norm (blinfun_of_matrix a) \<le> (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. \<bar>a i j\<bar>)"
immler@61915
   407
  apply (rule norm_blinfun_bound)
immler@61915
   408
   apply (simp add: setsum_nonneg)
immler@61915
   409
  apply (simp only: blinfun_of_matrix_apply setsum_left_distrib)
immler@61915
   410
  apply (rule order_trans[OF norm_setsum setsum_mono])
immler@61915
   411
  apply (rule order_trans[OF norm_setsum setsum_mono])
immler@61915
   412
  apply (simp add: abs_mult mult_right_mono ac_simps Basis_le_norm)
immler@61915
   413
  done
immler@61915
   414
immler@61915
   415
lemma tendsto_blinfun_of_matrix:
wenzelm@61973
   416
  assumes "\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> ((\<lambda>n. b n i j) \<longlongrightarrow> a i j) F"
wenzelm@61973
   417
  shows "((\<lambda>n. blinfun_of_matrix (b n)) \<longlongrightarrow> blinfun_of_matrix a) F"
immler@61915
   418
proof -
immler@61915
   419
  have "\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> Zfun (\<lambda>x. norm (b x i j - a i j)) F"
immler@61915
   420
    using assms unfolding tendsto_Zfun_iff Zfun_norm_iff .
wenzelm@61945
   421
  hence "Zfun (\<lambda>x. (\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. \<bar>b x i j - a i j\<bar>)) F"
immler@61915
   422
    by (auto intro!: Zfun_setsum)
immler@61915
   423
  thus ?thesis
immler@61915
   424
    unfolding tendsto_Zfun_iff blinfun_of_matrix_minus
immler@61915
   425
    by (rule Zfun_le) (auto intro!: order_trans[OF norm_blinfun_of_matrix])
immler@61915
   426
qed
immler@61915
   427
immler@61915
   428
lemma tendsto_componentwise:
immler@61915
   429
  fixes a::"'a::euclidean_space \<Rightarrow>\<^sub>L 'b::euclidean_space"
immler@61915
   430
    and b::"'c \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
wenzelm@61973
   431
  shows "(\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> ((\<lambda>n. b n j \<bullet> i) \<longlongrightarrow> a j \<bullet> i) F) \<Longrightarrow> (b \<longlongrightarrow> a) F"
immler@61915
   432
  apply (subst blinfun_of_matrix_works[of a, symmetric])
immler@61915
   433
  apply (subst blinfun_of_matrix_works[of "b x" for x, symmetric, abs_def])
immler@61915
   434
  by (rule tendsto_blinfun_of_matrix)
immler@61915
   435
immler@61915
   436
lemma
immler@61915
   437
  continuous_blinfun_componentwiseI:
immler@61915
   438
  fixes f:: "'b::t2_space \<Rightarrow> 'a::euclidean_space \<Rightarrow>\<^sub>L 'c::euclidean_space"
immler@61915
   439
  assumes "\<And>i j. i \<in> Basis \<Longrightarrow> j \<in> Basis \<Longrightarrow> continuous F (\<lambda>x. (f x) j \<bullet> i)"
immler@61915
   440
  shows "continuous F f"
immler@61915
   441
  using assms by (auto simp: continuous_def intro!: tendsto_componentwise)
immler@61915
   442
immler@61915
   443
lemma
immler@61915
   444
  continuous_blinfun_componentwiseI1:
immler@61915
   445
  fixes f:: "'b::t2_space \<Rightarrow> 'a::euclidean_space \<Rightarrow>\<^sub>L 'c::real_normed_vector"
immler@61915
   446
  assumes "\<And>i. i \<in> Basis \<Longrightarrow> continuous F (\<lambda>x. f x i)"
immler@61915
   447
  shows "continuous F f"
immler@61915
   448
  using assms by (auto simp: continuous_def intro!: tendsto_componentwise1)
immler@61915
   449
immler@61915
   450
lemma bounded_linear_blinfun_matrix: "bounded_linear (\<lambda>x. (x::_\<Rightarrow>\<^sub>L _) j \<bullet> i)"
immler@61915
   451
  by (auto intro!: bounded_linearI' bounded_linear_intros)
immler@61915
   452
immler@61915
   453
lemma continuous_blinfun_matrix:
immler@61915
   454
  fixes f:: "'b::t2_space \<Rightarrow> 'a::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_inner"
immler@61915
   455
  assumes "continuous F f"
immler@61915
   456
  shows "continuous F (\<lambda>x. (f x) j \<bullet> i)"
immler@61915
   457
  by (rule bounded_linear.continuous[OF bounded_linear_blinfun_matrix assms])
immler@61915
   458
immler@61915
   459
lemma continuous_on_blinfun_matrix:
immler@61915
   460
  fixes f::"'a::t2_space \<Rightarrow> 'b::real_normed_vector \<Rightarrow>\<^sub>L 'c::real_inner"
immler@61915
   461
  assumes "continuous_on S f"
immler@61915
   462
  shows "continuous_on S (\<lambda>x. (f x) j \<bullet> i)"
immler@61915
   463
  using assms
immler@61915
   464
  by (auto simp: continuous_on_eq_continuous_within continuous_blinfun_matrix)
immler@61915
   465
immler@61915
   466
lemma mult_if_delta:
immler@61915
   467
  "(if P then (1::'a::comm_semiring_1) else 0) * q = (if P then q else 0)"
immler@61915
   468
  by auto
immler@61915
   469
immler@61915
   470
lemma compact_blinfun_lemma:
immler@61915
   471
  fixes f :: "nat \<Rightarrow> 'a::euclidean_space \<Rightarrow>\<^sub>L 'b::euclidean_space"
immler@61915
   472
  assumes "bounded (range f)"
immler@61915
   473
  shows "\<forall>d\<subseteq>Basis. \<exists>l::'a \<Rightarrow>\<^sub>L 'b. \<exists> r.
immler@61915
   474
    subseq r \<and> (\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>d. dist (f (r n) i) (l i) < e) sequentially)"
immler@62127
   475
  by (rule compact_lemma_general[where unproj = "\<lambda>e. blinfun_of_matrix (\<lambda>i j. e j \<bullet> i)"])
immler@62127
   476
   (auto intro!: euclidean_eqI[where 'a='b] bounded_linear_image assms
immler@62127
   477
    simp: blinfun_of_matrix_works blinfun_of_matrix_apply inner_Basis mult_if_delta setsum.delta'
immler@62127
   478
      scaleR_setsum_left[symmetric])
immler@61915
   479
immler@61915
   480
lemma blinfun_euclidean_eqI: "(\<And>i. i \<in> Basis \<Longrightarrow> blinfun_apply x i = blinfun_apply y i) \<Longrightarrow> x = y"
immler@61915
   481
  apply (auto intro!: blinfun_eqI)
immler@61915
   482
  apply (subst (2) euclidean_representation[symmetric, where 'a='a])
immler@61915
   483
  apply (subst (1) euclidean_representation[symmetric, where 'a='a])
immler@61915
   484
  apply (simp add: blinfun.bilinear_simps)
immler@61915
   485
  done
immler@61915
   486
wenzelm@61975
   487
text \<open>TODO: generalize (via @{thm compact_cball})?\<close>
immler@61915
   488
instance blinfun :: (euclidean_space, euclidean_space) heine_borel
immler@61915
   489
proof
immler@61915
   490
  fix f :: "nat \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'b"
immler@61915
   491
  assume f: "bounded (range f)"
immler@61915
   492
  then obtain l::"'a \<Rightarrow>\<^sub>L 'b" and r where r: "subseq r"
immler@61915
   493
    and l: "\<forall>e>0. eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) i) (l i) < e) sequentially"
immler@61915
   494
    using compact_blinfun_lemma [OF f] by blast
immler@61915
   495
  {
immler@61915
   496
    fix e::real
immler@61915
   497
    let ?d = "real_of_nat DIM('a) * real_of_nat DIM('b)"
immler@61915
   498
    assume "e > 0"
immler@61915
   499
    hence "e / ?d > 0" by (simp add: DIM_positive)
immler@61915
   500
    with l have "eventually (\<lambda>n. \<forall>i\<in>Basis. dist (f (r n) i) (l i) < e / ?d) sequentially"
immler@61915
   501
      by simp
immler@61915
   502
    moreover
immler@61915
   503
    {
immler@61915
   504
      fix n
immler@61915
   505
      assume n: "\<forall>i\<in>Basis. dist (f (r n) i) (l i) < e / ?d"
immler@61915
   506
      have "norm (f (r n) - l) = norm (blinfun_of_matrix (\<lambda>i j. (f (r n) - l) j \<bullet> i))"
immler@61915
   507
        unfolding blinfun_of_matrix_works ..
immler@61915
   508
      also note norm_blinfun_of_matrix
immler@61915
   509
      also have "(\<Sum>i\<in>Basis. \<Sum>j\<in>Basis. \<bar>(f (r n) - l) j \<bullet> i\<bar>) <
immler@61915
   510
        (\<Sum>i\<in>(Basis::'b set). e / real_of_nat DIM('b))"
immler@61915
   511
      proof (rule setsum_strict_mono)
immler@61915
   512
        fix i::'b assume i: "i \<in> Basis"
immler@61915
   513
        have "(\<Sum>j::'a\<in>Basis. \<bar>(f (r n) - l) j \<bullet> i\<bar>) < (\<Sum>j::'a\<in>Basis. e / ?d)"
immler@61915
   514
        proof (rule setsum_strict_mono)
immler@61915
   515
          fix j::'a assume j: "j \<in> Basis"
immler@61915
   516
          have "\<bar>(f (r n) - l) j \<bullet> i\<bar> \<le> norm ((f (r n) - l) j)"
immler@61915
   517
            by (simp add: Basis_le_norm i)
immler@61915
   518
          also have "\<dots> < e / ?d"
immler@61915
   519
            using n i j by (auto simp: dist_norm blinfun.bilinear_simps)
immler@61915
   520
          finally show "\<bar>(f (r n) - l) j \<bullet> i\<bar> < e / ?d" by simp
immler@61915
   521
        qed simp_all
immler@61915
   522
        also have "\<dots> \<le> e / real_of_nat DIM('b)"
immler@61915
   523
          by simp
immler@61915
   524
        finally show "(\<Sum>j\<in>Basis. \<bar>(f (r n) - l) j \<bullet> i\<bar>) < e / real_of_nat DIM('b)"
immler@61915
   525
          by simp
immler@61915
   526
      qed simp_all
immler@61915
   527
      also have "\<dots> \<le> e" by simp
immler@61915
   528
      finally have "dist (f (r n)) l < e"
immler@61915
   529
        by (auto simp: dist_norm)
immler@61915
   530
    }
immler@61915
   531
    ultimately have "eventually (\<lambda>n. dist (f (r n)) l < e) sequentially"
immler@61915
   532
      using eventually_elim2 by force
immler@61915
   533
  }
wenzelm@61973
   534
  then have *: "((f \<circ> r) \<longlongrightarrow> l) sequentially"
immler@61915
   535
    unfolding o_def tendsto_iff by simp
wenzelm@61973
   536
  with r show "\<exists>l r. subseq r \<and> ((f \<circ> r) \<longlongrightarrow> l) sequentially"
immler@61915
   537
    by auto
immler@61915
   538
qed
immler@61915
   539
immler@61915
   540
immler@61915
   541
subsection \<open>concrete bounded linear functions\<close>
immler@61915
   542
immler@61916
   543
lemma transfer_bounded_bilinear_bounded_linearI:
immler@61916
   544
  assumes "g = (\<lambda>i x. (blinfun_apply (f i) x))"
immler@61916
   545
  shows "bounded_bilinear g = bounded_linear f"
immler@61916
   546
proof
immler@61916
   547
  assume "bounded_bilinear g"
immler@61916
   548
  then interpret bounded_bilinear f by (simp add: assms)
immler@61916
   549
  show "bounded_linear f"
immler@61916
   550
  proof (unfold_locales, safe intro!: blinfun_eqI)
immler@61916
   551
    fix i
immler@61916
   552
    show "f (x + y) i = (f x + f y) i" "f (r *\<^sub>R x) i = (r *\<^sub>R f x) i" for r x y
immler@61916
   553
      by (auto intro!: blinfun_eqI simp: blinfun.bilinear_simps)
immler@61916
   554
    from _ nonneg_bounded show "\<exists>K. \<forall>x. norm (f x) \<le> norm x * K"
immler@61916
   555
      by (rule ex_reg) (auto intro!: onorm_bound simp: norm_blinfun.rep_eq ac_simps)
immler@61916
   556
  qed
immler@61916
   557
qed (auto simp: assms intro!: blinfun.comp)
immler@61916
   558
immler@61916
   559
lemma transfer_bounded_bilinear_bounded_linear[transfer_rule]:
immler@61916
   560
  "(rel_fun (rel_fun op = (pcr_blinfun op = op =)) op =) bounded_bilinear bounded_linear"
immler@61916
   561
  by (auto simp: pcr_blinfun_def cr_blinfun_def rel_fun_def OO_def
immler@61916
   562
    intro!: transfer_bounded_bilinear_bounded_linearI)
immler@61915
   563
immler@61915
   564
context bounded_bilinear
immler@61915
   565
begin
immler@61915
   566
immler@61915
   567
lift_definition prod_left::"'b \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'c" is "(\<lambda>b a. prod a b)"
immler@61915
   568
  by (rule bounded_linear_left)
immler@61915
   569
declare prod_left.rep_eq[simp]
immler@61915
   570
immler@61915
   571
lemma bounded_linear_prod_left[bounded_linear]: "bounded_linear prod_left"
immler@61916
   572
  by transfer (rule flip)
immler@61915
   573
immler@61915
   574
lift_definition prod_right::"'a \<Rightarrow> 'b \<Rightarrow>\<^sub>L 'c" is "(\<lambda>a b. prod a b)"
immler@61915
   575
  by (rule bounded_linear_right)
immler@61915
   576
declare prod_right.rep_eq[simp]
immler@61915
   577
immler@61915
   578
lemma bounded_linear_prod_right[bounded_linear]: "bounded_linear prod_right"
immler@61916
   579
  by transfer (rule bounded_bilinear_axioms)
immler@61915
   580
immler@61915
   581
end
immler@61915
   582
immler@61915
   583
lift_definition id_blinfun::"'a::real_normed_vector \<Rightarrow>\<^sub>L 'a" is "\<lambda>x. x"
immler@61915
   584
  by (rule bounded_linear_ident)
immler@61915
   585
immler@61915
   586
lemmas blinfun_apply_id_blinfun[simp] = id_blinfun.rep_eq
immler@61915
   587
immler@61915
   588
lemma norm_blinfun_id[simp]:
immler@61915
   589
  "norm (id_blinfun::'a::{real_normed_vector, perfect_space} \<Rightarrow>\<^sub>L 'a) = 1"
immler@61915
   590
  by transfer (auto simp: onorm_id)
immler@61915
   591
immler@61915
   592
lemma norm_blinfun_id_le:
immler@61915
   593
  "norm (id_blinfun::'a::real_normed_vector \<Rightarrow>\<^sub>L 'a) \<le> 1"
immler@61915
   594
  by transfer (auto simp: onorm_id_le)
immler@61915
   595
immler@61915
   596
immler@61915
   597
lift_definition fst_blinfun::"('a::real_normed_vector \<times> 'b::real_normed_vector) \<Rightarrow>\<^sub>L 'a" is fst
immler@61915
   598
  by (rule bounded_linear_fst)
immler@61915
   599
immler@61915
   600
lemma blinfun_apply_fst_blinfun[simp]: "blinfun_apply fst_blinfun = fst"
immler@61915
   601
  by transfer (rule refl)
immler@61915
   602
immler@61915
   603
immler@61915
   604
lift_definition snd_blinfun::"('a::real_normed_vector \<times> 'b::real_normed_vector) \<Rightarrow>\<^sub>L 'b" is snd
immler@61915
   605
  by (rule bounded_linear_snd)
immler@61915
   606
immler@61915
   607
lemma blinfun_apply_snd_blinfun[simp]: "blinfun_apply snd_blinfun = snd"
immler@61915
   608
  by transfer (rule refl)
immler@61915
   609
immler@61915
   610
immler@61915
   611
lift_definition blinfun_compose::
immler@61915
   612
  "'a::real_normed_vector \<Rightarrow>\<^sub>L 'b::real_normed_vector \<Rightarrow>
immler@61915
   613
    'c::real_normed_vector \<Rightarrow>\<^sub>L 'a \<Rightarrow>
immler@61915
   614
    'c \<Rightarrow>\<^sub>L 'b" (infixl "o\<^sub>L" 55) is "op o"
immler@61915
   615
  parametric comp_transfer
immler@61915
   616
  unfolding o_def
immler@61915
   617
  by (rule bounded_linear_compose)
immler@61915
   618
immler@61915
   619
lemma blinfun_apply_blinfun_compose[simp]: "(a o\<^sub>L b) c = a (b c)"
immler@61915
   620
  by (simp add: blinfun_compose.rep_eq)
immler@61915
   621
immler@61915
   622
lemma norm_blinfun_compose:
immler@61915
   623
  "norm (f o\<^sub>L g) \<le> norm f * norm g"
immler@61915
   624
  by transfer (rule onorm_compose)
immler@61915
   625
immler@61915
   626
lemma bounded_bilinear_blinfun_compose[bounded_bilinear]: "bounded_bilinear op o\<^sub>L"
immler@61915
   627
  by unfold_locales
immler@61915
   628
    (auto intro!: blinfun_eqI exI[where x=1] simp: blinfun.bilinear_simps norm_blinfun_compose)
immler@61915
   629
immler@61915
   630
immler@61915
   631
lift_definition blinfun_inner_right::"'a::real_inner \<Rightarrow> 'a \<Rightarrow>\<^sub>L real" is "op \<bullet>"
immler@61915
   632
  by (rule bounded_linear_inner_right)
immler@61915
   633
declare blinfun_inner_right.rep_eq[simp]
immler@61915
   634
immler@61915
   635
lemma bounded_linear_blinfun_inner_right[bounded_linear]: "bounded_linear blinfun_inner_right"
immler@61916
   636
  by transfer (rule bounded_bilinear_inner)
immler@61915
   637
immler@61915
   638
immler@61915
   639
lift_definition blinfun_inner_left::"'a::real_inner \<Rightarrow> 'a \<Rightarrow>\<^sub>L real" is "\<lambda>x y. y \<bullet> x"
immler@61915
   640
  by (rule bounded_linear_inner_left)
immler@61915
   641
declare blinfun_inner_left.rep_eq[simp]
immler@61915
   642
immler@61915
   643
lemma bounded_linear_blinfun_inner_left[bounded_linear]: "bounded_linear blinfun_inner_left"
immler@61916
   644
  by transfer (rule bounded_bilinear.flip[OF bounded_bilinear_inner])
immler@61915
   645
immler@61915
   646
immler@61915
   647
lift_definition blinfun_scaleR_right::"real \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'a::real_normed_vector" is "op *\<^sub>R"
immler@61915
   648
  by (rule bounded_linear_scaleR_right)
immler@61915
   649
declare blinfun_scaleR_right.rep_eq[simp]
immler@61915
   650
immler@61915
   651
lemma bounded_linear_blinfun_scaleR_right[bounded_linear]: "bounded_linear blinfun_scaleR_right"
immler@61916
   652
  by transfer (rule bounded_bilinear_scaleR)
immler@61915
   653
immler@61915
   654
immler@61915
   655
lift_definition blinfun_scaleR_left::"'a::real_normed_vector \<Rightarrow> real \<Rightarrow>\<^sub>L 'a" is "\<lambda>x y. y *\<^sub>R x"
immler@61915
   656
  by (rule bounded_linear_scaleR_left)
immler@61915
   657
lemmas [simp] = blinfun_scaleR_left.rep_eq
immler@61915
   658
immler@61915
   659
lemma bounded_linear_blinfun_scaleR_left[bounded_linear]: "bounded_linear blinfun_scaleR_left"
immler@61916
   660
  by transfer (rule bounded_bilinear.flip[OF bounded_bilinear_scaleR])
immler@61915
   661
immler@61915
   662
immler@61915
   663
lift_definition blinfun_mult_right::"'a \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'a::real_normed_algebra" is "op *"
immler@61915
   664
  by (rule bounded_linear_mult_right)
immler@61915
   665
declare blinfun_mult_right.rep_eq[simp]
immler@61915
   666
immler@61915
   667
lemma bounded_linear_blinfun_mult_right[bounded_linear]: "bounded_linear blinfun_mult_right"
immler@61916
   668
  by transfer (rule bounded_bilinear_mult)
immler@61915
   669
immler@61915
   670
immler@61915
   671
lift_definition blinfun_mult_left::"'a::real_normed_algebra \<Rightarrow> 'a \<Rightarrow>\<^sub>L 'a" is "\<lambda>x y. y * x"
immler@61915
   672
  by (rule bounded_linear_mult_left)
immler@61915
   673
lemmas [simp] = blinfun_mult_left.rep_eq
immler@61915
   674
immler@61915
   675
lemma bounded_linear_blinfun_mult_left[bounded_linear]: "bounded_linear blinfun_mult_left"
immler@61916
   676
  by transfer (rule bounded_bilinear.flip[OF bounded_bilinear_mult])
immler@61915
   677
immler@61915
   678
end