Zulip Chat Archive

Stream: new members

Topic: supremum of reals


Alex Meiburg (Feb 22 2024 at 18:23):

How do I say "supremum of this set of reals"? I couldn't find anything like Real.sup. I have a collection S that produces different values when a function f is applied, and I want to take the supremum.

I would also like to eventually prove that this supremum is attained, and then also define a particular function by "take the element in S that maximizes this value". This will obviously require some topology, but Lean's topology feels very strange and foreign to me...

Ruben Van de Velde (Feb 22 2024 at 18:27):

docs#sSup

Jireh Loreaux (Feb 22 2024 at 18:35):

There is also docs#iSup for indexed suprema, also known as

Colin Jones ⚛️ (Feb 22 2024 at 19:09):

Ruben Van de Velde said:

docs#sSup

The link you gave gives a 404 error. https://leanprover-community.github.io/mathlib4_docs/404.html#sSup

Ruben Van de Velde (Feb 22 2024 at 19:58):

Yeah, though you can click through. Here's a direct link: https://leanprover-community.github.io/mathlib4_docs/Mathlib/Order/SetNotation.html#SupSet.sSup

Alex Meiburg (Feb 22 2024 at 20:45):

Thanks. Any pointers on how to go about saying an "argmax" type thing...? Or showing that the supremum is attained? Is this something I need to understand Filter for?

A. (Feb 23 2024 at 04:54):

I suppose it depends on your exact argument but I didn't think of filters when I wrote

import Mathlib.Topology.MetricSpace.PseudoMetric

noncomputable def argmax {β : Type*} [TopologicalSpace β]
    {s : Set β} (hs : IsCompact s) (ne_s : s.Nonempty) {f : β  } (hf : ContinuousOn f s) : β :=
  Classical.choose (hs.exists_isMaxOn ne_s hf)

Last updated: May 02 2025 at 03:31 UTC