File: Mathlib/MeasureTheory/Function/ConditionalExpectation/Basic.lean

full_name: MeasureTheory.condexp
code: /-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
    (μ : Measure α) (f : α → F') : α → F' 
goal: α → F'

full_name: MeasureTheory.condexp_def
code: /-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
    (μ : Measure α) (f : α → F') : α → F' 
goal: μ[f|m] =
  if hm : m ≤ m0 then
    if h : MeasureTheory.SigmaFinite (μ.trim hm) ∧ MeasureTheory.Integrable f μ then
      if MeasureTheory.StronglyMeasurable f then f
      else MeasureTheory.AEStronglyMeasurable'.mk ↑↑(MeasureTheory.condexpL1 hm μ f) ⋯
    else 0
  else 0

full_name: MeasureTheory.definition._@.Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic._hyg.107
code: /-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
    (μ : Measure α) (f : α → F') : α → F' 
goal: α → F'

full_name: MeasureTheory.wrapped._@.Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic._hyg.107
code: /-- Conditional expectation of a function. It is defined as 0 if any one of the following conditions
is true:
- `m` is not a sub-σ-algebra of `m0`,
- `μ` is not σ-finite with respect to `m`,
- `f` is not integrable. -/
noncomputable irreducible_def condexp (m : MeasurableSpace α) {m0 : MeasurableSpace α}
    (μ : Measure α) (f : α → F') : α → F' 
goal: Subtype (Eq @MeasureTheory.definition✝)

full_name: MeasureTheory._aux_Mathlib_MeasureTheory_Function_ConditionalExpectation_Basic___unexpand_MeasureTheory_condexp_1
code: scoped notation μ "[" f "|" m "]" => MeasureTheory.condexp m μ f
goal: Lean.PrettyPrinter.Unexpander

full_name: MeasureTheory.«_aux_Mathlib_MeasureTheory_Function_ConditionalExpectation_Basic___macroRules_MeasureTheory_term_[_|_]_1»
code: scoped notation μ "[" f "|" m "]" => MeasureTheory.condexp m μ f
goal: Lean.Macro

full_name: MeasureTheory.condexp_of_not_le
code: theorem condexp_of_not_le (hm_not : ¬m ≤ m0) : μ[f|m] = 0 
goal: μ[f|m] = 0

full_name: MeasureTheory.condexp_of_not_sigmaFinite
code: theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
    μ[f|m] = 0 
goal: μ[f|m] = 0

full_name: MeasureTheory.condexp_of_sigmaFinite
code: theorem condexp_of_sigmaFinite (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
    μ[f|m] =
      if Integrable f μ then
        if StronglyMeasurable[m] f then f
        else aestronglyMeasurable'_condexpL1.mk (condexpL1 hm μ f)
      else 0 
goal: μ[f|m] =
  if MeasureTheory.Integrable f μ then
    if MeasureTheory.StronglyMeasurable f then f
    else MeasureTheory.AEStronglyMeasurable'.mk ↑↑(MeasureTheory.condexpL1 hm μ f) ⋯
  else 0

full_name: MeasureTheory.condexp_of_stronglyMeasurable
code: theorem condexp_of_stronglyMeasurable (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : StronglyMeasurable[m] f) (hfi : Integrable f μ) : μ[f|m] = f 
goal: μ[f|m] = f

full_name: MeasureTheory.condexp_const
code: theorem condexp_const (hm : m ≤ m0) (c : F') [IsFiniteMeasure μ] :
    μ[fun _ : α => c|m] = fun _ => c 
goal: μ[fun x => c|m] = fun x => c

full_name: MeasureTheory.condexp_ae_eq_condexpL1
code: theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f 
goal: μ[f|m] =ᵐ[μ] ↑↑(MeasureTheory.condexpL1 hm μ f)

full_name: MeasureTheory.condexp_ae_eq_condexpL1CLM
code: theorem condexp_ae_eq_condexpL1CLM (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    μ[f|m] =ᵐ[μ] condexpL1CLM F' hm μ (hf.toL1 f) 
goal: μ[f|m] =ᵐ[μ] ↑↑((MeasureTheory.condexpL1CLM F' hm μ) (MeasureTheory.Integrable.toL1 f hf))

full_name: MeasureTheory.condexp_undef
code: theorem condexp_undef (hf : ¬Integrable f μ) : μ[f|m] = 0 
goal: μ[f|m] = 0

full_name: MeasureTheory.condexp_zero
code: @[simp]
theorem condexp_zero : μ[(0 : α → F')|m] = 0 
goal: μ[0|m] = 0

full_name: MeasureTheory.stronglyMeasurable_condexp
code: theorem stronglyMeasurable_condexp : StronglyMeasurable[m] (μ[f|m]) 
goal: MeasureTheory.StronglyMeasurable (μ[f|m])

full_name: MeasureTheory.condexp_congr_ae
code: theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m] 
goal: μ[f|m] =ᵐ[μ] μ[g|m]

full_name: MeasureTheory.condexp_of_aestronglyMeasurable'
code: theorem condexp_of_aestronglyMeasurable' (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : AEStronglyMeasurable' m f μ) (hfi : Integrable f μ) : μ[f|m] =ᵐ[μ] f 
goal: μ[f|m] =ᵐ[μ] f

full_name: MeasureTheory.integrable_condexp
code: theorem integrable_condexp : Integrable (μ[f|m]) μ 
goal: MeasureTheory.Integrable (μ[f|m]) μ

full_name: MeasureTheory.setIntegral_condexp
code: /-- The integral of the conditional expectation `μ[f|hm]` over an `m`-measurable set is equal to
the integral of `f` on that set. -/
theorem setIntegral_condexp (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ)
    (hs : MeasurableSet[m] s) : ∫ x in s, (μ[f|m]) x ∂μ = ∫ x in s, f x ∂μ 
goal: ∫ (x : α) in s, (μ[f|m]) x ∂μ = ∫ (x : α) in s, f x ∂μ

full_name: MeasureTheory.integral_condexp
code: theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ 
goal: ∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ

full_name: MeasureTheory.integral_condexp_indicator
code: /-- Total probability law using `condexp` as conditional probability. -/
theorem integral_condexp_indicator [mF : MeasurableSpace F] {Y : α → F} (hY : Measurable Y)
    [SigmaFinite (μ.trim hY.comap_le)] {A : Set α} (hA : MeasurableSet A) :
    ∫ x, (μ[(A.indicator fun _ ↦ (1 : ℝ)) | mF.comap Y]) x ∂μ = (μ A).toReal 
goal: ∫ (x : α), (μ[A.indicator fun x => 1|MeasurableSpace.comap Y mF]) x ∂μ = (μ A).toReal

full_name: MeasureTheory.ae_eq_condexp_of_forall_setIntegral_eq
code: /-- **Uniqueness of the conditional expectation**
If a function is a.e. `m`-measurable, verifies an integrability condition and has same integral
as `f` on all `m`-measurable sets, then it is a.e. equal to `μ[f|hm]`. -/
theorem ae_eq_condexp_of_forall_setIntegral_eq (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    {f g : α → F'} (hf : Integrable f μ)
    (hg_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn g s μ)
    (hg_eq : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, g x ∂μ = ∫ x in s, f x ∂μ)
    (hgm : AEStronglyMeasurable' m g μ) : g =ᵐ[μ] μ[f|m] 
goal: g =ᵐ[μ] μ[f|m]

full_name: MeasureTheory.condexp_bot'
code: theorem condexp_bot' [hμ : NeZero μ] (f : α → F') :
    μ[f|⊥] = fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ 
goal: μ[f|⊥] = fun x => (μ Set.univ).toReal⁻¹ • ∫ (x : α), f x ∂μ

full_name: MeasureTheory.condexp_bot_ae_eq
code: theorem condexp_bot_ae_eq (f : α → F') :
    μ[f|⊥] =ᵐ[μ] fun _ => (μ Set.univ).toReal⁻¹ • ∫ x, f x ∂μ 
goal: μ[f|⊥] =ᵐ[μ] fun x => (μ Set.univ).toReal⁻¹ • ∫ (x : α), f x ∂μ

full_name: MeasureTheory.condexp_bot
code: theorem condexp_bot [IsProbabilityMeasure μ] (f : α → F') : μ[f|⊥] = fun _ => ∫ x, f x ∂μ 
goal: μ[f|⊥] = fun x => ∫ (x : α), f x ∂μ

full_name: MeasureTheory.condexp_add
code: theorem condexp_add (hf : Integrable f μ) (hg : Integrable g μ) :
    μ[f + g|m] =ᵐ[μ] μ[f|m] + μ[g|m] 
goal: μ[f + g|m] =ᵐ[μ] μ[f|m] + μ[g|m]

full_name: MeasureTheory.condexp_finset_sum
code: theorem condexp_finset_sum {ι : Type*} {s : Finset ι} {f : ι → α → F'}
    (hf : ∀ i ∈ s, Integrable (f i) μ) : μ[∑ i ∈ s, f i|m] =ᵐ[μ] ∑ i ∈ s, μ[f i|m] 
goal: μ[∑ i ∈ s, f i|m] =ᵐ[μ] ∑ i ∈ s, μ[f i|m]

full_name: MeasureTheory.condexp_smul
code: theorem condexp_smul (c : 𝕜) (f : α → F') : μ[c • f|m] =ᵐ[μ] c • μ[f|m] 
goal: μ[c • f|m] =ᵐ[μ] c • μ[f|m]

full_name: MeasureTheory.condexp_neg
code: theorem condexp_neg (f : α → F') : μ[-f|m] =ᵐ[μ] -μ[f|m] 
goal: μ[-f|m] =ᵐ[μ] -μ[f|m]

full_name: MeasureTheory.condexp_sub
code: theorem condexp_sub (hf : Integrable f μ) (hg : Integrable g μ) :
    μ[f - g|m] =ᵐ[μ] μ[f|m] - μ[g|m] 
goal: μ[f - g|m] =ᵐ[μ] μ[f|m] - μ[g|m]

full_name: MeasureTheory.condexp_condexp_of_le
code: theorem condexp_condexp_of_le {m₁ m₂ m0 : MeasurableSpace α} {μ : Measure α} (hm₁₂ : m₁ ≤ m₂)
    (hm₂ : m₂ ≤ m0) [SigmaFinite (μ.trim hm₂)] : μ[μ[f|m₂]|m₁] =ᵐ[μ] μ[f|m₁] 
goal: μ[μ[f|m₂]|m₁] =ᵐ[μ] μ[f|m₁]

full_name: MeasureTheory.condexp_mono
code: theorem condexp_mono {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
    [OrderedSMul ℝ E] {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
    μ[f|m] ≤ᵐ[μ] μ[g|m] 
goal: μ[f|m] ≤ᵐ[μ] μ[g|m]

full_name: MeasureTheory.condexp_nonneg
code: theorem condexp_nonneg {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
    [OrderedSMul ℝ E] {f : α → E} (hf : 0 ≤ᵐ[μ] f) : 0 ≤ᵐ[μ] μ[f|m] 
goal: 0 ≤ᵐ[μ] μ[f|m]

full_name: MeasureTheory.condexp_nonpos
code: theorem condexp_nonpos {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
    [OrderedSMul ℝ E] {f : α → E} (hf : f ≤ᵐ[μ] 0) : μ[f|m] ≤ᵐ[μ] 0 
goal: μ[f|m] ≤ᵐ[μ] 0

full_name: MeasureTheory.tendsto_condexpL1_of_dominated_convergence
code: /-- **Lebesgue dominated convergence theorem**: sufficient conditions under which almost
  everywhere convergence of a sequence of functions implies the convergence of their image by
  `condexpL1`. -/
theorem tendsto_condexpL1_of_dominated_convergence (hm : m ≤ m0) [SigmaFinite (μ.trim hm)]
    {fs : ℕ → α → F'} {f : α → F'} (bound_fs : α → ℝ)
    (hfs_meas : ∀ n, AEStronglyMeasurable (fs n) μ) (h_int_bound_fs : Integrable bound_fs μ)
    (hfs_bound : ∀ n, ∀ᵐ x ∂μ, ‖fs n x‖ ≤ bound_fs x)
    (hfs : ∀ᵐ x ∂μ, Tendsto (fun n => fs n x) atTop (𝓝 (f x))) :
    Tendsto (fun n => condexpL1 hm μ (fs n)) atTop (𝓝 (condexpL1 hm μ f)) 
goal: Filter.Tendsto (fun n => MeasureTheory.condexpL1 hm μ (fs n)) Filter.atTop (𝓝 (MeasureTheory.condexpL1 hm μ f))

full_name: MeasureTheory.tendsto_condexp_unique
code: /-- If two sequences of functions have a.e. equal conditional expectations at each step, converge
and verify dominated convergence hypotheses, then the conditional expectations of their limits are
a.e. equal. -/
theorem tendsto_condexp_unique (fs gs : ℕ → α → F') (f g : α → F')
    (hfs_int : ∀ n, Integrable (fs n) μ) (hgs_int : ∀ n, Integrable (gs n) μ)
    (hfs : ∀ᵐ x ∂μ, Tendsto (fun n => fs n x) atTop (𝓝 (f x)))
    (hgs : ∀ᵐ x ∂μ, Tendsto (fun n => gs n x) atTop (𝓝 (g x))) (bound_fs : α → ℝ)
    (h_int_bound_fs : Integrable bound_fs μ) (bound_gs : α → ℝ)
    (h_int_bound_gs : Integrable bound_gs μ) (hfs_bound : ∀ n, ∀ᵐ x ∂μ, ‖fs n x‖ ≤ bound_fs x)
    (hgs_bound : ∀ n, ∀ᵐ x ∂μ, ‖gs n x‖ ≤ bound_gs x) (hfg : ∀ n, μ[fs n|m] =ᵐ[μ] μ[gs n|m]) :
    μ[f|m] =ᵐ[μ] μ[g|m] 
goal: μ[f|m] =ᵐ[μ] μ[g|m]