Zulip Chat Archive
Stream: Is there code for X?
Topic: Summable for functions on product
Michael Stoll (Nov 22 2024 at 19:47):
I'll need something along the lines of the following.
lemma Summable.prod_of_nonneg_of_summable_tsum {β γ : Type*} {f : β × γ → ℝ} (h₁ : ∀ x, 0 ≤ f x)
(h₂ : ∀ b, Summable fun c ↦ f (b, c)) (h₃ : Summable fun b ↦ ∑' c, f (b, c)) :
Summable f := by
sorry
I found docs#HasSum.of_sigma, but this a) uses a Sigma type instead of a product type, and b) has a condition (h : CauchySeq fun (s : Finset ((b : β) × γ b)) => ∑ i ∈ s, f i)
, which is a bit unwieldy (and I had problems translating this to the corresponding statement for the product type: it seems that there is no lemma allowing to transfer docs#CauchySeq via an equivalence).
There surely must be a better approach?
Sébastien Gouëzel (Nov 22 2024 at 20:43):
Would docs#HasProd.prod_fiberwise help?
Michael Stoll (Nov 22 2024 at 20:44):
I don't think so; it requires f
to be summable (for docs#HasSum.prod_fiberwise), which is what I want to prove.
Sébastien Gouëzel (Nov 22 2024 at 20:45):
No, sorry, I misread.
Sébastien Gouëzel (Nov 22 2024 at 20:47):
Well, you could lift everything to ENNReal using the positivity, use my lemma there to see that the sum of f
coincides with the sum in h_3
, so that it is finite, and then come back to the reals. Not completely direct, but not unnatural because nonnegativity is crucial for your lemma.
Michael Stoll (Nov 22 2024 at 20:47):
Which one is "your lemma there"?
Michael Stoll (Nov 22 2024 at 21:01):
@Sébastien Gouëzel :up:
Eric Wieser (Nov 22 2024 at 21:37):
Michael Stoll said:
it seems that there is no lemma allowing to transfer docs#CauchySeq via an equivalence).
This sounds like it would be a good result to PR, irrespective of whether it's the right thing to do here
Eric Wieser (Nov 22 2024 at 21:40):
Though maybe it's docs#CauchySeq.comp_injective ?
Michael Stoll (Nov 22 2024 at 21:42):
That is restricted to functions on Nat
and has an annoying Nonempty
assumption.
Michael Stoll (Nov 22 2024 at 21:43):
What I would need is something that works for functions defined on Finset <something>
.
Chris Birkbeck (Nov 22 2024 at 22:06):
does summable_prod_of_nonneg
help?
Chris Birkbeck (Nov 22 2024 at 22:07):
wait maybe that what you want?
Chris Birkbeck (Nov 22 2024 at 22:08):
Oh yeah thats it:
lemma Summable.prod_of_nonneg_of_summable_tsum {β γ : Type*} {f : β × γ → ℝ} (h₁ : ∀ x, 0 ≤ f x)
(h₂ : ∀ b, Summable fun c ↦ f (b, c)) (h₃ : Summable fun b ↦ ∑' c, f (b, c)) :
Summable f := by
rw [summable_prod_of_nonneg]
exact ⟨h₂, h₃⟩
apply h₁
Michael Stoll (Nov 23 2024 at 09:05):
I wonder why loogle doesn't find it:
@loogle ⊢ Summable _, ?α × ?β, 0 ≤ _
loogle (Nov 23 2024 at 09:05):
:search: Summable.mul_of_nonneg
Michael Stoll (Nov 23 2024 at 09:07):
@Joachim Breitner :up:
Sébastien Gouëzel (Nov 23 2024 at 09:12):
@loogle Summable, ?_ × ?_, 0 ≤ ?_
loogle (Nov 23 2024 at 09:12):
:search: summable_prod_of_nonneg, Summable.mul_of_nonneg
Sébastien Gouëzel (Nov 23 2024 at 09:13):
@loogle Summable _, ?α × ?β, 0 ≤ _
loogle (Nov 23 2024 at 09:13):
:search: summable_prod_of_nonneg, Summable.mul_of_nonneg
Sébastien Gouëzel (Nov 23 2024 at 09:14):
I copied your exact command, and now it works. Weird.
Sébastien Gouëzel (Nov 23 2024 at 09:14):
Ah no, it's not your exact command, I omitted ⊢
.
Sébastien Gouëzel (Nov 23 2024 at 09:15):
It's because the conclusion of the lemma is not that something is summable, it's an equivalence.
Michael Stoll (Nov 23 2024 at 10:00):
import Mathlib.Topology.Algebra.InfiniteSum.Real
lemma Summable.prod_of_nonneg_of_summable_tsum {β γ : Type*} {f : β × γ → ℝ} (h₁ : ∀ x, 0 ≤ f x)
(h₂ : ∀ b, Summable fun c ↦ f (b, c)) (h₃ : Summable fun b ↦ ∑' c, f (b, c)) :
Summable f :=
(summable_prod_of_nonneg h₁).mpr ⟨h₂, h₃⟩
Short enough to be inlined...
Michael Stoll (Nov 23 2024 at 10:09):
@Joachim Breitner Could loogle be taught to match ⊢ blah
also when the conclusion is an "iff" statement with blah
on one side?
Joachim Breitner (Nov 24 2024 at 18:18):
Michael Stoll said:
Joachim Breitner Could loogle be taught to match
⊢ blah
also when the conclusion is an "iff" statement withblah
on one side?
Plausible, but I’m reluctant to add too much heuristics and special cases. Should it do the same for =
?
You can find it this way as well (but you’d have to try both variants I guess).
@loogle ⊢ Summable _ ↔ _ , ?α × ?β, 0 ≤ _
Maybe once apply
does this for you I am more likely convinced that loogle should do this :-)
Anyways, noted down as https://github.com/nomeata/loogle/issues/23.
loogle (Nov 24 2024 at 18:18):
:search: summable_prod_of_nonneg
Michael Stoll (Nov 24 2024 at 18:20):
Joachim Breitner said:
Maybe once
apply
does this for you I am more likely convinced that loogle should do this :-)
apply?
does, I think.
Joachim Breitner (Nov 24 2024 at 18:20):
I sometimes wish apply
would. But maybe it’s one of the wishes I’d regret if it turned true :-)
Michael Stoll (Nov 24 2024 at 18:22):
It would make apply
a bit less efficient when it has to figure out which way it needs to use the lemma, I assume. But it would add a little bit of QoL.
Jireh Loreaux (Nov 24 2024 at 23:16):
@Michael Stoll Can you please add something about Tonelli's theorem to the docstring of summable_prod_of_nonneg
? I immediately thought of this result by name when I started reading this thread.
Michael Stoll (Nov 25 2024 at 09:17):
Tonelli's Theorem says that the corresponding sum and double sum are equal. I think docs#ENNReal.tsum_prod and docs#ENNReal.tsum_prod' are closest to that statement (and docs#tsum_prod and docs#tsum_prod' are variants of Fubini's Theorem). I agree that it would be good to mention Tonelli in a (so far non-existing) docstring, but then the same applies to the other statements. As I'm not really an expert in measure theory, I'd rather leave that task to somebody else (you? @Jireh Loreaux :smile:).
Johan Commelin (Nov 25 2024 at 09:22):
Didn't @Floris van Doorn and @Heather Macbeth have a project on Tonelli a while back? They might want to chime in.
Last updated: May 02 2025 at 03:31 UTC