Zulip Chat Archive
Stream: Is there code for X?
Topic: Partial summation
Alex Kontorovich (Feb 27 2024 at 19:52):
Do we have partial summation, something like: If has continuous derivative in and is the floor function, then
?
Alex Kontorovich (Feb 27 2024 at 20:13):
Here's a formal statement, FYI:
import Mathlib.Analysis.Calculus.ContDiff.Defs
import Mathlib.MeasureTheory.Integral.IntervalIntegral
import Mathlib.Analysis.Calculus.Deriv.Basic
open BigOperators
def funCoe (φ : ℝ → ℂ) : ℤ → ℂ := fun n ↦ φ n
/-- ** Partial summation ** -/
theorem sum_eq_int_deriv (φ : ℝ → ℂ) (a b : ℝ) (φDiff : ContDiffOn ℝ 1 φ (Set.Icc a b)) :
(Finset.Icc (⌊a⌋ + 1) ⌊b⌋).sum (funCoe φ) =
(∫ x in a..b, φ x) + (⌊b⌋ + 1 / 2 - b) * φ b - (⌊a⌋ + 1 / 2 - a) * φ a
- ∫ x in a..b, (⌊x⌋ + 1 / 2 - x) * deriv φ x := by
sorry
Of course exact?
doesn't work, so I'm guessing the answer is No?
Alex Kontorovich (Feb 27 2024 at 20:16):
Also (and this may be related to the ongoing L-series discussion...), is there a better way to implement that funCoe
? Why doesn't Lean know that if I have a function ℝ → ℂ
but I'm looking for a function ℤ → ℂ
, I can compose with the coercion ℤ → ℝ
...?
Floris van Doorn (Feb 27 2024 at 20:37):
If you write fun n ↦ φ n
(instead of φ
) on the place where you wrote funCoe φ
, then Lean is able to insert a coercion.
Floris van Doorn (Feb 27 2024 at 20:40):
Or even better, ∑ n in Finset.Icc (⌊a⌋ + 1) ⌊b⌋, φ n
for the LHS.
Alex Kontorovich (Feb 27 2024 at 20:59):
But as far as the theorem, it looks like it's not in Mathlib, right?
David Loeffler (Feb 28 2024 at 09:16):
This is the "k = 1" case of the Euler-Maclaurin summation formula using Bernoulli polynomials, isn't it? I don't recall anything about this in the bernoulli
files. It's something that's been on my radar for a while, as an accessible but not-yet-done project.
Alex Kontorovich (Feb 28 2024 at 14:45):
Well, yes it is, but I was hoping nobody would notice... :) Because now we'll say, "oh we shouldn't bother doing partial summation in Mathlib, we should have the full Euler-Maclaurin" and then neither will get done...
Antoine Chambert-Loir (Feb 29 2024 at 21:25):
That would be a nice project for LFTC 2024 in a few weeks, @Riccardo Brasca
Riccardo Brasca (Feb 29 2024 at 21:27):
I am a little afraid of showing beginners all the troubles we have when manipulating sums, but with the help of an expert it is surely doable!
Geoffrey Irving (Dec 09 2024 at 20:51):
I did the Euler-Maclaurin formula:
Last updated: May 02 2025 at 03:31 UTC