Datasets:

Modalities:
Text
Languages:
English
Libraries:
Datasets
License:
Zhangir Azerbayev
squashed?
4365a98
raw
history blame
23.2 kB
/-
Copyright (c) 2018 Patrick Massot. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Patrick Massot, Johannes HΓΆlzl
-/
import analysis.normed.field.basic
import analysis.normed.group.infinite_sum
import data.matrix.basic
import topology.sequences
/-!
# Normed spaces
In this file we define (semi)normed spaces and algebras. We also prove some theorems
about these definitions.
-/
variables {Ξ± : Type*} {Ξ² : Type*} {Ξ³ : Type*} {ΞΉ : Type*}
noncomputable theory
open filter metric function set
open_locale topological_space big_operators nnreal ennreal uniformity pointwise
section seminormed_add_comm_group
section prio
set_option extends_priority 920
-- Here, we set a rather high priority for the instance `[normed_space Ξ± Ξ²] : module Ξ± Ξ²`
-- to take precedence over `semiring.to_module` as this leads to instance paths with better
-- unification properties.
/-- A normed space over a normed field is a vector space endowed with a norm which satisfies the
equality `βˆ₯c β€’ xβˆ₯ = βˆ₯cβˆ₯ βˆ₯xβˆ₯`. We require only `βˆ₯c β€’ xβˆ₯ ≀ βˆ₯cβˆ₯ βˆ₯xβˆ₯` in the definition, then prove
`βˆ₯c β€’ xβˆ₯ = βˆ₯cβˆ₯ βˆ₯xβˆ₯` in `norm_smul`.
Note that since this requires `seminormed_add_comm_group` and not `normed_add_comm_group`, this
typeclass can be used for "semi normed spaces" too, just as `module` can be used for
"semi modules". -/
class normed_space (Ξ± : Type*) (Ξ² : Type*) [normed_field Ξ±] [seminormed_add_comm_group Ξ²]
extends module Ξ± Ξ² :=
(norm_smul_le : βˆ€ (a:Ξ±) (b:Ξ²), βˆ₯a β€’ bβˆ₯ ≀ βˆ₯aβˆ₯ * βˆ₯bβˆ₯)
end prio
variables [normed_field Ξ±] [seminormed_add_comm_group Ξ²]
@[priority 100] -- see Note [lower instance priority]
instance normed_space.has_bounded_smul [normed_space Ξ± Ξ²] : has_bounded_smul Ξ± Ξ² :=
{ dist_smul_pair' := Ξ» x y₁ yβ‚‚,
by simpa [dist_eq_norm, smul_sub] using normed_space.norm_smul_le x (y₁ - yβ‚‚),
dist_pair_smul' := Ξ» x₁ xβ‚‚ y,
by simpa [dist_eq_norm, sub_smul] using normed_space.norm_smul_le (x₁ - xβ‚‚) y }
instance normed_field.to_normed_space : normed_space Ξ± Ξ± :=
{ norm_smul_le := Ξ» a b, le_of_eq (norm_mul a b) }
lemma norm_smul [normed_space Ξ± Ξ²] (s : Ξ±) (x : Ξ²) : βˆ₯s β€’ xβˆ₯ = βˆ₯sβˆ₯ * βˆ₯xβˆ₯ :=
begin
by_cases h : s = 0,
{ simp [h] },
{ refine le_antisymm (normed_space.norm_smul_le s x) _,
calc βˆ₯sβˆ₯ * βˆ₯xβˆ₯ = βˆ₯sβˆ₯ * βˆ₯s⁻¹ β€’ s β€’ xβˆ₯ : by rw [inv_smul_smulβ‚€ h]
... ≀ βˆ₯sβˆ₯ * (βˆ₯s⁻¹βˆ₯ * βˆ₯s β€’ xβˆ₯) :
mul_le_mul_of_nonneg_left (normed_space.norm_smul_le _ _) (norm_nonneg _)
... = βˆ₯s β€’ xβˆ₯ :
by rw [norm_inv, ← mul_assoc, mul_inv_cancel (mt norm_eq_zero.1 h), one_mul] }
end
@[simp] lemma abs_norm_eq_norm (z : Ξ²) : |βˆ₯zβˆ₯| = βˆ₯zβˆ₯ :=
(abs_eq (norm_nonneg z)).mpr (or.inl rfl)
lemma inv_norm_smul_mem_closed_unit_ball [normed_space ℝ Ξ²] (x : Ξ²) :
βˆ₯xβˆ₯⁻¹ β€’ x ∈ closed_ball (0 : Ξ²) 1 :=
by simp only [mem_closed_ball_zero_iff, norm_smul, norm_inv, norm_norm, ← div_eq_inv_mul,
div_self_le_one]
lemma dist_smul [normed_space Ξ± Ξ²] (s : Ξ±) (x y : Ξ²) : dist (s β€’ x) (s β€’ y) = βˆ₯sβˆ₯ * dist x y :=
by simp only [dist_eq_norm, (norm_smul _ _).symm, smul_sub]
lemma nnnorm_smul [normed_space Ξ± Ξ²] (s : Ξ±) (x : Ξ²) : βˆ₯s β€’ xβˆ₯β‚Š = βˆ₯sβˆ₯β‚Š * βˆ₯xβˆ₯β‚Š :=
nnreal.eq $ norm_smul s x
lemma nndist_smul [normed_space Ξ± Ξ²] (s : Ξ±) (x y : Ξ²) :
nndist (s β€’ x) (s β€’ y) = βˆ₯sβˆ₯β‚Š * nndist x y :=
nnreal.eq $ dist_smul s x y
lemma lipschitz_with_smul [normed_space Ξ± Ξ²] (s : Ξ±) : lipschitz_with βˆ₯sβˆ₯β‚Š ((β€’) s : Ξ² β†’ Ξ²) :=
lipschitz_with_iff_dist_le_mul.2 $ Ξ» x y, by rw [dist_smul, coe_nnnorm]
lemma norm_smul_of_nonneg [normed_space ℝ Ξ²] {t : ℝ} (ht : 0 ≀ t) (x : Ξ²) :
βˆ₯t β€’ xβˆ₯ = t * βˆ₯xβˆ₯ := by rw [norm_smul, real.norm_eq_abs, abs_of_nonneg ht]
variables {E : Type*} [seminormed_add_comm_group E] [normed_space Ξ± E]
variables {F : Type*} [seminormed_add_comm_group F] [normed_space Ξ± F]
theorem eventually_nhds_norm_smul_sub_lt (c : Ξ±) (x : E) {Ξ΅ : ℝ} (h : 0 < Ξ΅) :
βˆ€αΆ  y in 𝓝 x, βˆ₯c β€’ (y - x)βˆ₯ < Ξ΅ :=
have tendsto (Ξ» y, βˆ₯c β€’ (y - x)βˆ₯) (𝓝 x) (𝓝 0),
from ((continuous_id.sub continuous_const).const_smul _).norm.tendsto' _ _ (by simp),
this.eventually (gt_mem_nhds h)
lemma filter.tendsto.zero_smul_is_bounded_under_le {f : ΞΉ β†’ Ξ±} {g : ΞΉ β†’ E} {l : filter ΞΉ}
(hf : tendsto f l (𝓝 0)) (hg : is_bounded_under (≀) l (norm ∘ g)) :
tendsto (Ξ» x, f x β€’ g x) l (𝓝 0) :=
hf.op_zero_is_bounded_under_le hg (β€’) (Ξ» x y, (norm_smul x y).le)
lemma filter.is_bounded_under.smul_tendsto_zero {f : ΞΉ β†’ Ξ±} {g : ΞΉ β†’ E} {l : filter ΞΉ}
(hf : is_bounded_under (≀) l (norm ∘ f)) (hg : tendsto g l (𝓝 0)) :
tendsto (Ξ» x, f x β€’ g x) l (𝓝 0) :=
hg.op_zero_is_bounded_under_le hf (flip (β€’)) (Ξ» x y, ((norm_smul y x).trans (mul_comm _ _)).le)
theorem closure_ball [normed_space ℝ E] (x : E) {r : ℝ} (hr : r β‰  0) :
closure (ball x r) = closed_ball x r :=
begin
refine subset.antisymm closure_ball_subset_closed_ball (Ξ» y hy, _),
have : continuous_within_at (Ξ» c : ℝ, c β€’ (y - x) + x) (Ico 0 1) 1 :=
((continuous_id.smul continuous_const).add continuous_const).continuous_within_at,
convert this.mem_closure _ _,
{ rw [one_smul, sub_add_cancel] },
{ simp [closure_Ico (@zero_ne_one ℝ _ _), zero_le_one] },
{ rintros c ⟨hc0, hc1⟩,
rw [mem_ball, dist_eq_norm, add_sub_cancel, norm_smul, real.norm_eq_abs,
abs_of_nonneg hc0, mul_comm, ← mul_one r],
rw [mem_closed_ball, dist_eq_norm] at hy,
replace hr : 0 < r, from ((norm_nonneg _).trans hy).lt_of_ne hr.symm,
apply mul_lt_mul'; assumption }
end
theorem frontier_ball [normed_space ℝ E] (x : E) {r : ℝ} (hr : r β‰  0) :
frontier (ball x r) = sphere x r :=
begin
rw [frontier, closure_ball x hr, is_open_ball.interior_eq],
ext x, exact (@eq_iff_le_not_lt ℝ _ _ _).symm
end
theorem interior_closed_ball [normed_space ℝ E] (x : E) {r : ℝ} (hr : r β‰  0) :
interior (closed_ball x r) = ball x r :=
begin
cases hr.lt_or_lt with hr hr,
{ rw [closed_ball_eq_empty.2 hr, ball_eq_empty.2 hr.le, interior_empty] },
refine subset.antisymm _ ball_subset_interior_closed_ball,
intros y hy,
rcases (mem_closed_ball.1 $ interior_subset hy).lt_or_eq with hr|rfl, { exact hr },
set f : ℝ β†’ E := Ξ» c : ℝ, c β€’ (y - x) + x,
suffices : f ⁻¹' closed_ball x (dist y x) βŠ† Icc (-1) 1,
{ have hfc : continuous f := (continuous_id.smul continuous_const).add continuous_const,
have hf1 : (1:ℝ) ∈ f ⁻¹' (interior (closed_ball x $ dist y x)), by simpa [f],
have h1 : (1:ℝ) ∈ interior (Icc (-1:ℝ) 1) :=
interior_mono this (preimage_interior_subset_interior_preimage hfc hf1),
contrapose h1,
simp },
intros c hc,
rw [mem_Icc, ← abs_le, ← real.norm_eq_abs, ← mul_le_mul_right hr],
simpa [f, dist_eq_norm, norm_smul] using hc
end
theorem frontier_closed_ball [normed_space ℝ E] (x : E) {r : ℝ} (hr : r β‰  0) :
frontier (closed_ball x r) = sphere x r :=
by rw [frontier, closure_closed_ball, interior_closed_ball x hr,
closed_ball_diff_ball]
/-- A (semi) normed real vector space is homeomorphic to the unit ball in the same space.
This homeomorphism sends `x : E` to `(1 + βˆ₯xβˆ₯)⁻¹ β€’ x`.
In many cases the actual implementation is not important, so we don't mark the projection lemmas
`homeomorph_unit_ball_apply_coe` and `homeomorph_unit_ball_symm_apply` as `@[simp]`. -/
@[simps { attrs := [] }]
def homeomorph_unit_ball {E : Type*} [seminormed_add_comm_group E] [normed_space ℝ E] :
E β‰ƒβ‚œ ball (0 : E) 1 :=
{ to_fun := Ξ» x, ⟨(1 + βˆ₯xβˆ₯)⁻¹ β€’ x, begin
have : βˆ₯xβˆ₯ < |1 + βˆ₯xβˆ₯| := (lt_one_add _).trans_le (le_abs_self _),
rwa [mem_ball_zero_iff, norm_smul, real.norm_eq_abs, abs_inv, ← div_eq_inv_mul,
div_lt_one ((norm_nonneg x).trans_lt this)],
end⟩,
inv_fun := Ξ» x, (1 - βˆ₯(x : E)βˆ₯)⁻¹ β€’ (x : E),
left_inv := Ξ» x,
begin
have : 0 < 1 + βˆ₯xβˆ₯ := (norm_nonneg x).trans_lt (lt_one_add _),
field_simp [this.ne', abs_of_pos this, norm_smul, smul_smul, abs_div]
end,
right_inv := Ξ» x, subtype.ext
begin
have : 0 < 1 - βˆ₯(x : E)βˆ₯ := sub_pos.2 (mem_ball_zero_iff.1 x.2),
field_simp [norm_smul, smul_smul, abs_div, abs_of_pos this, this.ne']
end,
continuous_to_fun := continuous_subtype_mk _ $
((continuous_const.add continuous_norm).invβ‚€
(Ξ» x, ((norm_nonneg x).trans_lt (lt_one_add _)).ne')).smul continuous_id,
continuous_inv_fun := continuous.smul
((continuous_const.sub continuous_subtype_coe.norm).invβ‚€ $
Ξ» x, (sub_pos.2 $ mem_ball_zero_iff.1 x.2).ne') continuous_subtype_coe }
open normed_field
instance : normed_space Ξ± (ulift E) :=
{ norm_smul_le := Ξ» s x, (normed_space.norm_smul_le s x.down : _),
..ulift.normed_add_comm_group,
..ulift.module' }
/-- The product of two normed spaces is a normed space, with the sup norm. -/
instance prod.normed_space : normed_space Ξ± (E Γ— F) :=
{ norm_smul_le := Ξ» s x, le_of_eq $ by simp [prod.norm_def, norm_smul, mul_max_of_nonneg],
..prod.normed_add_comm_group,
..prod.module }
/-- The product of finitely many normed spaces is a normed space, with the sup norm. -/
instance pi.normed_space {E : ΞΉ β†’ Type*} [fintype ΞΉ] [βˆ€i, seminormed_add_comm_group (E i)]
[βˆ€i, normed_space Ξ± (E i)] : normed_space Ξ± (Ξ i, E i) :=
{ norm_smul_le := Ξ» a f, le_of_eq $
show (↑(finset.sup finset.univ (Ξ» (b : ΞΉ), βˆ₯a β€’ f bβˆ₯β‚Š)) : ℝ) =
βˆ₯aβˆ₯β‚Š * ↑(finset.sup finset.univ (Ξ» (b : ΞΉ), βˆ₯f bβˆ₯β‚Š)),
by simp only [(nnreal.coe_mul _ _).symm, nnreal.mul_finset_sup, nnnorm_smul] }
/-- A subspace of a normed space is also a normed space, with the restriction of the norm. -/
instance submodule.normed_space {π•œ R : Type*} [has_smul π•œ R] [normed_field π•œ] [ring R]
{E : Type*} [seminormed_add_comm_group E] [normed_space π•œ E] [module R E]
[is_scalar_tower π•œ R E] (s : submodule R E) :
normed_space π•œ s :=
{ norm_smul_le := Ξ»c x, le_of_eq $ norm_smul c (x : E) }
/-- If there is a scalar `c` with `βˆ₯cβˆ₯>1`, then any element with nonzero norm can be
moved by scalar multiplication to any shell of width `βˆ₯cβˆ₯`. Also recap information on the norm of
the rescaling element that shows up in applications. -/
lemma rescale_to_shell_semi_normed {c : Ξ±} (hc : 1 < βˆ₯cβˆ₯) {Ξ΅ : ℝ} (Ξ΅pos : 0 < Ξ΅) {x : E}
(hx : βˆ₯xβˆ₯ β‰  0) : βˆƒd:Ξ±, d β‰  0 ∧ βˆ₯d β€’ xβˆ₯ < Ξ΅ ∧ (Ξ΅/βˆ₯cβˆ₯ ≀ βˆ₯d β€’ xβˆ₯) ∧ (βˆ₯dβˆ₯⁻¹ ≀ Ρ⁻¹ * βˆ₯cβˆ₯ * βˆ₯xβˆ₯) :=
begin
have xΞ΅pos : 0 < βˆ₯xβˆ₯/Ξ΅ := div_pos ((ne.symm hx).le_iff_lt.1 (norm_nonneg x)) Ξ΅pos,
rcases exists_mem_Ico_zpow xΡpos hc with ⟨n, hn⟩,
have cpos : 0 < βˆ₯cβˆ₯ := lt_trans (zero_lt_one : (0 :ℝ) < 1) hc,
have cnpos : 0 < βˆ₯c^(n+1)βˆ₯ := by { rw norm_zpow, exact lt_trans xΞ΅pos hn.2 },
refine ⟨(c^(n+1))⁻¹, _, _, _, _⟩,
show (c ^ (n + 1))⁻¹ β‰  0,
by rwa [ne.def, inv_eq_zero, ← ne.def, ← norm_pos_iff],
show βˆ₯(c ^ (n + 1))⁻¹ β€’ xβˆ₯ < Ξ΅,
{ rw [norm_smul, norm_inv, ← div_eq_inv_mul, div_lt_iff cnpos, mul_comm, norm_zpow],
exact (div_lt_iff Ξ΅pos).1 (hn.2) },
show Ξ΅ / βˆ₯cβˆ₯ ≀ βˆ₯(c ^ (n + 1))⁻¹ β€’ xβˆ₯,
{ rw [div_le_iff cpos, norm_smul, norm_inv, norm_zpow, zpow_addβ‚€ (ne_of_gt cpos),
zpow_one, mul_inv_rev, mul_comm, ← mul_assoc, ← mul_assoc, mul_inv_cancel (ne_of_gt cpos),
one_mul, ← div_eq_inv_mul, le_div_iff (zpow_pos_of_pos cpos _), mul_comm],
exact (le_div_iff Ξ΅pos).1 hn.1 },
show βˆ₯(c ^ (n + 1))⁻¹βˆ₯⁻¹ ≀ Ρ⁻¹ * βˆ₯cβˆ₯ * βˆ₯xβˆ₯,
{ have : Ρ⁻¹ * βˆ₯cβˆ₯ * βˆ₯xβˆ₯ = Ρ⁻¹ * βˆ₯xβˆ₯ * βˆ₯cβˆ₯, by ring,
rw [norm_inv, inv_inv, norm_zpow, zpow_addβ‚€ (ne_of_gt cpos), zpow_one, this, ← div_eq_inv_mul],
exact mul_le_mul_of_nonneg_right hn.1 (norm_nonneg _) }
end
end seminormed_add_comm_group
section normed_add_comm_group
variables [normed_field Ξ±]
variables {E : Type*} [normed_add_comm_group E] [normed_space Ξ± E]
variables {F : Type*} [normed_add_comm_group F] [normed_space Ξ± F]
open normed_field
/-- While this may appear identical to `normed_space.to_module`, it contains an implicit argument
involving `normed_add_comm_group.to_seminormed_add_comm_group` that typeclass inference has trouble
inferring.
Specifically, the following instance cannot be found without this `normed_space.to_module'`:
```lean
example
(π•œ ΞΉ : Type*) (E : ΞΉ β†’ Type*)
[normed_field π•œ] [Ξ  i, normed_add_comm_group (E i)] [Ξ  i, normed_space π•œ (E i)] :
Ξ  i, module π•œ (E i) := by apply_instance
```
[This Zulip thread](https://leanprover.zulipchat.com/#narrow/stream/113488-general/topic/Typeclass.20resolution.20under.20binders/near/245151099)
gives some more context. -/
@[priority 100]
instance normed_space.to_module' : module Ξ± F := normed_space.to_module
section surj
variables (E) [normed_space ℝ E] [nontrivial E]
lemma exists_norm_eq {c : ℝ} (hc : 0 ≀ c) : βˆƒ x : E, βˆ₯xβˆ₯ = c :=
begin
rcases exists_ne (0 : E) with ⟨x, hx⟩,
rw ← norm_ne_zero_iff at hx,
use c β€’ βˆ₯xβˆ₯⁻¹ β€’ x,
simp [norm_smul, real.norm_of_nonneg hc, hx]
end
@[simp] lemma range_norm : range (norm : E β†’ ℝ) = Ici 0 :=
subset.antisymm (range_subset_iff.2 norm_nonneg) (Ξ» _, exists_norm_eq E)
lemma nnnorm_surjective : surjective (nnnorm : E β†’ ℝβ‰₯0) :=
Ξ» c, (exists_norm_eq E c.coe_nonneg).imp $ Ξ» x h, nnreal.eq h
@[simp] lemma range_nnnorm : range (nnnorm : E β†’ ℝβ‰₯0) = univ :=
(nnnorm_surjective E).range_eq
end surj
theorem interior_closed_ball' [normed_space ℝ E] [nontrivial E] (x : E) (r : ℝ) :
interior (closed_ball x r) = ball x r :=
begin
rcases eq_or_ne r 0 with rfl|hr,
{ rw [closed_ball_zero, ball_zero, interior_singleton] },
{ exact interior_closed_ball x hr }
end
theorem frontier_closed_ball' [normed_space ℝ E] [nontrivial E] (x : E) (r : ℝ) :
frontier (closed_ball x r) = sphere x r :=
by rw [frontier, closure_closed_ball, interior_closed_ball' x r, closed_ball_diff_ball]
variables {Ξ±}
/-- If there is a scalar `c` with `βˆ₯cβˆ₯>1`, then any element can be moved by scalar multiplication to
any shell of width `βˆ₯cβˆ₯`. Also recap information on the norm of the rescaling element that shows
up in applications. -/
lemma rescale_to_shell {c : Ξ±} (hc : 1 < βˆ₯cβˆ₯) {Ξ΅ : ℝ} (Ξ΅pos : 0 < Ξ΅) {x : E} (hx : x β‰  0) :
βˆƒd:Ξ±, d β‰  0 ∧ βˆ₯d β€’ xβˆ₯ < Ξ΅ ∧ (Ξ΅/βˆ₯cβˆ₯ ≀ βˆ₯d β€’ xβˆ₯) ∧ (βˆ₯dβˆ₯⁻¹ ≀ Ρ⁻¹ * βˆ₯cβˆ₯ * βˆ₯xβˆ₯) :=
rescale_to_shell_semi_normed hc Ξ΅pos (ne_of_lt (norm_pos_iff.2 hx)).symm
end normed_add_comm_group
section nontrivially_normed_space
variables (π•œ E : Type*) [nontrivially_normed_field π•œ] [normed_add_comm_group E] [normed_space π•œ E]
[nontrivial E]
include π•œ
/-- If `E` is a nontrivial normed space over a nontrivially normed field `π•œ`, then `E` is unbounded:
for any `c : ℝ`, there exists a vector `x : E` with norm strictly greater than `c`. -/
lemma normed_space.exists_lt_norm (c : ℝ) : βˆƒ x : E, c < βˆ₯xβˆ₯ :=
begin
rcases exists_ne (0 : E) with ⟨x, hx⟩,
rcases normed_field.exists_lt_norm π•œ (c / βˆ₯xβˆ₯) with ⟨r, hr⟩,
use r β€’ x,
rwa [norm_smul, ← div_lt_iff],
rwa norm_pos_iff
end
protected lemma normed_space.unbounded_univ : Β¬bounded (univ : set E) :=
Ξ» h, let ⟨R, hR⟩ := bounded_iff_forall_norm_le.1 h, ⟨x, hx⟩ := normed_space.exists_lt_norm π•œ E R
in hx.not_le (hR x trivial)
/-- A normed vector space over a nontrivially normed field is a noncompact space. This cannot be
an instance because in order to apply it, Lean would have to search for `normed_space π•œ E` with
unknown `π•œ`. We register this as an instance in two cases: `π•œ = E` and `π•œ = ℝ`. -/
protected lemma normed_space.noncompact_space : noncompact_space E :=
⟨λ h, normed_space.unbounded_univ π•œ _ h.bounded⟩
@[priority 100]
instance nontrivially_normed_field.noncompact_space : noncompact_space π•œ :=
normed_space.noncompact_space π•œ π•œ
omit π•œ
@[priority 100]
instance real_normed_space.noncompact_space [normed_space ℝ E] : noncompact_space E :=
normed_space.noncompact_space ℝ E
end nontrivially_normed_space
section normed_algebra
/-- A normed algebra `π•œ'` over `π•œ` is normed module that is also an algebra.
See the implementation notes for `algebra` for a discussion about non-unital algebras. Following
the strategy there, a non-unital *normed* algebra can be written as:
```lean
variables [normed_field π•œ] [non_unital_semi_normed_ring π•œ']
variables [normed_module π•œ π•œ'] [smul_comm_class π•œ π•œ' π•œ'] [is_scalar_tower π•œ π•œ' π•œ']
```
-/
class normed_algebra (π•œ : Type*) (π•œ' : Type*) [normed_field π•œ] [semi_normed_ring π•œ']
extends algebra π•œ π•œ' :=
(norm_smul_le : βˆ€ (r : π•œ) (x : π•œ'), βˆ₯r β€’ xβˆ₯ ≀ βˆ₯rβˆ₯ * βˆ₯xβˆ₯)
variables {π•œ : Type*} (π•œ' : Type*) [normed_field π•œ] [semi_normed_ring π•œ'] [normed_algebra π•œ π•œ']
@[priority 100]
instance normed_algebra.to_normed_space : normed_space π•œ π•œ' :=
{ norm_smul_le := normed_algebra.norm_smul_le }
/-- While this may appear identical to `normed_algebra.to_normed_space`, it contains an implicit
argument involving `normed_ring.to_semi_normed_ring` that typeclass inference has trouble inferring.
Specifically, the following instance cannot be found without this `normed_space.to_module'`:
```lean
example
(π•œ ΞΉ : Type*) (E : ΞΉ β†’ Type*)
[normed_field π•œ] [Ξ  i, normed_ring (E i)] [Ξ  i, normed_algebra π•œ (E i)] :
Ξ  i, module π•œ (E i) := by apply_instance
```
See `normed_space.to_module'` for a similar situation. -/
@[priority 100]
instance normed_algebra.to_normed_space' {π•œ'} [normed_ring π•œ'] [normed_algebra π•œ π•œ'] :
normed_space π•œ π•œ' := by apply_instance
lemma norm_algebra_map (x : π•œ) : βˆ₯algebra_map π•œ π•œ' xβˆ₯ = βˆ₯xβˆ₯ * βˆ₯(1 : π•œ')βˆ₯ :=
begin
rw algebra.algebra_map_eq_smul_one,
exact norm_smul _ _,
end
lemma nnnorm_algebra_map (x : π•œ) : βˆ₯algebra_map π•œ π•œ' xβˆ₯β‚Š = βˆ₯xβˆ₯β‚Š * βˆ₯(1 : π•œ')βˆ₯β‚Š :=
subtype.ext $ norm_algebra_map π•œ' x
@[simp] lemma norm_algebra_map' [norm_one_class π•œ'] (x : π•œ) : βˆ₯algebra_map π•œ π•œ' xβˆ₯ = βˆ₯xβˆ₯ :=
by rw [norm_algebra_map, norm_one, mul_one]
@[simp] lemma nnnorm_algebra_map' [norm_one_class π•œ'] (x : π•œ) : βˆ₯algebra_map π•œ π•œ' xβˆ₯β‚Š = βˆ₯xβˆ₯β‚Š :=
subtype.ext $ norm_algebra_map' _ _
variables (π•œ π•œ')
/-- In a normed algebra, the inclusion of the base field in the extended field is an isometry. -/
lemma algebra_map_isometry [norm_one_class π•œ'] : isometry (algebra_map π•œ π•œ') :=
begin
refine isometry.of_dist_eq (Ξ»x y, _),
rw [dist_eq_norm, dist_eq_norm, ← ring_hom.map_sub, norm_algebra_map'],
end
/-- The inclusion of the base field in a normed algebra as a continuous linear map. -/
@[simps]
def algebra_map_clm : π•œ β†’L[π•œ] π•œ' :=
{ to_fun := algebra_map π•œ π•œ',
map_add' := (algebra_map π•œ π•œ').map_add,
map_smul' := Ξ» r x, by rw [algebra.id.smul_eq_mul, map_mul, ring_hom.id_apply, algebra.smul_def],
cont :=
have lipschitz_with βˆ₯(1 : π•œ')βˆ₯β‚Š (algebra_map π•œ π•œ') := Ξ» x y, begin
rw [edist_eq_coe_nnnorm_sub, edist_eq_coe_nnnorm_sub, ←map_sub, ←ennreal.coe_mul,
ennreal.coe_le_coe, mul_comm],
exact (nnnorm_algebra_map _ _).le,
end, this.continuous }
lemma algebra_map_clm_coe :
(algebra_map_clm π•œ π•œ' : π•œ β†’ π•œ') = (algebra_map π•œ π•œ' : π•œ β†’ π•œ') := rfl
lemma algebra_map_clm_to_linear_map :
(algebra_map_clm π•œ π•œ').to_linear_map = algebra.linear_map π•œ π•œ' := rfl
instance normed_algebra.id : normed_algebra π•œ π•œ :=
{ .. normed_field.to_normed_space,
.. algebra.id π•œ}
/-- Any normed characteristic-zero division ring that is a normed_algebra over the reals is also a
normed algebra over the rationals.
Phrased another way, if `π•œ` is a normed algebra over the reals, then `algebra_rat` respects that
norm. -/
instance normed_algebra_rat {π•œ} [normed_division_ring π•œ] [char_zero π•œ] [normed_algebra ℝ π•œ] :
normed_algebra β„š π•œ :=
{ norm_smul_le := Ξ» q x,
by rw [←smul_one_smul ℝ q x, rat.smul_one_eq_coe, norm_smul, rat.norm_cast_real], }
instance punit.normed_algebra : normed_algebra π•œ punit :=
{ norm_smul_le := Ξ» q x, by simp only [punit.norm_eq_zero, mul_zero] }
instance : normed_algebra π•œ (ulift π•œ') :=
{ ..ulift.normed_space }
/-- The product of two normed algebras is a normed algebra, with the sup norm. -/
instance prod.normed_algebra {E F : Type*} [semi_normed_ring E] [semi_normed_ring F]
[normed_algebra π•œ E] [normed_algebra π•œ F] :
normed_algebra π•œ (E Γ— F) :=
{ ..prod.normed_space }
/-- The product of finitely many normed algebras is a normed algebra, with the sup norm. -/
instance pi.normed_algebra {E : ΞΉ β†’ Type*} [fintype ΞΉ]
[Ξ  i, semi_normed_ring (E i)] [Ξ  i, normed_algebra π•œ (E i)] :
normed_algebra π•œ (Ξ  i, E i) :=
{ .. pi.normed_space,
.. pi.algebra _ E }
end normed_algebra
section restrict_scalars
variables (π•œ : Type*) (π•œ' : Type*) [normed_field π•œ] [normed_field π•œ'] [normed_algebra π•œ π•œ']
(E : Type*) [seminormed_add_comm_group E] [normed_space π•œ' E]
instance {π•œ : Type*} {π•œ' : Type*} {E : Type*} [I : seminormed_add_comm_group E] :
seminormed_add_comm_group (restrict_scalars π•œ π•œ' E) := I
instance {π•œ : Type*} {π•œ' : Type*} {E : Type*} [I : normed_add_comm_group E] :
normed_add_comm_group (restrict_scalars π•œ π•œ' E) := I
/-- If `E` is a normed space over `π•œ'` and `π•œ` is a normed algebra over `π•œ'`, then
`restrict_scalars.module` is additionally a `normed_space`. -/
instance : normed_space π•œ (restrict_scalars π•œ π•œ' E) :=
{ norm_smul_le := Ξ» c x, (normed_space.norm_smul_le (algebra_map π•œ π•œ' c) (_ : E)).trans_eq $
by rw norm_algebra_map',
..restrict_scalars.module π•œ π•œ' E }
/--
The action of the original normed_field on `restrict_scalars π•œ π•œ' E`.
This is not an instance as it would be contrary to the purpose of `restrict_scalars`.
-/
-- If you think you need this, consider instead reproducing `restrict_scalars.lsmul`
-- appropriately modified here.
def module.restrict_scalars.normed_space_orig {π•œ : Type*} {π•œ' : Type*} {E : Type*}
[normed_field π•œ'] [seminormed_add_comm_group E] [I : normed_space π•œ' E] :
normed_space π•œ' (restrict_scalars π•œ π•œ' E) := I
/-- Warning: This declaration should be used judiciously.
Please consider using `is_scalar_tower` and/or `restrict_scalars π•œ π•œ' E` instead.
This definition allows the `restrict_scalars.normed_space` instance to be put directly on `E`
rather on `restrict_scalars π•œ π•œ' E`. This would be a very bad instance; both because `π•œ'` cannot be
inferred, and because it is likely to create instance diamonds.
-/
def normed_space.restrict_scalars : normed_space π•œ E :=
restrict_scalars.normed_space _ π•œ' _
end restrict_scalars