l3lab/ntp-mathlib huggingface dataset:
/-- The **Cauchy-Davenport Theorem** for linearly ordered cancellative semigroups. The size of
`s * t` is lower-bounded by `|s| + |t| - 1`. -/
@[to_additive
"The **Cauchy-Davenport theorem** for linearly ordered additive cancellative semigroups. The size of
`s + t` is lower-bounded by `|s| + |t| - 1`."]
lemma Finset.card_add_card_sub_one_le_card_mul [LinearOrder α] [Semigroup α] [IsCancelMul α]
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    {s t : Finset α} (hs : s.Nonempty) (ht : t.Nonempty) : s.card + t.card - 1 ≤ (s * t).card := by
  suffices s * {t.min' ht} ∩ ({s.max' hs} * t) = {s.max' hs * t.min' ht} by
    rw [← card_singleton_mul t (s.max' hs), ← card_mul_singleton s (t.min' ht),
      ← card_union_add_card_inter, ← card_singleton _, ← this, Nat.add_sub_cancel]
    exact card_mono (union_subset (mul_subset_mul_left <| singleton_subset_iff.2 <| min'_mem _ _) <|
      mul_subset_mul_right <| singleton_subset_iff.2 <| max'_mem _ _)
  

Proof state:
α : Type u_1
inst✝⁴ : LinearOrder α
inst✝³ : Semigroup α
inst✝² : IsCancelMul α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
s t : Finset α
hs : Finset.Nonempty s
ht : Finset.Nonempty t
⊢ s * {min' t ht} ∩ ({max' s hs} * t) = {max' s hs * min' t ht}

Next tactic:
refine' eq_singleton_iff_unique_mem.2 ⟨mem_inter.2 ⟨mul_mem_mul (max'_mem _ _) <|
    mem_singleton_self _, mul_mem_mul (mem_singleton_self _) <| min'_mem _ _⟩, _⟩
/-- The **Cauchy-Davenport Theorem** for linearly ordered cancellative semigroups. The size of
`s * t` is lower-bounded by `|s| + |t| - 1`. -/
@[to_additive
"The **Cauchy-Davenport theorem** for linearly ordered additive cancellative semigroups. The size of
`s + t` is lower-bounded by `|s| + |t| - 1`."]
lemma Finset.card_add_card_sub_one_le_card_mul [LinearOrder α] [Semigroup α] [IsCancelMul α]
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    {s t : Finset α} (hs : s.Nonempty) (ht : t.Nonempty) : s.card + t.card - 1 ≤ (s * t).card := by
  suffices s * {t.min' ht} ∩ ({s.max' hs} * t) = {s.max' hs * t.min' ht} by
    rw [← card_singleton_mul t (s.max' hs), ← card_mul_singleton s (t.min' ht),
      ← card_union_add_card_inter, ← card_singleton _, ← this, Nat.add_sub_cancel]
    exact card_mono (union_subset (mul_subset_mul_left <| singleton_subset_iff.2 <| min'_mem _ _) <|
      mul_subset_mul_right <| singleton_subset_iff.2 <| max'_mem _ _)
  refine' eq_singleton_iff_unique_mem.2 ⟨mem_inter.2 ⟨mul_mem_mul (max'_mem _ _) <|
    mem_singleton_self _, mul_mem_mul (mem_singleton_self _) <| min'_mem _ _⟩, _⟩
  

Proof state:
α : Type u_1
inst✝⁴ : LinearOrder α
inst✝³ : Semigroup α
inst✝² : IsCancelMul α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
s t : Finset α
hs : Finset.Nonempty s
ht : Finset.Nonempty t
⊢ ∀ x ∈ s * {min' t ht} ∩ ({max' s hs} * t), x = max' s hs * min' t ht

Next tactic:
simp only [mem_inter, and_imp, mem_mul, mem_singleton, exists_and_left, exists_eq_left,
    forall_exists_index, and_imp, forall_apply_eq_imp_iff₂, mul_left_inj]
/-- The **Cauchy-Davenport Theorem** for linearly ordered cancellative semigroups. The size of
`s * t` is lower-bounded by `|s| + |t| - 1`. -/
@[to_additive
"The **Cauchy-Davenport theorem** for linearly ordered additive cancellative semigroups. The size of
`s + t` is lower-bounded by `|s| + |t| - 1`."]
lemma Finset.card_add_card_sub_one_le_card_mul [LinearOrder α] [Semigroup α] [IsCancelMul α]
    [CovariantClass α α (· * ·) (· ≤ ·)] [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    {s t : Finset α} (hs : s.Nonempty) (ht : t.Nonempty) : s.card + t.card - 1 ≤ (s * t).card := by
  suffices s * {t.min' ht} ∩ ({s.max' hs} * t) = {s.max' hs * t.min' ht} by
    rw [← card_singleton_mul t (s.max' hs), ← card_mul_singleton s (t.min' ht),
      ← card_union_add_card_inter, ← card_singleton _, ← this, Nat.add_sub_cancel]
    exact card_mono (union_subset (mul_subset_mul_left <| singleton_subset_iff.2 <| min'_mem _ _) <|
      mul_subset_mul_right <| singleton_subset_iff.2 <| max'_mem _ _)
  refine' eq_singleton_iff_unique_mem.2 ⟨mem_inter.2 ⟨mul_mem_mul (max'_mem _ _) <|
    mem_singleton_self _, mul_mem_mul (mem_singleton_self _) <| min'_mem _ _⟩, _⟩
  simp only [mem_inter, and_imp, mem_mul, mem_singleton, exists_and_left, exists_eq_left,
    forall_exists_index, and_imp, forall_apply_eq_imp_iff₂, mul_left_inj]
  

Proof state:
α : Type u_1
inst✝⁴ : LinearOrder α
inst✝³ : Semigroup α
inst✝² : IsCancelMul α
inst✝¹ : CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
inst✝ : CovariantClass α α (swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1
s t : Finset α
hs : Finset.Nonempty s
ht : Finset.Nonempty t
⊢ ∀ a ∈ s, ∀ x ∈ t, max' s hs * x = a * min' t ht → a = max' s hs

Next tactic:
exact fun a' ha' b' hb' h ↦ (le_max' _ _ ha').eq_of_not_lt fun ha ↦
    ((mul_lt_mul_right' ha _).trans_eq' h).not_le <| mul_le_mul_left' (min'_le _ _ hb') _
theorem condexp_of_not_le (hm_not : ¬m ≤ m0) : μ[f|m] = 0 := by 

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm_not : ¬m ≤ m0
⊢ μ[f|m] = 0

Next tactic:
rw [condexp, dif_neg hm_not]
theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
    μ[f|m] = 0 := by 

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm_not : ¬SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] = 0

Next tactic:
rw [condexp, dif_pos hm, dif_neg]
theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
    μ[f|m] = 0 := by rw [condexp, dif_pos hm, dif_neg]; 

Proof state:
case hnc
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm_not : ¬SigmaFinite (Measure.trim μ hm)
⊢ ¬(SigmaFinite (Measure.trim μ hm) ∧ Integrable f)

Next tactic:
push_neg
theorem condexp_of_not_sigmaFinite (hm : m ≤ m0) (hμm_not : ¬SigmaFinite (μ.trim hm)) :
    μ[f|m] = 0 := by rw [condexp, dif_pos hm, dif_neg]; push_neg; 

Proof state:
case hnc
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm_not : ¬SigmaFinite (Measure.trim μ hm)
⊢ SigmaFinite (Measure.trim μ hm) → ¬Integrable f

Next tactic:
exact fun h => absurd h hμm_not
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 := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ μ[f|m] =
    if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0

Next tactic:
rw [condexp, dif_pos hm]
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 := by
  rw [condexp, dif_pos hm]
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ (if h : SigmaFinite (Measure.trim μ hm) ∧ Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =
    if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0

Next tactic:
simp only [hμm, Ne.def, true_and_iff]
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 := by
  rw [condexp, dif_pos hm]
  simp only [hμm, Ne.def, true_and_iff]
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
⊢ (if h : Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =
    if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0

Next tactic:
by_cases hf : Integrable f μ
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 := by
  rw [condexp, dif_pos hm]
  simp only [hμm, Ne.def, true_and_iff]
  by_cases hf : Integrable f μ
  · 

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
⊢ (if h : Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =
    if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0

Next tactic:
rw [dif_pos hf, if_pos hf]
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 := by
  rw [condexp, dif_pos hm]
  simp only [hμm, Ne.def, true_and_iff]
  by_cases hf : Integrable f μ
  · rw [dif_pos hf, if_pos hf]
  · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
hf : ¬Integrable f
⊢ (if h : Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =
    if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0

Next tactic:
rw [dif_neg hf, if_neg hf]
theorem condexp_of_stronglyMeasurable (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] {f : α → F'}
    (hf : StronglyMeasurable[m] f) (hfi : Integrable f μ) : μ[f|m] = f := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hf : StronglyMeasurable f
hfi : Integrable f
⊢ μ[f|m] = f

Next tactic:
rw [condexp_of_sigmaFinite hm, if_pos hfi, if_pos hf]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
⊢ μ[f|m] =ᵐ[μ] ↑↑(condexpL1 hm μ f)

Next tactic:
rw [condexp_of_sigmaFinite hm]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
⊢ (if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
by_cases hfi : Integrable f μ
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · 

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
⊢ (if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
rw [if_pos hfi]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
⊢ (if StronglyMeasurable f then f
    else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
by_cases hfm : StronglyMeasurable[m] f
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · 

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
hfm : StronglyMeasurable f
⊢ (if StronglyMeasurable f then f
    else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
rw [if_pos hfm]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · rw [if_pos hfm]
      

Proof state:
case pos
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
hfm : StronglyMeasurable f
⊢ f =ᵐ[μ] ↑↑(condexpL1 hm μ f)

Next tactic:
exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
        hfi).symm
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · rw [if_pos hfm]
      exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
        hfi).symm
    · 

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
hfm : ¬StronglyMeasurable f
⊢ (if StronglyMeasurable f then f
    else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
rw [if_neg hfm]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · rw [if_pos hfm]
      exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
        hfi).symm
    · rw [if_neg hfm]
      

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : Integrable f
hfm : ¬StronglyMeasurable f
⊢ AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · rw [if_pos hfm]
      exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
        hfi).symm
    · rw [if_neg hfm]
      exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
  

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : ¬Integrable f
⊢ (if Integrable f then
      if StronglyMeasurable f then f
      else AEStronglyMeasurable'.mk ↑↑(condexpL1 hm μ f) (_ : AEStronglyMeasurable' m (↑↑(condexpL1 hm μ f)) μ)
    else 0) =ᵐ[μ]
    ↑↑(condexpL1 hm μ f)

Next tactic:
rw [if_neg hfi, condexpL1_undef hfi]
theorem condexp_ae_eq_condexpL1 (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] (f : α → F') :
    μ[f|m] =ᵐ[μ] condexpL1 hm μ f := by
  rw [condexp_of_sigmaFinite hm]
  by_cases hfi : Integrable f μ
  · rw [if_pos hfi]
    by_cases hfm : StronglyMeasurable[m] f
    · rw [if_pos hfm]
      exact (condexpL1_of_aestronglyMeasurable' (StronglyMeasurable.aeStronglyMeasurable' hfm)
        hfi).symm
    · rw [if_neg hfm]
      exact (AEStronglyMeasurable'.ae_eq_mk aestronglyMeasurable'_condexpL1).symm
  rw [if_neg hfi, condexpL1_undef hfi]
  

Proof state:
case neg
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁶ : IsROrC 𝕜
inst✝⁵ : NormedAddCommGroup F
inst✝⁴ : NormedSpace 𝕜 F
inst✝³ : NormedAddCommGroup F'
inst✝² : NormedSpace 𝕜 F'
inst✝¹ : NormedSpace ℝ F'
inst✝ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f✝ g : α → F'
s : Set α
hm : m ≤ m0
hμm : SigmaFinite (Measure.trim μ hm)
f : α → F'
hfi : ¬Integrable f
⊢ 0 =ᵐ[μ] ↑↑0

Next tactic:
exact (coeFn_zero _ _ _).symm
theorem condexp_ae_eq_condexpL1Clm (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    μ[f|m] =ᵐ[μ] condexpL1Clm F' hm μ (hf.toL1 f) := by
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
⊢ μ[f|m] =ᵐ[μ] ↑↑((condexpL1Clm F' hm μ) (Integrable.toL1 f hf))

Next tactic:
refine' (condexp_ae_eq_condexpL1 hm f).trans (eventually_of_forall fun x => _)
theorem condexp_ae_eq_condexpL1Clm (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hf : Integrable f μ) :
    μ[f|m] =ᵐ[μ] condexpL1Clm F' hm μ (hf.toL1 f) := by
  refine' (condexp_ae_eq_condexpL1 hm f).trans (eventually_of_forall fun x => _)
  

Proof state:
α : Type u_1
F : Type u_2
F' : Type u_3
𝕜 : Type u_4
p : ℝ≥0∞
inst✝⁷ : IsROrC 𝕜
inst✝⁶ : NormedAddCommGroup F
inst✝⁵ : NormedSpace 𝕜 F
inst✝⁴ : NormedAddCommGroup F'
inst✝³ : NormedSpace 𝕜 F'
inst✝² : NormedSpace ℝ F'
inst✝¹ : CompleteSpace F'
m m0 : MeasurableSpace α
μ : Measure α
f g : α → F'
s : Set α
hm : m ≤ m0
inst✝ : SigmaFinite (Measure.trim μ hm)
hf : Integrable f
x : α
⊢ ↑↑(condexpL1 hm μ f) x = ↑↑((condexpL1Clm F' hm μ) (Integrable.toL1 f hf)) x

Next tactic:
rw [condexpL1_eq hf]