Skip to content

Commit

Permalink
feat(measure_theory/integral): a few more integral lemmas (#14025)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgouezel committed May 8, 2022
1 parent e330694 commit 6a5d17e
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 10 deletions.
40 changes: 30 additions & 10 deletions src/measure_theory/integral/interval_integral.lean
Expand Up @@ -238,14 +238,21 @@ by split; simp
⟨(hab.1.union hbc.1).mono_set Ioc_subset_Ioc_union_Ioc,
(hbc.2.union hab.2).mono_set Ioc_subset_Ioc_union_Ioc⟩

lemma trans_iterate {a : ℕ → ℝ} {n : ℕ} (hint : ∀ k < n, interval_integrable f μ (a k) (a $ k+1)) :
interval_integrable f μ (a 0) (a n) :=
lemma trans_iterate_Ico {a : ℕ → ℝ} {m n : ℕ} (hmn : m ≤ n)
(hint : ∀ k ∈ Ico m n, interval_integrable f μ (a k) (a $ k+1)) :
interval_integrable f μ (a m) (a n) :=
begin
induction n with n hn,
revert hint,
refine nat.le_induction _ _ n hmn,
{ simp },
{ exact (hn (λ k hk, hint k (hk.trans n.lt_succ_self))).trans (hint n n.lt_succ_self) }
{ assume p hp IH h,
exact (IH (λ k hk, h k (Ico_subset_Ico_right p.le_succ hk))).trans (h p (by simp [hp])) }
end

lemma trans_iterate {a : ℕ → ℝ} {n : ℕ} (hint : ∀ k < n, interval_integrable f μ (a k) (a $ k+1)) :
interval_integrable f μ (a 0) (a n) :=
trans_iterate_Ico bot_le (λ k hk, hint k hk.2)

lemma neg (h : interval_integrable f μ a b) : interval_integrable (-f) μ a b :=
⟨h.1.neg, h.2.neg⟩

Expand Down Expand Up @@ -769,16 +776,29 @@ lemma integral_add_adjacent_intervals (hab : interval_integrable f μ a b)
∫ x in a..b, f x ∂μ + ∫ x in b..c, f x ∂μ = ∫ x in a..c, f x ∂μ :=
by rw [← add_neg_eq_zero, ← integral_symm, integral_add_adjacent_intervals_cancel hab hbc]

lemma sum_integral_adjacent_intervals_Ico {a : ℕ → ℝ} {m n : ℕ} (hmn : m ≤ n)
(hint : ∀ k ∈ Ico m n, interval_integrable f μ (a k) (a $ k+1)) :
∑ (k : ℕ) in finset.Ico m n, ∫ x in (a k)..(a $ k+1), f x ∂μ = ∫ x in (a m)..(a n), f x ∂μ :=
begin
revert hint,
refine nat.le_induction _ _ n hmn,
{ simp },
{ assume p hmp IH h,
rw [finset.sum_Ico_succ_top hmp, IH, integral_add_adjacent_intervals],
{ apply interval_integrable.trans_iterate_Ico hmp (λ k hk, h k _),
exact (Ico_subset_Ico le_rfl (nat.le_succ _)) hk },
{ apply h,
simp [hmp] },
{ assume k hk,
exact h _ (Ico_subset_Ico_right p.le_succ hk) } }
end

lemma sum_integral_adjacent_intervals {a : ℕ → ℝ} {n : ℕ}
(hint : ∀ k < n, interval_integrable f μ (a k) (a $ k+1)) :
∑ (k : ℕ) in finset.range n, ∫ x in (a k)..(a $ k+1), f x ∂μ = ∫ x in (a 0)..(a n), f x ∂μ :=
begin
induction n with n hn,
{ simp },
{ rw [finset.sum_range_succ, hn (λ k hk, hint k (hk.trans n.lt_succ_self))],
exact integral_add_adjacent_intervals
(interval_integrable.trans_iterate $ λ k hk, hint k (hk.trans n.lt_succ_self))
(hint n n.lt_succ_self) }
rw ← nat.Ico_zero_eq_range,
exact sum_integral_adjacent_intervals_Ico (zero_le n) (λ k hk, hint k hk.2),
end

lemma integral_interval_sub_left (hab : interval_integrable f μ a b)
Expand Down
18 changes: 18 additions & 0 deletions src/measure_theory/integral/set_integral.lean
Expand Up @@ -141,6 +141,24 @@ begin
... = ∫ x in s, f x ∂μ : by simp
end

lemma of_real_set_integral_one_of_measure_ne_top {α : Type*} {m : measurable_space α}
{μ : measure α} {s : set α} (hs : μ s ≠ ∞) :
ennreal.of_real (∫ x in s, (1 : ℝ) ∂μ) = μ s :=
calc
ennreal.of_real (∫ x in s, (1 : ℝ) ∂μ)
= ennreal.of_real (∫ x in s, ∥(1 : ℝ)∥ ∂μ) : by simp only [norm_one]
... = ∫⁻ x in s, 1 ∂μ :
begin
rw of_real_integral_norm_eq_lintegral_nnnorm (integrable_on_const.2 (or.inr hs.lt_top)),
simp only [nnnorm_one, ennreal.coe_one],
end
... = μ s : set_lintegral_one _

lemma of_real_set_integral_one {α : Type*} {m : measurable_space α} (μ : measure α)
[is_finite_measure μ] (s : set α) :
ennreal.of_real (∫ x in s, (1 : ℝ) ∂μ) = μ s :=
of_real_set_integral_one_of_measure_ne_top (measure_ne_top μ s)

lemma integral_piecewise [decidable_pred (∈ s)] (hs : measurable_set s)
{f g : α → E} (hf : integrable_on f s μ) (hg : integrable_on g sᶜ μ) :
∫ x, s.piecewise f g x ∂μ = ∫ x in s, f x ∂μ + ∫ x in sᶜ, g x ∂μ :=
Expand Down

0 comments on commit 6a5d17e

Please sign in to comment.