Zulip Chat Archive

Stream: Is there code for X?

Topic: Normalizing a vector


Yaël Dillies (Jun 15 2022 at 09:55):

Do we have this anywhere?

import analysis.normed_space.basic

variables {E : Type*} [normed_group E] [normed_space  E]

noncomputable def normalize_vector (x : E) : E := x∥⁻¹  x

Oliver Nash (Jun 15 2022 at 09:57):

I don't see it. I note it is inlined in docs#gram_schmidt_normed

Yaël Dillies (Jun 15 2022 at 09:57):

Yes, exactly. The context is #14514

Yaël Dillies (Jun 15 2022 at 09:58):

I'm particularly interested in the fact that span 𝕜 {normalize_vector x} = span 𝕜 {x}.

Yaël Dillies (Jun 15 2022 at 10:02):

and more generally span 𝕜 (normalize_vector '' s) = span 𝕜 s.

Yaël Dillies (Jun 15 2022 at 10:03):

Does this deserve its own definition? I want to say yes, because it already is used in more specific contexts.

Oliver Nash (Jun 15 2022 at 10:05):

I'd lean in favour.

Eric Wieser (Jun 15 2022 at 11:01):

Is there more general statement that span 𝕜 {k • x} = span 𝕜 {x} when k is not 0?

Kevin Buzzard (Jun 15 2022 at 11:05):

This is not more general because ∥x∥⁻¹ = 0 when x = 0. Says the pedant.

Yaël Dillies (Jun 15 2022 at 11:19):

Yes, I precisely want to avoid casing on whether x is zero or not.


Last updated: Dec 20 2023 at 11:08 UTC