Zulip Chat Archive

Stream: Is there code for X?

Topic: abs of vector component ≤ norm of vector


David Renshaw (Apr 26 2025 at 19:59):

Is there an existing lemma that I can appeal to here?

import Mathlib

lemma fst_abs_le_norm (v : EuclideanSpace  (Fin 2)) : |v 0|  v := by
  rw [EuclideanSpace.norm_eq, Fin.sum_univ_two]
  have h : v 0 ^ 2  v 0 ^ 2 + v 1 ^ 2 := by nlinarith
  have h1 : (v 0 ^ 2)  (v 0 ^ 2 + v 1 ^ 2) := Real.sqrt_le_sqrt h
  have h2 : 0  v 0 := norm_nonneg (v 0)
  rw [Real.sqrt_sq h2] at h1
  rw [Real.norm_eq_abs]
  exact h1

David Renshaw (Apr 26 2025 at 20:00):

like Complex.abs_re_le_norm, but for vectors in Euclidean space?

Eric Wieser (Apr 26 2025 at 20:30):

import Mathlib

lemma nnnorm_apply_le_nnnorm {m} [Fintype m] (v : EuclideanSpace  m) (i : m) : v i‖₊  v‖₊ := by
  rw [EuclideanSpace.nnnorm_eq, NNReal.le_sqrt_iff_sq_le]
  exact Finset.single_le_sum (f := fun i => v i‖₊ ^ 2) (fun _ _ => zero_le _) (Finset.mem_univ i)

Eric Wieser (Apr 26 2025 at 20:33):

This should generalize to WithLp

Eric Wieser (Apr 26 2025 at 20:45):

docs#PiLp.lipschitzWith_equiv is probably hiding the statement you want internally

Yury G. Kudryashov (Apr 26 2025 at 22:10):

It definitely implies that statement, and probably uses it in the proof.

Eric Wieser (Apr 27 2025 at 03:44):

#24402 extracts it

David Renshaw (Apr 27 2025 at 17:18):

added #24415

Yury G. Kudryashov (Apr 27 2025 at 17:21):

Sent to bors, but some day we should stop abusing defeq for WithLp.

Eric Wieser (Apr 27 2025 at 18:01):

Paul is working on a refactor that first renames the constructors


Last updated: May 02 2025 at 03:31 UTC