Skip to content

Commit

Permalink
chore: make Integrable.of_finite have no explicit argument (#17323)
Browse files Browse the repository at this point in the history
This makes it really useful to fill in side conditions on the fly using anonymous dot notation. Also deprecate `Integrable.of_isEmpty` which is straightforwardly a special case of it (see eg `stronglyMeasurable_of_isEmpty` for a similar existing deprecation).

From PFR
  • Loading branch information
YaelDillies committed Oct 4, 2024
1 parent 170e58e commit 7596552
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions Mathlib/MeasureTheory/Function/L1Space.lean
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,13 @@ theorem integrable_const [IsFiniteMeasure μ] (c : β) : Integrable (fun _ : α
integrable_const_iff.2 <| Or.inr <| measure_lt_top _ _

@[simp]
theorem Integrable.of_finite [Finite α] [MeasurableSpace α] [MeasurableSingletonClass α]
(μ : Measure α) [IsFiniteMeasure μ] (f : α → β) : Integrable (fun a ↦ f a) μ :=
⟨(StronglyMeasurable.of_finite f).aestronglyMeasurable, .of_finite⟩
lemma Integrable.of_finite [Finite α] [MeasurableSingletonClass α] [IsFiniteMeasure μ] {f : α → β} :
Integrable f μ := ⟨.of_finite, .of_finite⟩

lemma Integrable.of_isEmpty [IsEmpty α] (f : α → β) (μ : Measure α) :
Integrable f μ := Integrable.of_finite μ f
/-- This lemma is a special case of `Integrable.of_finite`. -/
-- Eternal deprecation for discoverability, don't remove
@[deprecated Integrable.of_finite, nolint deprecatedNoSince]
lemma Integrable.of_isEmpty [IsEmpty α] {f : α → β} : Integrable f μ := .of_finite

@[deprecated (since := "2024-02-05")] alias integrable_of_fintype := Integrable.of_finite

Expand Down
6 changes: 3 additions & 3 deletions Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ theorem SimpleFunc.stronglyMeasurable {α β} {_ : MeasurableSpace α} [Topologi
@[nontriviality]
theorem StronglyMeasurable.of_finite [Finite α] {_ : MeasurableSpace α}
[MeasurableSingletonClass α] [TopologicalSpace β]
(f : α → β) : StronglyMeasurable f :=
{f : α → β} : StronglyMeasurable f :=
fun _ => SimpleFunc.ofFinite f, fun _ => tendsto_const_nhds⟩

@[deprecated (since := "2024-02-05")]
Expand All @@ -136,7 +136,7 @@ alias stronglyMeasurable_of_fintype := StronglyMeasurable.of_finite
@[deprecated StronglyMeasurable.of_finite (since := "2024-02-06")]
theorem stronglyMeasurable_of_isEmpty [IsEmpty α] {_ : MeasurableSpace α} [TopologicalSpace β]
(f : α → β) : StronglyMeasurable f :=
.of_finite f
.of_finite

theorem stronglyMeasurable_const {α β} {_ : MeasurableSpace α} [TopologicalSpace β] {b : β} :
StronglyMeasurable fun _ : α => b :=
Expand Down Expand Up @@ -1108,7 +1108,7 @@ variable {m : MeasurableSpace α} {μ ν : Measure α} [TopologicalSpace β] [To
{f g : α → β}

lemma of_finite [DiscreteMeasurableSpace α] [Finite α] : AEStronglyMeasurable f μ :=
⟨_, .of_finite _, ae_eq_rfl⟩
⟨_, .of_finite, ae_eq_rfl⟩

section Mk

Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Probability/ProbabilityMassFunction/Integrals.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ theorem integral_eq_tsum (p : PMF α) (f : α → E) (hf : Integrable f p.toMeas

theorem integral_eq_sum [Fintype α] (p : PMF α) (f : α → E) :
∫ a, f a ∂(p.toMeasure) = ∑ a, (p a).toReal • f a := by
rw [integral_fintype _ (.of_finite _ f)]
rw [integral_fintype _ .of_finite]
congr with x; congr 2
exact PMF.toMeasure_apply_singleton p x (MeasurableSet.singleton _)

Expand Down

0 comments on commit 7596552

Please sign in to comment.