Zulip Chat Archive

Stream: mathlib4

Topic: Lp constant function issue


Jon Bannon (Sep 03 2025 at 17:48):

Suppose we have

variable {α : Type*} {m : MeasurableSpace α} {μ : Measure α}
variable {R : Type*} [NormedRing R]

For general p, we have constant functions in Lp R p μ provided we have IsFiniteMeasure μ. This requirement is unnecessary if p= \infty. There are many situations where we are going to want essentially bounded constant functions where the measure isn't finite, and to have an associated One instance in this case. How to best handle this so that we don't later end up with colliding One instances when we have L\infty over a finite measure space?

Aaron Liu (Sep 03 2025 at 17:49):

make the One instances defeq?

Aaron Liu (Sep 03 2025 at 17:49):

if you don't do anything weird this should just be automatic

Jon Bannon (Sep 03 2025 at 17:50):

I think they will be, but @Jireh Loreaux was wondering whether it would be better to generalize Lp.const to take either a finite measure or have p := ∞ (solved with an autoParam so the user need never supply it)

Aaron Liu (Sep 03 2025 at 17:52):

like (small : p = ⊤ ∨ IsFiniteMeasure μ := by first | exact Or.inl rfl | exact Or.inr inferInstance)?

Eric Wieser (Sep 03 2025 at 18:16):

Aaron Liu said:

make the One instances defeq?

This is safe, but you still end up having to repeat every lemma / downstream instance

Eric Wieser (Sep 03 2025 at 18:17):

Another option would be to instroduce an Lp.HasConst typeclass, instantiated for both cases

Jireh Loreaux (Sep 03 2025 at 18:25):

Eric Wieser said:

Aaron Liu said:

make the One instances defeq?

This is safe, but you still end up having to repeat every lemma / downstream instance

The thing I was worried about for this was actually performance. In particular, in the case when p := ∞ and μ.IsFiniteMeasure, then there would be two One instances, and Lean may have to unfold a lot sometimes to see they are equal (e.g., if one of them is embedded in a NormedCommRing instance).

Eric Wieser (Sep 03 2025 at 22:34):

I think that unfolding is not all that different to what it has to do anyway for two different paths fromNormedCommRing


Last updated: Dec 20 2025 at 21:32 UTC