Skip to content

Commit

Permalink
feat(measure_theory/interval_integral) : add integration by parts (#5724
Browse files Browse the repository at this point in the history
)

A direct application of FTC-2 for interval_integral.




Co-authored-by: Benjamin Davidson <68528197+benjamindavidson@users.noreply.github.com>
Co-authored-by: Rob Lewis <Rob.y.lewis@gmail.com>
  • Loading branch information
3 people committed Jan 22, 2021
1 parent de10203 commit 0feb1d2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
41 changes: 40 additions & 1 deletion src/measure_theory/interval_integral.lean
Expand Up @@ -408,6 +408,12 @@ section order_closed_topology

variables [order_closed_topology α]

/-- If two functions are equal in the relevant interval, their interval integrals are also equal. -/
lemma integral_congr {a b : α} {f g : α → E} (h : eq_on f g (interval a b)) :
∫ x in a..b, f x ∂μ = ∫ x in a..b, g x ∂μ :=
by cases le_total a b with hab hab; simpa [hab, integral_of_le, integral_of_ge]
using set_integral_congr is_measurable_Ioc (h.mono Ioc_subset_Icc_self)

lemma integral_add_adjacent_intervals_cancel (hab : interval_integrable f μ a b)
(hbc : interval_integrable f μ b c) :
∫ x in a..b, f x ∂μ + ∫ x in b..c, f x ∂μ + ∫ x in c..a, f x ∂μ = 0 :=
Expand Down Expand Up @@ -1273,7 +1279,7 @@ lemma deriv_within_integral_left
This section contains theorems pertaining to FTC-2 for interval integrals. -/

variables {f' : ℝ → E}
variable {f' : ℝ → E}

/-- The integral of a continuous function is differentiable on a real set `s`. -/
theorem differentiable_on_integral_of_continuous {s : set ℝ}
Expand Down Expand Up @@ -1375,4 +1381,37 @@ theorem integral_deriv_eq_sub (hderiv : ∀ x ∈ interval a b, differentiable_a
∫ y in a..b, deriv f y = f b - f a :=
integral_eq_sub_of_has_deriv_at (λ x hx, (hderiv x hx).has_deriv_at) hcont'

/-!
### Integration by parts
-/

lemma integral_deriv_mul_eq_sub {u v u' v' : ℝ → ℝ}
(hu : ∀ x ∈ interval a b, has_deriv_at u (u' x) x)
(hv : ∀ x ∈ interval a b, has_deriv_at v (v' x) x)
(hcu' : continuous_on u' (interval a b)) (hcv' : continuous_on v' (interval a b)) :
∫ x in a..b, u' x * v x + u x * v' x = u b * v b - u a * v a :=
begin
have hcu : continuous_on u _ := λ x hx, (hu x hx).continuous_at.continuous_within_at,
have hcv : continuous_on v _ := λ x hx, (hv x hx).continuous_at.continuous_within_at,
rw integral_eq_sub_of_has_deriv_at,
intros x hx;
{ exact (hu x hx).mul (hv x hx) },
{ exact (hcu'.mul hcv).add (hcu.mul hcv') }
end

theorem integral_mul_deriv_eq_deriv_mul {u v u' v' : ℝ → ℝ}
(hu : ∀ x ∈ interval a b, has_deriv_at u (u' x) x)
(hv : ∀ x ∈ interval a b, has_deriv_at v (v' x) x)
(hcu' : continuous_on u' (interval a b)) (hcv' : continuous_on v' (interval a b)) :
∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, v x * u' x :=
begin
have hcu : continuous_on u _ := λ x hx, (hu x hx).continuous_at.continuous_within_at,
have hcv : continuous_on v _ := λ x hx, (hv x hx).continuous_at.continuous_within_at,
rw [← integral_deriv_mul_eq_sub hu hv hcu' hcv', ← integral_sub],
{ apply integral_congr,
exact λ x hx, by simp [mul_comm] },
{ exact ((hcu'.mul hcv).add (hcu.mul hcv')).interval_integrable },
{ exact (hcv.mul hcu').interval_integrable },
end

end interval_integral
6 changes: 5 additions & 1 deletion src/measure_theory/measure_space.lean
Expand Up @@ -1360,8 +1360,12 @@ ae_eq_bot.trans restrict_eq_zero
@[simp] lemma ae_restrict_ne_bot {s} : (μ.restrict s).ae.ne_bot ↔ 0 < μ s :=
(not_congr ae_restrict_eq_bot).trans pos_iff_ne_zero.symm

lemma self_mem_ae_restrict {s} (hs : is_measurable s) : s ∈ (μ.restrict s).ae :=
by simp only [ae_restrict_eq hs, exists_prop, mem_principal_sets, mem_inf_sets];
exact ⟨_, univ_mem_sets, s, by rw [univ_inter, and_self]⟩

/-- A version of the Borel-Cantelli lemma: if `sᵢ` is a sequence of measurable sets such that
`∑ μ sᵢ` exists, then for almost all `x`, `x` does not belong to almost all `s`ᵢ. -/
`∑ μ sᵢ` exists, then for almost all `x`, `x` does not belong to almost all `sᵢ`. -/
lemma ae_eventually_not_mem {s : ℕ → set α} (hs : ∀ i, is_measurable (s i))
(hs' : ∑' i, μ (s i) ≠ ⊤) : ∀ᵐ x ∂ μ, ∀ᶠ n in at_top, x ∉ s n :=
begin
Expand Down

0 comments on commit 0feb1d2

Please sign in to comment.