Documentation

Interval.EulerMaclaurin.Formula

The Euler-Maclaurin summation formula #

Let $E$ be a complete real normed space, let $a \le b$ be real numbers and let $p \ge 1$. Let $P_n(t) = B_n(\{t\})$ be the periodic Bernoulli function, which in Lean is periodizedBernoulli n, evaluated at the class of the real number $t$. For a function $f : \mathbb{R} \to E$ which is $C^p$ on $[a, b]$, $$\sum_{a < i \le b} f(i) = \int_a^b f(t) , dt

The proof integrates by parts against the polynomial t ↦ bernoulliFun (k + 1) (t - c), so the corners of the periodic function never enter an integral. On an interval containing no integer this gives the formula with an empty sum; across one integer it produces that integer's term; the general case is an induction on the number of integers in (a, b]. The derivatives are taken within [a, b], so they are one-sided only at the end points, and the last one need only be interval integrable.

Main results #

References #

theorem ContDiffWithinAt.hasDerivWithinAt_iteratedDerivWithin {𝕜 : Type u_1} [NontriviallyNormedField 𝕜] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {f : 𝕜 → F} {s : Set 𝕜} {x : 𝕜} {n : WithTop ℕ∞} {m : ℕ} (h : ContDiffWithinAt 𝕜 n f s x) (hmn : ↑m < n) (hs : UniqueDiffOn 𝕜 (insert x s)) :

On a set with unique derivatives, the m-th iterated derivative of a function which is C^n within the set at x, m < n, has the (m + 1)-th iterated derivative as its derivative within the set at x.

theorem ContDiffOn.hasDerivWithinAt_iteratedDerivWithin {𝕜 : Type u_1} [NontriviallyNormedField 𝕜] {F : Type u_2} [NormedAddCommGroup F] [NormedSpace 𝕜 F] {f : 𝕜 → F} {s : Set 𝕜} {x : 𝕜} {n : WithTop ℕ∞} {m : ℕ} (h : ContDiffOn 𝕜 n f s) (hmn : ↑m < n) (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :

On a set with unique derivatives, the m-th iterated derivative of a C^n function, m < n, has the (m + 1)-th iterated derivative as its derivative within the set at every point of the set.

theorem EulerMaclaurin.sum_Ioc_eq_integral_add_of_hasDerivWithinAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {p : ℕ} (hp : p ≠ 0) {F : ℕ → ℝ → E} {a b : ℝ} (hab : a ≤ b) (hF : ∀ k < p, ∀ x ∈ Set.Icc a b, HasDerivWithinAt (F k) (F (k + 1) x) (Set.Icc a b) x) (hFp : IntervalIntegrable (F p) MeasureTheory.volume a b) :
∑ i ∈ Finset.Ioc ⌊a⌋ ⌊b⌋, F 0 ↑i = (∫ (t : ℝ) in a..b, F 0 t) + ∑ k ∈ Finset.range p, ((-1) ^ (k + 1) / ↑(k + 1).factorial) • (periodizedBernoulli (k + 1) ↑b • F k b - periodizedBernoulli (k + 1) ↑a • F k a) + ((-1) ^ (p + 1) / ↑p.factorial) • ∫ (t : ℝ) in a..b, periodizedBernoulli p ↑t • F p t

The Euler-Maclaurin summation formula for real end points, for a family F : ℕ → ℝ → E of successive derivatives. Let a ≤ b be real numbers, p ≥ 1, and suppose that for k < p the function F k has derivative F (k + 1) within [a, b], and that F p is interval integrable on [a, b]. Then the sum of F 0 i over the integers i ∈ (a, b] equals $$\int_a^b F_0 + \sum_{k < p} \frac{(-1)^{k + 1}}{(k + 1)!} \bigl(P_{k + 1}(b) F_k(b) - P_{k + 1}(a) F_k(a)\bigr)

  • \frac{(-1)^{p + 1}}{p!} \int_a^b P_p F_p,$$ where P_n = periodizedBernoulli n, evaluated at the class of a real number.
theorem EulerMaclaurin.sum_Ioc_eq_integral_add {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f : ℝ → E} {p : ℕ} (hp : p ≠ 0) {a b : ℝ} (hab : a ≤ b) (hf : ContDiffOn ℝ (↑p) f (Set.Icc a b)) :
∑ i ∈ Finset.Ioc ⌊a⌋ ⌊b⌋, f ↑i = (∫ (t : ℝ) in a..b, f t) + ∑ k ∈ Finset.range p, ((-1) ^ (k + 1) / ↑(k + 1).factorial) • (periodizedBernoulli (k + 1) ↑b • iteratedDerivWithin k f (Set.Icc a b) b - periodizedBernoulli (k + 1) ↑a • iteratedDerivWithin k f (Set.Icc a b) a) + ((-1) ^ (p + 1) / ↑p.factorial) • ∫ (t : ℝ) in a..b, periodizedBernoulli p ↑t • iteratedDerivWithin p f (Set.Icc a b) t

The Euler-Maclaurin summation formula for real end points and a C^p function. Let a ≤ b be real numbers and p ≥ 1. If f is C^p on [a, b], then the sum of f i over the integers i ∈ (a, b] equals $$\int_a^b f + \sum_{k < p} \frac{(-1)^{k + 1}}{(k + 1)!} \bigl(P_{k + 1}(b) f^{(k)}(b) - P_{k + 1}(a) f^{(k)}(a)\bigr)

theorem EulerMaclaurin.sum_Ioc_int_eq_integral_add_of_hasDerivWithinAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {p : ℕ} (hp : p ≠ 0) {F : ℕ → ℝ → E} {a b : ℤ} (hab : a ≤ b) (hF : ∀ k < p, ∀ x ∈ Set.Icc ↑a ↑b, HasDerivWithinAt (F k) (F (k + 1) x) (Set.Icc ↑a ↑b) x) (hFp : IntervalIntegrable (F p) MeasureTheory.volume ↑a ↑b) :
∑ i ∈ Finset.Ioc a b, F 0 ↑i = (∫ (t : ℝ) in ↑a..↑b, F 0 t) + ∑ k ∈ Finset.range p, (↑(bernoulli' (k + 1)) / ↑(k + 1).factorial) • (F k ↑b - F k ↑a) + ((-1) ^ (p + 1) / ↑p.factorial) • ∫ (t : ℝ) in ↑a..↑b, periodizedBernoulli p ↑t • F p t

The Euler-Maclaurin summation formula for integer end points, for a family F : ℕ → ℝ → E of successive derivatives. Let a ≤ b be integers, p ≥ 1, and suppose that for k < p the function F k has derivative F (k + 1) within [a, b], and that F p is interval integrable on [a, b]. Then ∑ i ∈ Finset.Ioc a b, F 0 i equals $$\int_a^b F_0 + \sum_{k < p} \frac{B'_{k + 1}}{(k + 1)!} (F_k(b) - F_k(a))