Zulip Chat Archive

Stream: new members

Topic: Riesz theorem


jsodd (Aug 20 2024 at 17:31):

Is there the Riesz representation theorem in mathlib? Maybe just the simple case, like saying that any linear functional l : (n → ℝ) →L[ℝ] ℝ may be interpreted as a vector n → ℝ. In this case it's easy to do manually, but in other similar situations some theorem would be nice.

Matthew Ballard (Aug 20 2024 at 17:34):

docs#InnerProductSpace.toDual

jsodd (Aug 20 2024 at 17:39):

Thanks. For some reason it fails to synthesize InnerProductSpace ℝ (n → ℝ)

Etienne Marion (Aug 20 2024 at 17:49):

I think this is because (n \to \R) is endowed with infinite norm rather than the euclidean one. You should use docs#PiLp 2 instead I think

jsodd (Aug 20 2024 at 17:53):

I see... Is there a standard way to switch? That is, if I didn't need the $L^2$ structure up to some point and I don't want to rewrite everything before that, is there a way to use it ad hoc?

Etienne Marion (Aug 20 2024 at 17:59):

I’ve never used it so I don’t know if it is convenient, but the switch is docs#WithLp.equiv

Luigi Massacci (Aug 20 2024 at 18:01):

Also we have docs#EuclideanSpace, which is just a wrapper over PiLp, but it looks nicer

jsodd (Aug 20 2024 at 18:12):

This is great! I still have troubles making n → ℝ out of l : (n → ℝ) →L[ℝ] ℝ, but I guess I'll figure it out. Thank you very much

jsodd (Aug 20 2024 at 18:20):

In this case I could just take a basis let e := fun (i j : n) \map if i = j then (1 : \R) else (0 : \R) and define let l' := fun (i : n) \map l (e i). I guess it's just easier than going through the all this machinery

Etienne Marion (Aug 20 2024 at 18:27):

This is docs#Basis.toDualEquiv

jsodd (Aug 20 2024 at 19:32):

I've tried this:

#check InnerProductSpace.toDualMap  (WithLp 2 (n  )  )

but now Lean cannot synthesize NormedAddCommGroup (WithLp 2 (n → ℝ) → ℝ).

Luigi Massacci (Aug 20 2024 at 20:03):

It would be better probably if you try to give more context for what you want to do

jsodd (Aug 20 2024 at 20:06):

Well, in the simplest case I'd like to be able to find a unique vector x : n → ℝ representing l : (n → ℝ) →L[ℝ] ℝ relative to the standard scalar product

jsodd (Aug 20 2024 at 20:08):

And I'd also like to understand how to do this in the general Hilbert space context. But first just the finite dimensional case, as simple as possible

jsodd (Aug 20 2024 at 20:26):

I'm not yet sure, but this seems to be close to what I'm looking for:

variable {x : (n  ) L[] }
#check (InnerProductSpace.toDual  (WithLp 2 (n  ))).invFun x

jsodd (Aug 20 2024 at 20:29):

Maybe this belongs somewhere near InnerProductSpace.toDual? Taking linear functional representatives is a very common thing...

Etienne Marion (Aug 20 2024 at 20:31):

Isn't docs#InnerProductSpace.toDual_symm_apply what you're looking for?

Etienne Marion (Aug 20 2024 at 20:31):

jsodd said:

#check (InnerProductSpace.toDual ℝ (WithLp 2 (n → ℝ))).invFun x

You should use .symm instead of .invFun to keep a linear equiv

jsodd (Aug 20 2024 at 20:31):

I want the representative itself, not some lemma about it

Etienne Marion (Aug 20 2024 at 20:32):

Yes I understand but you already have it, it is

(InnerProductSpace.toDual  (WithLp 2 (n  ))).symm x

Etienne Marion (Aug 20 2024 at 20:33):

Isn't it?

jsodd (Aug 20 2024 at 20:33):

Yes. I'm just saying that maybe this operation deserves its own def.

jsodd (Aug 20 2024 at 20:33):

Just because it's so common to prove something by first proving linearity and then taking representatives

jsodd (Aug 20 2024 at 20:35):

Etienne Marion said:

You should use .symm instead of .invFun to keep a linear equiv

But the fact that it's linear equivalence is gone as soon as I apply it to x, no?

Etienne Marion (Aug 20 2024 at 20:37):

Well here it does not matter I think, but generally when you need the inverse of an equiv, you use symm to also have an equiv

jsodd (Aug 20 2024 at 20:37):

Okay, thanks for the advice!

jsodd (Aug 21 2024 at 07:41):

One more question on the same subject. Let's say I have defined a function m : (n → ℝ) → ℝ. What do I have to do, after proving h : IsLinearMap m, to reinterpret m as m : (n → ℝ) →L[ℝ] ℝ? What's the proper way to use h?

Ruben Van de Velde (Aug 21 2024 at 07:42):

@loogle IsLinearMap, LinearMap

loogle (Aug 21 2024 at 07:42):

:search: IsLinearMap.mk', LinearMap.isLinear, and 2 more

Ruben Van de Velde (Aug 21 2024 at 07:43):

Presumably h.mk' m will work

jsodd (Aug 21 2024 at 07:45):

Just h.mk' did the trick, thanks! So it's always through .mk constructors? I mean in similar circumstances

Ruben Van de Velde (Aug 21 2024 at 07:47):

In similar circumstances, I would also look at what loogle finds :)

jsodd (Aug 21 2024 at 07:48):

The problem with loogle and the official documentation (which for me is easier to use) is to know how things are called.

jsodd (Aug 21 2024 at 07:49):

For example, I know what a Riesz representation theorem is, but there seems to be no way to find it in lean by this name

jsodd (Aug 21 2024 at 07:51):

It would be so nice to have a more user-friendly search

jsodd (Aug 21 2024 at 07:56):

And something like fzf on linux would also be great. Just to be less punished by the search for not knowing the precise name. Maybe I'll try writing something like this for myself...

Kevin Buzzard (Aug 21 2024 at 07:57):

If you know the name of the theorem, use moogle.ai

jsodd (Aug 21 2024 at 07:59):

I just tried to find Riesz representation theorem, but it couldn't.

Matthew Ballard (Aug 21 2024 at 08:01):

jsodd said:

For example, I know what a Riesz representation theorem is, but there seems to be no way to find it in lean by this name

You can search the repository on Github for "Riesz representation". The name is in the comments (as it should be).

jsodd (Aug 21 2024 at 08:03):

image.png
I found it in the end by clicking on "Google site search" here

Matthew Ballard (Aug 21 2024 at 08:03):

It also appears in the library overiew on the community webpage https://leanprover-community.github.io/mathlib-overview.html

jsodd (Aug 21 2024 at 08:07):

I just hope the search will get easier in the future :smile:

jsodd (Aug 21 2024 at 08:07):

I know it's far from the current project goals, but it's just so easy to imagine how a more user-friendly search may function.

Matthew Ballard (Aug 21 2024 at 08:08):

I agree that search can be difficult

jsodd (Aug 21 2024 at 08:13):

This google search feature seems to be quite good, just found "second dual" theorems with it. In lean it's called "double dual" with no second duals mentioned, but Google knows that double and second are the same thing.


Last updated: May 02 2025 at 03:31 UTC