@@ -258,7 +258,7 @@ section nnnorm
258
258
/-- Version of the norm taking values in nonnegative reals. -/
259
259
def nnnorm (a : α) : ℝ≥0 := ⟨norm a, norm_nonneg a⟩
260
260
261
- @[simp] lemma coe_nnnorm (a : α) : (nnnorm a : ℝ) = norm a := rfl
261
+ @[simp, norm_cast ] lemma coe_nnnorm (a : α) : (nnnorm a : ℝ) = norm a := rfl
262
262
263
263
lemma nndist_eq_nnnorm (a b : α) : nndist a b = nnnorm (a - b) := nnreal.eq $ dist_eq_norm _ _
264
264
@@ -286,6 +286,9 @@ by rw [edist_dist, dist_eq_norm, of_real_norm_eq_coe_nnnorm]
286
286
lemma edist_eq_coe_nnnorm (x : β) : edist x 0 = (nnnorm x : ennreal) :=
287
287
by rw [edist_eq_coe_nnnorm_sub, _root_.sub_zero]
288
288
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
+
289
292
lemma nndist_add_add_le (g₁ g₂ h₁ h₂ : α) :
290
293
nndist (g₁ + g₂) (h₁ + h₂) ≤ nndist g₁ h₁ + nndist g₂ h₂ :=
291
294
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 α :=
661
664
⟨mul_left_cancel' (mt norm_eq_zero.1 (@one_ne_zero α _ _)) $
662
665
by rw [← norm_mul, mul_one, mul_one]⟩
663
666
667
+ @[simp] lemma nnnorm_mul (a b : α) : nnnorm (a * b) = nnnorm a * nnnorm b :=
668
+ nnreal.eq $ norm_mul a b
669
+
664
670
/-- `norm` as a `monoid_hom`. -/
665
671
@[simps] def norm_hom : monoid_with_zero_hom α ℝ := ⟨norm, norm_zero, norm_one, norm_mul⟩
666
672
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
+
667
677
@[simp] lemma norm_pow (a : α) : ∀ (n : ℕ), ∥a ^ n∥ = ∥a∥ ^ n :=
668
678
norm_hom.to_monoid_hom.map_pow a
669
679
680
+ @[simp] lemma nnnorm_pow (a : α) (n : ℕ) : nnnorm (a ^ n) = nnnorm a ^ n :=
681
+ nnnorm_hom.to_monoid_hom.map_pow a n
682
+
670
683
@[simp] lemma norm_prod (s : finset β) (f : β → α) :
671
684
∥∏ b in s, f b∥ = ∏ b in s, ∥f b∥ :=
672
685
(norm_hom.to_monoid_hom : α →* ℝ).map_prod f s
673
686
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
+
674
691
@[simp] lemma norm_div (a b : α) : ∥a / b∥ = ∥a∥ / ∥b∥ :=
675
692
(norm_hom : monoid_with_zero_hom α ℝ).map_div a b
676
693
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
+
677
697
@[simp] lemma norm_inv (a : α) : ∥a⁻¹∥ = ∥a∥⁻¹ :=
678
698
(norm_hom : monoid_with_zero_hom α ℝ).map_inv' a
679
699
@@ -683,24 +703,25 @@ nnreal.eq $ by simp
683
703
@[simp] lemma norm_fpow : ∀ (a : α) (n : ℤ), ∥a^n∥ = ∥a∥^n :=
684
704
(norm_hom : monoid_with_zero_hom α ℝ).map_fpow
685
705
706
+ @[simp] lemma nnnorm_fpow : ∀ (a : α) (n : ℤ), nnnorm (a^n) = (nnnorm a)^n :=
707
+ (nnnorm_hom : monoid_with_zero_hom α ℝ≥0 ).map_fpow
708
+
686
709
@[priority 100 ] -- see Note [lower instance priority]
687
710
instance : has_continuous_inv' α :=
688
711
begin
689
712
refine ⟨λ r r0, tendsto_iff_norm_tendsto_zero.2 _⟩,
690
713
have r0' : 0 < ∥r∥ := norm_pos_iff.2 r0,
691
714
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∥ / ε ,
693
716
{ filter_upwards [(is_open_lt continuous_const continuous_norm).eventually_mem εr],
694
717
intros e he,
695
718
have e0 : e ≠ 0 := norm_pos_iff.1 (ε0 .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 },
701
722
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
704
725
end
705
726
706
727
end normed_field
0 commit comments