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

Commit 3f655f5

Browse files
urkuderic-wieser
andcommitted
refactor(data/is_R_or_C,analysis/inner_product_space): review API (#18919)
## Drop `is_R_or_C.abs` and lemmas about it Use `has_norm.norm` instead. The norm is definitionally equal both to `real.abs` and `complex.abs`, so it's easier to specialize generic theorems to real numbers. Also, we don't have to convert between norm and `is_R_or_C.abs` here and there. - Drop `is_R_or_C.abs`, `is_R_or_C.norm_eq_abs`, `is_R_or_C.abs_of_nonneg`, `is_R_or_C.abs_zero`, `is_R_or_C.abs_one`, `is_R_or_C.abs_nonneg`, `is_R_or_C.abs_eq_zero`, `is_R_or_C.abs_ne_zero`, `is_R_or_C.abs_mul`, `is_R_or_C.abs_add`, `is_R_or_C.is_absolute_value`, `is_R_or_C.abs_abs`, `is_R_or_C.abs_pos`, `is_R_or_C.abs_neg`, `is_R_or_C.abs_inv`, `is_R_or_C.abs_div`, `is_R_or_C.abs_abs_sub_le_abs_sub`, `is_R_or_C.norm_sq_eq_abs`, `is_R_or_C.abs_to_real`, `is_R_or_C.continuous_abs`, `is_R_or_C.abs_to_complex`, `inner_product_space.core.abs_inner_symm`, `abs_inner_le_norm`. ## Rename/merge lemmas ### `is_R_or_C` - Rename `is_R_or_C.of_real_smul` to `is_R_or_C.real_smul_of_real`. - Merge `is_R_or_C.norm_real`, `is_R_or_C.norm_of_real`, and `is_R_or_C.abs_of_real` into `is_R_or_C.norm_of_real`. - Merge `is_R_or_C.abs_of_nat` and `is_R_or_C.abs_cast_nat` into `is_R_or_C.norm_nat_cast`, use `has_norm.norm`, make it a `simp, priority 900, is_R_or_C_simps, norm_cast` lemma. - Rename `is_R_or_C.mul_self_abs` to `is_R_or_C.mul_self_norm`, use `has_norm.norm`. - Rename `is_R_or_C.abs_two` to `is_R_or_C.norm_two`, use `has_norm.norm`. - Rename `is_R_or_C.abs_conj` to `is_R_or_C.norm_conj`, use `has_norm.norm`. - Rename `is_R_or_C.abs_re_le_abs` to `is_R_or_C.abs_re_le_norm`, use `has_norm.norm`. - Rename `is_R_or_C.abs_im_le_abs` to `is_R_or_C.abs_im_le_norm`, use `has_norm.norm`. - Rename `is_R_or_C.re_le_abs` and `is_R_or_C.im_le_abs` to `is_R_or_C.re_le_norm` and `is_R_or_C.im_le_norm`, respectively; use `has_norm.norm`. - Use `has_norm.norm` in `is_R_or_C.im_eq_zero_of_le` and `is_R_or_C.re_eq_self_of_le`. - Rename `is_R_or_C.abs_re_div_abs_le_one` and `is_R_or_C.abs_im_div_abs_le_one` to `is_R_or_C.abs_re_div_norm_le_one` and `is_R_or_C.abs_im_div_norm_le_one`, respectively; use `has_norm.norm`. - Rename `is_R_or_C.re_eq_abs_of_mul_conj` to `is_R_or_C.re_eq_norm_of_mul_conj`, use `has_norm.norm`. - Rename `is_R_or_C.abs_sq_re_add_conj` and `is_R_or_C.abs_sq_re_add_conj'` to `is_R_or_C.norm_sq_re_add_conj` and `is_R_or_C.norm_sq_re_conj_add`, respectively; use `has_norm.norm`. - Use `has_norm.norm` in all lemmas/definitions about `is_cau_seq` and `cau_seq` sequences of `is_R_or_C` numbers. - Rename `is_R_or_C.is_cau_seq_abs` to `is_R_or_C.is_cau_seq_norm`, use `has_norm.norm`. ### Inner products - Rename `inner_product_space.core.inner_mul_conj_re_abs` to `inner_product_space.core.inner_mul_symm_re_eq_norm`, use `has_norm.norm`. - Do the same in the root NS. - Rename `inner_self_re_abs` to `inner_self_re_eq_norm`, use `has_norm.norm`. - Rename `inner_self_abs_to_K` to `inner_self_norm_to_K`, use `has_norm.norm`. - Rename `abs_inner_symm` to `norm_inner_symm`, use `has_norm.norm`. - Rename `abs_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul` to `norm_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul`, use `has_norm.norm`. ## Add lemmas - Add `is_R_or_C.is_real_tfae` and `is_real_tfae.conj_eq_iff_im`. - Add `is_R_or_C.norm_sq_apply`. ## Change attributes - `is_R_or_C.zero_re'` is no longer a `simp` lemma - `is_R_or_C.norm_conj` is now a `simp` lemma. ## Misc - Reorder lemmas here and there to golf. Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
1 parent b1c0175 commit 3f655f5

16 files changed

Lines changed: 197 additions & 328 deletions

File tree

docs/100.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@
315315
title : The Cauchy-Schwarz Inequality
316316
decls :
317317
- inner_mul_inner_self_le
318-
- abs_inner_le_norm
318+
- norm_inner_le_norm
319319
author : Zhouhang Zhou
320320
79:
321321
title : The Intermediate Value Theorem

src/analysis/calculus/uniform_limits_deriv.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ begin
349349
-- * The `f' n` converge to `g'` at `x`
350350
conv
351351
{ congr, funext,
352-
rw [←norm_norm, ←norm_inv,←@is_R_or_C.norm_of_real 𝕜 _ _,
353-
is_R_or_C.of_real_inv, ←norm_smul], },
352+
rw [← abs_norm, ← abs_inv, ← @is_R_or_C.norm_of_real 𝕜 _ _,
353+
is_R_or_C.of_real_inv, ← norm_smul], },
354354
rw ←tendsto_zero_iff_norm_tendsto_zero,
355355
have : (λ a : ι × E, (‖a.2 - x‖⁻¹ : 𝕜) • (g a.2 - g x - (g' x) (a.2 - x))) =
356356
(λ a : ι × E, (‖a.2 - x‖⁻¹ : 𝕜) • (g a.2 - g x - (f a.1 a.2 - f a.1 x))) +

src/analysis/complex/basic.lean

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ section complex_order
321321
open_locale complex_order
322322

323323
lemma eq_coe_norm_of_nonneg {z : ℂ} (hz : 0 ≤ z) : z = ↑‖z‖ :=
324-
by rw [eq_re_of_real_le hz, is_R_or_C.norm_of_real, real.norm_of_nonneg (complex.le_def.2 hz).1]
324+
by rw [eq_re_of_real_le hz, is_R_or_C.norm_of_real, _root_.abs_of_nonneg (complex.le_def.2 hz).1]
325325

326326
end complex_order
327327

@@ -334,16 +334,12 @@ open_locale complex_conjugate
334334
local notation `reC` := @is_R_or_C.re ℂ _
335335
local notation `imC` := @is_R_or_C.im ℂ _
336336
local notation `IC` := @is_R_or_C.I ℂ _
337-
local notation `absC` := @is_R_or_C.abs ℂ _
338337
local notation `norm_sqC` := @is_R_or_C.norm_sq ℂ _
339338

340339
@[simp] lemma re_to_complex {x : ℂ} : reC x = x.re := rfl
341340
@[simp] lemma im_to_complex {x : ℂ} : imC x = x.im := rfl
342341
@[simp] lemma I_to_complex : IC = complex.I := rfl
343-
@[simp] lemma norm_sq_to_complex {x : ℂ} : norm_sqC x = complex.norm_sq x :=
344-
by simp [is_R_or_C.norm_sq, complex.norm_sq]
345-
@[simp] lemma abs_to_complex {x : ℂ} : absC x = complex.abs x :=
346-
by simp [is_R_or_C.abs, complex.abs]
342+
@[simp] lemma norm_sq_to_complex {x : ℂ} : norm_sqC x = complex.norm_sq x := rfl
347343

348344
section tsum
349345
variables {α : Type*} (𝕜 : Type*) [is_R_or_C 𝕜]

src/analysis/complex/schwarz.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ begin
9898
have hg₀ : ‖g‖₊ ≠ 0, by simpa only [hg'] using one_ne_zero,
9999
calc ‖dslope f c z‖ = ‖dslope (g ∘ f) c z‖ :
100100
begin
101-
rw [g.dslope_comp, hgf, is_R_or_C.norm_of_real, norm_norm],
101+
rw [g.dslope_comp, hgf, is_R_or_C.norm_of_real, abs_norm],
102102
exact λ _, hd.differentiable_at (ball_mem_nhds _ hR₁)
103103
end
104104
... ≤ R₂ / R₁ :

src/analysis/convex/gauge.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,11 @@ variables [is_R_or_C 𝕜] [module 𝕜 E] [is_scalar_tower ℝ 𝕜 E]
290290

291291
lemma gauge_norm_smul (hs : balanced 𝕜 s) (r : 𝕜) (x : E) : gauge s (‖r‖ • x) = gauge s (r • x) :=
292292
begin
293-
rw @is_R_or_C.real_smul_eq_coe_smul 𝕜,
294-
obtain rfl | hr := eq_or_ne r 0,
295-
{ simp only [norm_zero, is_R_or_C.of_real_zero] },
296293
unfold gauge,
297294
congr' with θ,
295+
rw @is_R_or_C.real_smul_eq_coe_smul 𝕜,
298296
refine and_congr_right (λ hθ, (hs.smul _).mem_smul_iff _),
299-
rw [is_R_or_C.norm_of_real, norm_norm],
297+
rw [is_R_or_C.norm_of_real, abs_norm],
300298
end
301299

302300
/-- If `s` is balanced, then the Minkowski functional is ℂ-homogeneous. -/

src/analysis/inner_product_space/basic.lean

Lines changed: 38 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ include c
154154
local notation `⟪`x`, `y`⟫` := @inner 𝕜 F _ x y
155155
local notation `norm_sqK` := @is_R_or_C.norm_sq 𝕜 _
156156
local notation `reK` := @is_R_or_C.re 𝕜 _
157-
local notation `absK` := @is_R_or_C.abs 𝕜 _
158157
local notation `ext_iff` := @is_R_or_C.ext_iff 𝕜 _
159158
local postfix `†`:90 := star_ring_end _
160159

@@ -219,11 +218,8 @@ inner_self_eq_zero.not
219218
lemma inner_self_re_to_K (x : F) : (re ⟪x, x⟫ : 𝕜) = ⟪x, x⟫ :=
220219
by norm_num [ext_iff, inner_self_im]
221220

222-
lemma abs_inner_symm (x y : F) : abs ⟪x, y⟫ = abs ⟪y, x⟫ :=
223-
by rw [←inner_conj_symm, abs_conj]
224-
225221
lemma norm_inner_symm (x y : F) : ‖⟪x, y⟫‖ = ‖⟪y, x⟫‖ :=
226-
by rw [is_R_or_C.norm_eq_abs, is_R_or_C.norm_eq_abs, abs_inner_symm]
222+
by rw [←inner_conj_symm, norm_conj]
227223

228224
lemma inner_neg_left (x y : F) : ⟪-x, y⟫ = -⟪x, y⟫ :=
229225
by { rw [← neg_one_smul 𝕜 x, inner_smul_left], simp }
@@ -237,8 +233,8 @@ by { simp [sub_eq_add_neg, inner_add_left, inner_neg_left] }
237233
lemma inner_sub_right (x y z : F) : ⟪x, y - z⟫ = ⟪x, y⟫ - ⟪x, z⟫ :=
238234
by { simp [sub_eq_add_neg, inner_add_right, inner_neg_right] }
239235

240-
lemma inner_mul_conj_re_abs (x y : F) : re (⟪x, y⟫ * ⟪y, x⟫) = abs (⟪x, y⟫ * ⟪y, x⟫) :=
241-
by { rw [←inner_conj_symm, mul_comm], exact re_eq_abs_of_mul_conj (inner y x), }
236+
lemma inner_mul_symm_re_eq_norm (x y : F) : re (⟪x, y⟫ * ⟪y, x⟫) = ⟪x, y⟫ * ⟪y, x⟫ :=
237+
by { rw [←inner_conj_symm, mul_comm], exact re_eq_norm_of_mul_conj (inner y x), }
242238

243239
/-- Expand `inner (x + y) (x + y)` -/
244240
lemma inner_add_add_self (x y : F) : ⟪x + y, x + y⟫ = ⟪x, x⟫ + ⟪x, y⟫ + ⟪y, x⟫ + ⟪y, y⟫ :=
@@ -310,7 +306,7 @@ add_group_norm.to_normed_add_comm_group
310306
neg' := λ x, by simp only [inner_neg_left, neg_neg, inner_neg_right],
311307
add_le' := λ x y, begin
312308
have h₁ : ‖⟪x, y⟫‖ ≤ ‖x‖ * ‖y‖ := norm_inner_le_norm _ _,
313-
have h₂ : re ⟪x, y⟫ ≤ ‖⟪x, y⟫‖ := (re_le_abs _).trans_eq (is_R_or_C.norm_eq_abs _).symm,
309+
have h₂ : re ⟪x, y⟫ ≤ ‖⟪x, y⟫‖ := re_le_norm _,
314310
have h₃ : re ⟪x, y⟫ ≤ ‖x‖ * ‖y‖ := h₂.trans h₁,
315311
have h₄ : re ⟪y, x⟫ ≤ ‖x‖ * ‖y‖ := by rwa [←inner_conj_symm, conj_re],
316312
have : ‖x + y‖ * ‖x + y‖ ≤ (‖x‖ + ‖y‖) * (‖x‖ + ‖y‖),
@@ -362,8 +358,6 @@ variables [normed_add_comm_group F] [inner_product_space ℝ F]
362358
variables [dec_E : decidable_eq E]
363359
local notation `⟪`x`, `y`⟫` := @inner 𝕜 _ _ x y
364360
local notation `IK` := @is_R_or_C.I 𝕜 _
365-
local notation `absR` := has_abs.abs
366-
local notation `absK` := @is_R_or_C.abs 𝕜 _
367361
local postfix `†`:90 := star_ring_end _
368362

369363
export inner_product_space (norm_sq_eq_inner)
@@ -478,20 +472,23 @@ inner_product_space.to_core.nonneg_re x
478472
lemma real_inner_self_nonneg {x : F} : 0 ≤ ⟪x, x⟫_ℝ := @inner_self_nonneg ℝ F _ _ _ x
479473

480474
@[simp] lemma inner_self_re_to_K (x : E) : (re ⟪x, x⟫ : 𝕜) = ⟪x, x⟫ :=
481-
is_R_or_C.ext_iff.2by simp only [of_real_re], by simp only [inner_self_im, of_real_im]⟩
475+
((is_R_or_C.is_real_tfae (⟪x, x⟫ : 𝕜)).out 2 3).2 (inner_self_im _)
482476

483477
lemma inner_self_eq_norm_sq_to_K (x : E) : ⟪x, x⟫ = (‖x‖ ^ 2 : 𝕜) :=
484478
by rw [← inner_self_re_to_K, ← norm_sq_eq_inner, of_real_pow]
485479

486-
lemma inner_self_re_abs (x : E) : re ⟪x, x⟫ = abs ⟪x, x⟫ :=
480+
lemma inner_self_re_eq_norm (x : E) : re ⟪x, x⟫ = ⟪x, x⟫ :=
487481
begin
488482
conv_rhs { rw [←inner_self_re_to_K] },
489483
symmetry,
490-
exact is_R_or_C.abs_of_nonneg inner_self_nonneg,
484+
exact norm_of_nonneg inner_self_nonneg,
491485
end
492486

493-
lemma inner_self_abs_to_K (x : E) : (absK ⟪x, x⟫ : 𝕜) = ⟪x, x⟫ :=
494-
by { rw [←inner_self_re_abs], exact inner_self_re_to_K _ }
487+
lemma inner_self_norm_to_K (x : E) : (‖⟪x, x⟫‖ : 𝕜) = ⟪x, x⟫ :=
488+
by { rw [←inner_self_re_eq_norm], exact inner_self_re_to_K _ }
489+
490+
lemma real_inner_self_abs (x : F) : |⟪x, x⟫_ℝ| = ⟪x, x⟫_ℝ :=
491+
@inner_self_norm_to_K ℝ F _ _ _ x
495492

496493
@[simp] lemma inner_self_eq_zero {x : E} : ⟪x, x⟫ = 0 ↔ x = 0 :=
497494
by rw [inner_self_eq_norm_sq_to_K, sq_eq_zero_iff, of_real_eq_zero, norm_eq_zero]
@@ -505,11 +502,8 @@ by rw [← norm_sq_eq_inner, (sq_nonneg _).le_iff_eq, sq_eq_zero_iff, norm_eq_ze
505502
lemma real_inner_self_nonpos {x : F} : ⟪x, x⟫_ℝ ≤ 0 ↔ x = 0 :=
506503
@inner_self_nonpos ℝ F _ _ _ x
507504

508-
lemma real_inner_self_abs (x : F) : absR ⟪x, x⟫_ℝ = ⟪x, x⟫_ℝ :=
509-
by { have h := @inner_self_abs_to_K ℝ F _ _ _ x, simpa using h }
510-
511-
lemma abs_inner_symm (x y : E) : abs ⟪x, y⟫ = abs ⟪y, x⟫ :=
512-
by rw [←inner_conj_symm, abs_conj]
505+
lemma norm_inner_symm (x y : E) : ‖⟪x, y⟫‖ = ‖⟪y, x⟫‖ :=
506+
by rw [←inner_conj_symm, norm_conj]
513507

514508
@[simp] lemma inner_neg_left (x y : E) : ⟪-x, y⟫ = -⟪x, y⟫ :=
515509
by { rw [← neg_one_smul 𝕜 x, inner_smul_left], simp }
@@ -528,8 +522,8 @@ by { simp [sub_eq_add_neg, inner_add_left] }
528522
lemma inner_sub_right (x y z : E) : ⟪x, y - z⟫ = ⟪x, y⟫ - ⟪x, z⟫ :=
529523
by { simp [sub_eq_add_neg, inner_add_right] }
530524

531-
lemma inner_mul_conj_re_abs (x y : E) : re (⟪x, y⟫ * ⟪y, x⟫) = abs (⟪x, y⟫ * ⟪y, x⟫) :=
532-
by { rw [←inner_conj_symm, mul_comm], exact re_eq_abs_of_mul_conj (inner y x), }
525+
lemma inner_mul_symm_re_eq_norm (x y : E) : re (⟪x, y⟫ * ⟪y, x⟫) = ⟪x, y⟫ * ⟪y, x⟫ :=
526+
by { rw [←inner_conj_symm, mul_comm], exact re_eq_norm_of_mul_conj (inner y x), }
533527

534528
/-- Expand `⟪x + y, x + y⟫` -/
535529
lemma inner_add_add_self (x y : E) : ⟪x + y, x + y⟫ = ⟪x, x⟫ + ⟪x, y⟫ + ⟪y, x⟫ + ⟪y, y⟫ :=
@@ -939,14 +933,11 @@ begin
939933
exact inner_product_space.core.norm_inner_le_norm x y
940934
end
941935

942-
lemma abs_inner_le_norm (x y : E) : abs ⟪x, y⟫ ≤ ‖x‖ * ‖y‖ :=
943-
(norm_eq_abs ⟪x, y⟫).symm.trans_le (norm_inner_le_norm _ _)
944-
945936
lemma nnnorm_inner_le_nnnorm (x y : E) : ‖⟪x, y⟫‖₊ ≤ ‖x‖₊ * ‖y‖₊ :=
946937
norm_inner_le_norm x y
947938

948939
lemma re_inner_le_norm (x y : E) : re ⟪x, y⟫ ≤ ‖x‖ * ‖y‖ :=
949-
le_trans (re_le_abs (inner x y)) (abs_inner_le_norm x y)
940+
le_trans (re_le_norm (inner x y)) (norm_inner_le_norm x y)
950941

951942
/-- Cauchy–Schwarz inequality with norm -/
952943
lemma abs_real_inner_le_norm (x y : F) : |⟪x, y⟫_ℝ| ≤ ‖x‖ * ‖y‖ :=
@@ -1322,9 +1313,9 @@ end
13221313

13231314
/-- The real inner product of two vectors, divided by the product of their
13241315
norms, has absolute value at most 1. -/
1325-
lemma abs_real_inner_div_norm_mul_norm_le_one (x y : F) : absR (⟪x, y⟫_ℝ / (‖x‖ * ‖y‖))1 :=
1316+
lemma abs_real_inner_div_norm_mul_norm_le_one (x y : F) : |⟪x, y⟫_ℝ / (‖x‖ * ‖y‖)|1 :=
13261317
begin
1327-
rw [_root_.abs_div, _root_.abs_mul, abs_norm, abs_norm],
1318+
rw [abs_div, abs_mul, abs_norm, abs_norm],
13281319
exact div_le_one_of_le (abs_real_inner_le_norm x y) (by positivity)
13291320
end
13301321

@@ -1339,36 +1330,31 @@ by rw [inner_smul_right, ←real_inner_self_eq_norm_mul_norm]
13391330
/-- The inner product of a nonzero vector with a nonzero multiple of
13401331
itself, divided by the product of their norms, has absolute value
13411332
1. -/
1342-
lemma abs_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul
1343-
{x : E} {r : 𝕜} (hx : x ≠ 0) (hr : r ≠ 0) : abs ⟪x, r • x⟫ / (‖x‖ * ‖r • x‖) = 1 :=
1333+
lemma norm_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul
1334+
{x : E} {r : 𝕜} (hx : x ≠ 0) (hr : r ≠ 0) : ⟪x, r • x⟫ / (‖x‖ * ‖r • x‖) = 1 :=
13441335
begin
1345-
have hx' : ‖x‖ ≠ 0 := by simp [norm_eq_zero, hx],
1346-
have hr' : abs r ≠ 0 := by simp [is_R_or_C.abs_eq_zero, hr],
1347-
rw [inner_smul_right, is_R_or_C.abs_mul, ←inner_self_re_abs, inner_self_eq_norm_mul_norm,
1348-
norm_smul],
1349-
rw [is_R_or_C.norm_eq_abs, ←mul_assoc, ←div_div, mul_div_cancel _ hx',
1350-
←div_div, mul_comm, mul_div_cancel _ hr', div_self hx'],
1336+
have hx' : ‖x‖ ≠ 0 := by simp [hx],
1337+
have hr' : ‖r‖ ≠ 0 := by simp [hr],
1338+
rw [inner_smul_right, norm_mul, ← inner_self_re_eq_norm, inner_self_eq_norm_mul_norm, norm_smul],
1339+
rw [← mul_assoc, ← div_div, mul_div_cancel _ hx',
1340+
← div_div, mul_comm, mul_div_cancel _ hr', div_self hx'],
13511341
end
13521342

13531343
/-- The inner product of a nonzero vector with a nonzero multiple of
13541344
itself, divided by the product of their norms, has absolute value
13551345
1. -/
13561346
lemma abs_real_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul
1357-
{x : F} {r : ℝ} (hx : x ≠ 0) (hr : r ≠ 0) : absR ⟪x, r • x⟫_ℝ / (‖x‖ * ‖r • x‖) = 1 :=
1358-
begin
1359-
rw ← abs_to_real,
1360-
exact abs_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul hx hr
1361-
end
1347+
{x : F} {r : ℝ} (hx : x ≠ 0) (hr : r ≠ 0) : |⟪x, r • x⟫_ℝ| / (‖x‖ * ‖r • x‖) = 1 :=
1348+
norm_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul hx hr
13621349

13631350
/-- The inner product of a nonzero vector with a positive multiple of
13641351
itself, divided by the product of their norms, has value 1. -/
13651352
lemma real_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_pos_mul
13661353
{x : F} {r : ℝ} (hx : x ≠ 0) (hr : 0 < r) : ⟪x, r • x⟫_ℝ / (‖x‖ * ‖r • x‖) = 1 :=
13671354
begin
1368-
rw [real_inner_smul_self_right, norm_smul, real.norm_eq_abs, ←mul_assoc ‖x‖, mul_comm _ (absR r),
1369-
mul_assoc, _root_.abs_of_nonneg (le_of_lt hr), div_self],
1370-
exact mul_ne_zero (ne_of_gt hr)
1371-
(λ h, hx (norm_eq_zero.1 (eq_zero_of_mul_self_eq_zero h)))
1355+
rw [real_inner_smul_self_right, norm_smul, real.norm_eq_abs, ←mul_assoc ‖x‖, mul_comm _ (|r|),
1356+
mul_assoc, abs_of_nonneg hr.le, div_self],
1357+
exact mul_ne_zero hr.ne' (mul_self_ne_zero.2 (norm_ne_zero_iff.2 hx))
13721358
end
13731359

13741360
/-- The inner product of a nonzero vector with a negative multiple of
@@ -1431,9 +1417,8 @@ begin
14311417
refine ⟨hx₀, (norm_inner_eq_norm_iff hx₀ hy₀).1 $ eq_of_div_eq_one _⟩,
14321418
simpa using h },
14331419
{ rintro ⟨hx, ⟨r, ⟨hr, rfl⟩⟩⟩,
1434-
simp only [is_R_or_C.abs_div, is_R_or_C.abs_mul, is_R_or_C.abs_of_real, is_R_or_C.norm_eq_abs,
1435-
abs_norm],
1436-
exact abs_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul hx hr }
1420+
simp only [norm_div, norm_mul, norm_of_real, abs_norm],
1421+
exact norm_inner_div_norm_mul_norm_eq_one_of_ne_zero_of_ne_zero_mul hx hr }
14371422
end
14381423

14391424
/-- The inner product of two vectors, divided by the product of their
@@ -1452,7 +1437,7 @@ begin
14521437
{ have : x = 0 ∨ y = (⟪x, y⟫ / ⟪x, x⟫ : 𝕜) • x :=
14531438
((@norm_inner_eq_norm_tfae 𝕜 _ _ _ _ x y).out 0 1).1 (by simp [h]),
14541439
rw [this.resolve_left h₀, h],
1455-
simp [norm_smul, is_R_or_C.norm_eq_abs, inner_self_abs_to_K, h₀'] },
1440+
simp [norm_smul, inner_self_norm_to_K, h₀'] },
14561441
{ conv_lhs { rw [← h, inner_smul_right, inner_self_eq_norm_sq_to_K] },
14571442
field_simp [sq, mul_left_comm] }
14581443
end
@@ -1569,7 +1554,7 @@ begin
15691554
{ simp },
15701555
{ refine (mul_le_mul_right (norm_pos_iff.2 h)).mp _,
15711556
calc ‖x‖ * ‖x‖ = ‖(⟪x, x⟫ : 𝕜)‖ : by rw [← sq, inner_self_eq_norm_sq_to_K, norm_pow,
1572-
norm_of_real, norm_norm]
1557+
norm_of_real, abs_norm]
15731558
... ≤ ‖innerSL 𝕜 x‖ * ‖x‖ : (innerSL 𝕜 x).le_op_norm _ }
15741559
end
15751560

@@ -1867,12 +1852,12 @@ begin
18671852
use a,
18681853
intros s₁ hs₁ s₂ hs₂,
18691854
rw ← finset.sum_sdiff_sub_sum_sdiff,
1870-
refine (_root_.abs_sub _ _).trans_lt _,
1855+
refine (abs_sub _ _).trans_lt _,
18711856
have : ∀ i, 0 ≤ ‖f i‖ ^ 2 := λ i : ι, sq_nonneg _,
18721857
simp only [finset.abs_sum_of_nonneg' this],
18731858
have : ∑ i in s₁ \ s₂, ‖f i‖ ^ 2 + ∑ i in s₂ \ s₁, ‖f i‖ ^ 2 < (sqrt ε) ^ 2,
1874-
{ rw [← hV.norm_sq_diff_sum, sq_lt_sq,
1875-
_root_.abs_of_nonneg (sqrt_nonneg _), _root_.abs_of_nonneg (norm_nonneg _)],
1859+
{ rw [← hV.norm_sq_diff_sum, sq_lt_sq, abs_of_nonneg (sqrt_nonneg _),
1860+
abs_of_nonneg (norm_nonneg _)],
18761861
exact H s₁ hs₁ s₂ hs₂ },
18771862
have hη := sq_sqrt (le_of_lt hε),
18781863
linarith },

src/analysis/inner_product_space/rayleigh.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ begin
6767
let c : 𝕜 := ↑‖x‖⁻¹ * r,
6868
have : c ≠ 0 := by simp [c, hx, hr.ne'],
6969
refine ⟨c • x, _, _⟩,
70-
{ field_simp [norm_smul, is_R_or_C.norm_eq_abs, abs_of_nonneg hr.le] },
70+
{ field_simp [norm_smul, abs_of_pos hr] },
7171
{ rw T.rayleigh_smul x this,
7272
exact hxT } },
7373
{ rintros ⟨x, hx, hxT⟩,

src/analysis/inner_product_space/symmetric.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ begin
166166
inner_add_right, inner_sub_left, inner_sub_right, hT x, ← inner_conj_symm x (T y)],
167167
suffices : (re ⟪T y, x⟫ : 𝕜) = ⟪T y, x⟫,
168168
{ rw conj_eq_iff_re.mpr this,
169-
ring_nf, },
169+
ring, },
170170
{ rw ← re_add_im ⟪T y, x⟫,
171171
simp_rw [h, mul_zero, add_zero],
172172
norm_cast, } },

src/analysis/locally_convex/continuous_of_bounded.lean

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,9 @@ begin
108108
rw ←hy,
109109
refine (bE1 (n+1)).2.smul_mem _ hx,
110110
have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos,
111-
rw [norm_inv, ←nat.cast_one, ←nat.cast_add, is_R_or_C.norm_eq_abs, is_R_or_C.abs_cast_nat,
112-
nat.cast_add, nat.cast_one, inv_le h' zero_lt_one],
113-
norm_cast,
114-
simp, },
111+
rw [norm_inv, ←nat.cast_one, ←nat.cast_add, is_R_or_C.norm_nat_cast, nat.cast_add,
112+
nat.cast_one, inv_le h' zero_lt_one],
113+
simp },
115114
intros n hn,
116115
-- The converse direction follows from continuity of the scalar multiplication
117116
have hcont : continuous_at (λ (x : E), (n : 𝕜) • x) 0 :=
@@ -149,7 +148,7 @@ begin
149148
cases exists_nat_gt r with n hn,
150149
-- We now find a contradiction between `f (u n) ∉ V` and the absorbing property
151150
have h1 : r ≤ ‖(n : 𝕜')‖ :=
152-
by { rw [is_R_or_C.norm_eq_abs, is_R_or_C.abs_cast_nat], exact hn.le },
151+
by { rw [is_R_or_C.norm_nat_cast], exact hn.le },
153152
have hn' : 0 < ‖(n : 𝕜')‖ := lt_of_lt_of_le hr h1,
154153
rw [norm_pos_iff, ne.def, nat.cast_eq_zero] at hn',
155154
have h'' : f (u n) ∈ V :=

src/analysis/normed_space/exponential.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ begin
367367
refine summable_of_norm_bounded_eventually _ (real.summable_pow_div_factorial r) _,
368368
filter_upwards [eventually_cofinite_ne 0] with n hn,
369369
rw [norm_mul, norm_norm (exp_series 𝕂 𝔸 n), exp_series, norm_smul, norm_inv, norm_pow,
370-
nnreal.norm_eq, norm_eq_abs, abs_cast_nat, mul_comm, ←mul_assoc, ←div_eq_mul_inv],
370+
nnreal.norm_eq, norm_nat_cast, mul_comm, ←mul_assoc, ←div_eq_mul_inv],
371371
have : ‖continuous_multilinear_map.mk_pi_algebra_fin 𝕂 n 𝔸‖ ≤ 1 :=
372372
norm_mk_pi_algebra_fin_le_of_pos (nat.pos_of_ne_zero hn),
373373
exact mul_le_of_le_one_right (div_nonneg (pow_nonneg r.coe_nonneg n) n!.cast_nonneg) this

0 commit comments

Comments
 (0)