Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 958c407

Browse files
committed
chore(analysis/normed_space/basic): a few lemmas about nnnorm (#5532)
1 parent b15bb06 commit 958c407

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

src/analysis/normed_space/basic.lean

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ section nnnorm
258258
/-- Version of the norm taking values in nonnegative reals. -/
259259
def nnnorm (a : α) : ℝ≥0 := ⟨norm a, norm_nonneg a⟩
260260

261-
@[simp] lemma coe_nnnorm (a : α) : (nnnorm a : ℝ) = norm a := rfl
261+
@[simp, norm_cast] lemma coe_nnnorm (a : α) : (nnnorm a : ℝ) = norm a := rfl
262262

263263
lemma nndist_eq_nnnorm (a b : α) : nndist a b = nnnorm (a - b) := nnreal.eq $ dist_eq_norm _ _
264264

@@ -286,6 +286,9 @@ by rw [edist_dist, dist_eq_norm, of_real_norm_eq_coe_nnnorm]
286286
lemma edist_eq_coe_nnnorm (x : β) : edist x 0 = (nnnorm x : ennreal) :=
287287
by rw [edist_eq_coe_nnnorm_sub, _root_.sub_zero]
288288

289+
lemma mem_emetric_ball_0_iff {x : β} {r : ennreal} : x ∈ emetric.ball (0 : β) r ↔ ↑(nnnorm x) < r :=
290+
by rw [emetric.mem_ball, edist_eq_coe_nnnorm]
291+
289292
lemma nndist_add_add_le (g₁ g₂ h₁ h₂ : α) :
290293
nndist (g₁ + g₂) (h₁ + h₂) ≤ nndist g₁ h₁ + nndist g₂ h₂ :=
291294
nnreal.coe_le_coe.2 $ dist_add_add_le g₁ g₂ h₁ h₂
@@ -661,19 +664,36 @@ instance to_norm_one_class : norm_one_class α :=
661664
⟨mul_left_cancel' (mt norm_eq_zero.1 (@one_ne_zero α _ _)) $
662665
by rw [← norm_mul, mul_one, mul_one]⟩
663666

667+
@[simp] lemma nnnorm_mul (a b : α) : nnnorm (a * b) = nnnorm a * nnnorm b :=
668+
nnreal.eq $ norm_mul a b
669+
664670
/-- `norm` as a `monoid_hom`. -/
665671
@[simps] def norm_hom : monoid_with_zero_hom α ℝ := ⟨norm, norm_zero, norm_one, norm_mul⟩
666672

673+
/-- `nnnorm` as a `monoid_hom`. -/
674+
@[simps] def nnnorm_hom : monoid_with_zero_hom α ℝ≥0 :=
675+
⟨nnnorm, nnnorm_zero, nnnorm_one, nnnorm_mul⟩
676+
667677
@[simp] lemma norm_pow (a : α) : ∀ (n : ℕ), ∥a ^ n∥ = ∥a∥ ^ n :=
668678
norm_hom.to_monoid_hom.map_pow a
669679

680+
@[simp] lemma nnnorm_pow (a : α) (n : ℕ) : nnnorm (a ^ n) = nnnorm a ^ n :=
681+
nnnorm_hom.to_monoid_hom.map_pow a n
682+
670683
@[simp] lemma norm_prod (s : finset β) (f : β → α) :
671684
∥∏ b in s, f b∥ = ∏ b in s, ∥f b∥ :=
672685
(norm_hom.to_monoid_hom : α →* ℝ).map_prod f s
673686

687+
@[simp] lemma nnnorm_prod (s : finset β) (f : β → α) :
688+
nnnorm (∏ b in s, f b) = ∏ b in s, nnnorm (f b) :=
689+
(nnnorm_hom.to_monoid_hom : α →* ℝ≥0).map_prod f s
690+
674691
@[simp] lemma norm_div (a b : α) : ∥a / b∥ = ∥a∥ / ∥b∥ :=
675692
(norm_hom : monoid_with_zero_hom α ℝ).map_div a b
676693

694+
@[simp] lemma nnnorm_div (a b : α) : nnnorm (a / b) = nnnorm a / nnnorm b :=
695+
(nnnorm_hom : monoid_with_zero_hom α ℝ≥0).map_div a b
696+
677697
@[simp] lemma norm_inv (a : α) : ∥a⁻¹∥ = ∥a∥⁻¹ :=
678698
(norm_hom : monoid_with_zero_hom α ℝ).map_inv' a
679699

@@ -683,24 +703,25 @@ nnreal.eq $ by simp
683703
@[simp] lemma norm_fpow : ∀ (a : α) (n : ℤ), ∥a^n∥ = ∥a∥^n :=
684704
(norm_hom : monoid_with_zero_hom α ℝ).map_fpow
685705

706+
@[simp] lemma nnnorm_fpow : ∀ (a : α) (n : ℤ), nnnorm (a^n) = (nnnorm a)^n :=
707+
(nnnorm_hom : monoid_with_zero_hom α ℝ≥0).map_fpow
708+
686709
@[priority 100] -- see Note [lower instance priority]
687710
instance : has_continuous_inv' α :=
688711
begin
689712
refine ⟨λ r r0, tendsto_iff_norm_tendsto_zero.2 _⟩,
690713
have r0' : 0 < ∥r∥ := norm_pos_iff.2 r0,
691714
rcases exists_between r0' with ⟨ε, ε0, εr⟩,
692-
have : ∀ᶠ e in 𝓝 r, ∥e⁻¹ - r⁻¹∥ ≤ ∥r - e∥ / (∥r∥ * ε),
715+
have : ∀ᶠ e in 𝓝 r, ∥e⁻¹ - r⁻¹∥ ≤ ∥r - e∥ / ∥r∥ / ε,
693716
{ filter_upwards [(is_open_lt continuous_const continuous_norm).eventually_mem εr],
694717
intros e he,
695718
have e0 : e ≠ 0 := norm_pos_iff.10.trans he),
696-
calc ∥e⁻¹ - r⁻¹∥ = ∥r - e∥ / (∥r∥ * ∥e∥) :
697-
by simp only [← norm_div, ← norm_mul, sub_div, div_mul_right _ r0, div_mul_left e0, one_div]
698-
... ≤ ∥r - e∥ / (∥r∥ * ε) :
699-
div_le_div_of_le_left (norm_nonneg _) (mul_pos r0' ε0)
700-
(mul_le_mul_of_nonneg_left he.le r0'.le) },
719+
calc ∥e⁻¹ - r⁻¹∥ = ∥r - e∥ / ∥r∥ / ∥e∥ : by field_simp [mul_comm]
720+
... ≤ ∥r - e∥ / ∥r∥ / ε :
721+
div_le_div_of_le_left (div_nonneg (norm_nonneg _) (norm_nonneg _)) ε0 he.le },
701722
refine squeeze_zero' (eventually_of_forall $ λ _, norm_nonneg _) this _,
702-
rw [← zero_div (∥r∥ * ε), ← @norm_zero α, ← sub_self r],
703-
exact tendsto.mul (tendsto_const_nhds.sub tendsto_id).norm tendsto_const_nhds
723+
refine (continuous_const.sub continuous_id).norm.div_const.div_const.tendsto' _ _ _,
724+
simp
704725
end
705726

706727
end normed_field

0 commit comments

Comments
 (0)