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

Commit df08058

Browse files
committed
refactor(analysis/normed_space): rename norm_mul -> norm_mul_le; use norm_mul for the equality in normed fields; and norm_mul_le for the inequality in normed_rings
1 parent bd21b0e commit df08058

File tree

4 files changed

+31
-21
lines changed

4 files changed

+31
-21
lines changed

src/analysis/asymptotics.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -696,11 +696,11 @@ have eq₂ : is_o (λ x, f x / g x * g x) g l,
696696
have eq₃ : is_O f (λ x, f x / g x * g x) l,
697697
begin
698698
use [1, zero_lt_one],
699-
filter_upwards [univ_mem_sets], simp,
700-
intro x,
701-
cases classical.em (∥g x = 0) with h' h',
702-
{ rw hgf _ ((norm_eq_zero _).mp h'), simp },
703-
rw [normed_field.norm_mul, norm_div, div_mul_cancel _ h']
699+
refine filter.univ_mem_sets' (assume x, _),
700+
suffices : ∥f x∥ ≤ ∥f x∥ / ∥g x∥ * ∥g x∥, { simpa },
701+
by_cases g x = 0,
702+
{ simp only [h, hgf x h, norm_zero, mul_zero] },
703+
{ rw [div_mul_cancel], exact mt (norm_eq_zero _).1 h }
704704
end,
705705
eq₃.trans_is_o eq₂
706706

src/analysis/normed_space/basic.lean

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -208,22 +208,23 @@ class normed_ring (α : Type*) extends has_norm α, ring α, metric_space α :=
208208

209209
instance normed_ring.to_normed_group [β : normed_ring α] : normed_group α := { ..β }
210210

211-
lemma norm_mul {α : Type*} [normed_ring α] (a b : α) : (∥a*b∥) ≤ (∥a∥) * (∥b∥) :=
211+
lemma norm_mul_le {α : Type*} [normed_ring α] (a b : α) : (∥a*b∥) ≤ (∥a∥) * (∥b∥) :=
212212
normed_ring.norm_mul _ _
213213

214-
lemma norm_pow {α : Type*} [normed_ring α] (a : α) : ∀ {n : ℕ}, n > 0 → ∥a^n∥ ≤ ∥a∥^n
214+
lemma norm_pow_le {α : Type*} [normed_ring α] (a : α) : ∀ {n : ℕ}, n > 0 → ∥a^n∥ ≤ ∥a∥^n
215215
| 1 h := by simp
216216
| (n+2) h :=
217-
le_trans (norm_mul a (a^(n+1)))
217+
le_trans (norm_mul_le a (a^(n+1)))
218218
(mul_le_mul (le_refl _)
219-
(norm_pow (nat.succ_pos _)) (norm_nonneg _) (norm_nonneg _))
219+
(norm_pow_le (nat.succ_pos _)) (norm_nonneg _) (norm_nonneg _))
220220

221221
instance prod.normed_ring [normed_ring α] [normed_ring β] : normed_ring (α × β) :=
222222
{ norm_mul := assume x y,
223223
calc
224224
∥x * y∥ = ∥(x.1*y.1, x.2*y.2)∥ : rfl
225225
... = (max ∥x.1*y.1∥ ∥x.2*y.2∥) : rfl
226-
... ≤ (max (∥x.1∥*∥y.1∥) (∥x.2∥*∥y.2∥)) : max_le_max (norm_mul (x.1) (y.1)) (norm_mul (x.2) (y.2))
226+
... ≤ (max (∥x.1∥*∥y.1∥) (∥x.2∥*∥y.2∥)) :
227+
max_le_max (norm_mul_le (x.1) (y.1)) (norm_mul_le (x.2) (y.2))
227228
... = (max (∥x.1∥*∥y.1∥) (∥y.2∥*∥x.2∥)) : by simp[mul_comm]
228229
... ≤ (max (∥x.1∥) (∥x.2∥)) * (max (∥y.2∥) (∥y.1∥)) : by { apply max_mul_mul_le_max_mul_max; simp [norm_nonneg] }
229230
... = (max (∥x.1∥) (∥x.2∥)) * (max (∥y.1∥) (∥y.2∥)) : by simp[max_comm]
@@ -243,7 +244,7 @@ instance normed_ring_top_monoid [normed_ring α] : topological_monoid α :=
243244
{ apply squeeze_zero,
244245
{ intro, apply norm_nonneg },
245246
{ intro t, show ∥t.fst * t.snd - t.fst * x.snd∥ ≤ ∥t.fst∥ * ∥t.snd - x.snd∥,
246-
rw ←mul_sub, apply norm_mul },
247+
rw ←mul_sub, apply norm_mul_le },
247248
{ rw ←mul_zero (∥x.fst∥), apply tendsto_mul,
248249
{ apply continuous_iff_continuous_at.1,
249250
apply continuous.comp,
@@ -255,7 +256,7 @@ instance normed_ring_top_monoid [normed_ring α] : topological_monoid α :=
255256
{ apply squeeze_zero,
256257
{ intro, apply norm_nonneg },
257258
{ intro t, show ∥t.fst * x.snd - x.fst * x.snd∥ ≤ ∥t.fst - x.fst∥ * ∥x.snd∥,
258-
rw ←sub_mul, apply norm_mul },
259+
rw ←sub_mul, apply norm_mul_le },
259260
{ rw ←zero_mul (∥x.snd∥), apply tendsto_mul,
260261
{ apply tendsto_iff_norm_tendsto_zero.1,
261262
apply continuous_iff_continuous_at.1,
@@ -283,6 +284,19 @@ have ∥(1 : α)∥ * ∥(1 : α)∥ = ∥(1 : α)∥ * 1, by calc
283284
... = ∥(1 : α)∥ * 1 : by simp,
284285
eq_of_mul_eq_mul_left (ne_of_gt ((norm_pos_iff _).2 (by simp))) this
285286

287+
@[simp] lemma norm_mul [normed_field α] (a b : α) : ∥a * b∥ = ∥a∥ * ∥b∥ :=
288+
normed_field.norm_mul a b
289+
290+
instance normed_field.is_monoid_hom_norm [normed_field α] : is_monoid_hom (norm : α → ℝ) :=
291+
⟨norm_one, norm_mul⟩
292+
293+
@[simp] lemma norm_pow [normed_field α] (a : α) : ∀ (n : ℕ), ∥a^n∥ = ∥a∥^n :=
294+
is_monoid_hom.map_pow norm a
295+
296+
@[simp] lemma norm_prod {β : Type*} [normed_field α] (s : finset β) (f : β → α) :
297+
∥s.prod f∥ = s.prod (λb, ∥f b∥) :=
298+
eq.symm (finset.prod_hom norm)
299+
286300
@[simp] lemma norm_div {α : Type*} [normed_field α] (a b : α) : ∥a/b∥ = ∥a∥/∥b∥ :=
287301
if hb : b = 0 then by simp [hb] else
288302
begin
@@ -294,14 +308,6 @@ end
294308
@[simp] lemma norm_inv {α : Type*} [normed_field α] (a : α) : ∥a⁻¹∥ = ∥a∥⁻¹ :=
295309
by simp only [inv_eq_one_div, norm_div, norm_one]
296310

297-
@[simp] lemma normed_field.norm_pow {α : Type*} [normed_field α] (a : α) :
298-
∀ n : ℕ, ∥a^n∥ = ∥a∥^n
299-
| 0 := by simp
300-
| (k+1) := calc
301-
∥a ^ (k + 1)∥ = ∥a*(a^k)∥ : rfl
302-
... = ∥a∥*∥a^k∥ : by rw normed_field.norm_mul
303-
... = ∥a∥ ^ (k + 1) : by rw normed_field.norm_pow; simp [pow, monoid.pow]
304-
305311
instance : normed_field ℝ :=
306312
{ norm := λ x, abs x,
307313
dist_eq := assume x y, rfl,

src/data/complex/basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,10 @@ by simp [abs, norm_sq_of_real, real.sqrt_mul_self_eq_abs]
317317
lemma abs_of_nonneg {r : ℝ} (h : 0 ≤ r) : abs r = r :=
318318
(abs_of_real _).trans (abs_of_nonneg h)
319319

320+
@[simp] lemma abs_of_nat (n : ℕ) : complex.abs n = n :=
321+
calc complex.abs n = complex.abs (n:ℝ) : by rw [of_real_nat_cast]
322+
... = _ : abs_of_nonneg (nat.cast_nonneg n)
323+
320324
lemma mul_self_abs (z : ℂ) : abs z * abs z = norm_sq z :=
321325
real.mul_self_sqrt (norm_sq_nonneg _)
322326

src/data/padics/padic_integers.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ instance : has_norm ℤ_[p] := ⟨padic_norm_z⟩
9999

100100
instance : normed_ring ℤ_[p] :=
101101
{ dist_eq := λ ⟨_, _⟩ ⟨_, _⟩, rfl,
102-
norm_mul := λ ⟨_, _⟩ ⟨_, _⟩, norm_mul _ _ }
102+
norm_mul := λ ⟨_, _⟩ ⟨_, _⟩, norm_mul_le _ _ }
103103

104104
instance padic_norm_z.is_absolute_value : is_absolute_value (λ z : ℤ_[p], ∥z∥) :=
105105
{ abv_nonneg := norm_nonneg,

0 commit comments

Comments
 (0)