-
Notifications
You must be signed in to change notification settings - Fork 839
feat(MeasureTheory): add MemLp.Const
class and instances to unify p = ∞
and μ.IsFiniteMeasure
cases
#30030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…of how I embedded them here, though.
…nstance instead of IsFiniteMeasure
…ely seem like they shouldn't need `IsFiniteMeasure`, but will need a little work to excise this.
…p` could use something like the `MemLp.Const` class.
…_top'` available in the LpSpace.Basic file.
PR summary 07e431564cImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
Current number | Change | Type |
---|---|---|
4 | 1 | large files |
Current commit b8dd863c65
Reference commit 07e431564c
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relative
value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolute
value is therelative
value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I do wonder whether or not it makes more sense to have the field in this class be p = ∞ ∨ IsFiniteMeasure μ
. There's no other context in which we'll be able to have this class, right? The advantage is that it would allow to do case splits in proofs about this class. For instance, then indicatorConstLp
could take an argument that μ s ≠ ∞ ∨ p = ∞
.
I'm not sure how valuable this would be. Don't make this change without first consulting the opinions of others. It may not be a good idea.
@@ -171,6 +171,12 @@ end Neg | |||
|
|||
section Const | |||
|
|||
|
|||
variable (ε) in | |||
/-- The class of constant Lp functions. Has only `p = ∞` and `μ.IsFiniteMeasure` instances. -/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/-- The class of constant Lp functions. Has only `p = ∞` and `μ.IsFiniteMeasure` instances. -/ | |
/-- A class which encodes that constant functions are members of `Lp`. | |
This has instances when `p := ∞` or `μ.IsFiniteMeasure`. -/ |
MemLp.Const
class and instances to unify p=∞
and μ.IsFiniteMeasure
casesMemLp.Const
class and instances to unify p = ∞
and μ.IsFiniteMeasure
cases
How to raise this issue? Should I more aggressively prod more people to review this PR, or does it rise to the level of a Zulip thread? |
@JonBannon ask on Zulip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking pretty good, but I think we can do even better.
lemma indicatorConstLp_univ : | ||
indicatorConstLp p .univ (measure_ne_top μ _) c = Lp.const p μ c := by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you generalize the hypothesis of indicatorConstLp
to hμs : p = ∞ ∨ μ s ≠ ∞
with minimal breakage. It would be nice to generalize the rest of this too, and it should be possible if you do that. For instance, where it gets used below in Lp.constL
, one could assume MemLp.const p μ
instead of μ.IsFiniteMeasure
, then you could use Fact (1 ≤ p)
to conclude p ≠ 0
, and then you could use the disjunction I mentioned in another comment to conclude that p = ∞ ∨ μ.IsFiniteMeasure
, which would then allow you to apply the necessary lemmas with a modified version of indicatorConstLp_univ
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work, but I'm having some trouble. I first made the following modification, which then allowed your suggested change to hμs
to be introduced (not the one below, but the one in ndicatorConstLp
) with no change to the proof.
lemma memLp_indicator_const (p : ℝ≥0∞) (hs : MeasurableSet s) (c : E)
(hμsc : c = 0 ∨ p = ∞ ∨ μ s ≠ ∞) : MemLp (s.indicator fun _ => c) p μ := by
rw [memLp_indicator_iff_restrict hs]
obtain rfl | hμi | hμs := hμsc
· exact MemLp.zero
· rw [hμi]
apply memLp_const
· have := Fact.mk hμs.lt_top
apply memLp_const
But after this change I'm facing a bunch of weird breakage below it because Lean doesn't like ∞=∞
instead of p=∞
. So I'll keep plugging at this...
Although it is possible to ensure that, for example, the
One
instances forp=∞
andμ.IsFiniteMeasure
are defeq, introducing anMemLp.Const
typeclass removes the need to unfold extensively to check this definitional equality, improving performance. cf. https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Lp.20constant.20function.20issue/with/537563137This PR introduces the requisite class and associated instances.