l3lab/ntp-mathlib huggingface dataset:
/-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.

This lemma is useful for the Lebesgue decomposition theorem. -/
theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
    ∃ ε : ℝ≥0, 0 < ε ∧
      ∃ E : Set α,
        MeasurableSet E ∧ 0 < ν E ∧ 0 ≤[E] μ.toSignedMeasure - (ε • ν).toSignedMeasure := by
  -- for all `n : ℕ`, obtain the Hahn decomposition for `μ - (1 / n) ν`
  have :
    ∀ n : ℕ, ∃ i : Set α,
      MeasurableSet i ∧
        0 ≤[i] μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ∧
          μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[iᶜ] 0 := by
    intro; exact exists_compl_positive_negative _
  choose f hf₁ hf₂ hf₃ using this
  -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
  -- and we show that `μ A = 0`
  set A := ⋂ n, (f n)ᶜ with hA₁
  have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
  have hA₂ : ∀ n : ℕ, μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
    intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (iInter_subset _ _)
  have hA₃ : ∀ n : ℕ, μ A ≤ (1 / (n + 1) : ℝ≥0) * ν A := by
    intro n
    have := nonpos_of_restrict_le_zero _ (hA₂ n)
    rwa [toSignedMeasure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
    exacts [ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
  have hμ : μ A = 0 := by
    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
    rw [ENNReal.coe_eq_zero]
    by_cases hb : 0 < νA
    · suffices ∀ b, 0 < b → μA ≤ b by
        by_contra h
        have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
        rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
        exact h' (not_le.2 (NNReal.half_lt_self h))
      intro c hc
      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹; refine' exists_nat_one_div_lt _
      · refine' mul_pos hc _
        

Proof state:
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : ¬μ ⟂ₘ ν
f : ℕ → Set α
hf₁ : ∀ (n : ℕ), MeasurableSet (f n)
hf₂ :
  ∀ (n : ℕ),
    VectorMeasure.restrict 0 (f n) ≤
      VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (f n)
hf₃ :
  ∀ (n : ℕ),
    VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (f n)ᶜ ≤
      VectorMeasure.restrict 0 (f n)ᶜ
A : Set α := ⋂ n, (f n)ᶜ
hAmeas : MeasurableSet (⋂ n, (f n)ᶜ)
hA₂ :
  ∀ (n : ℕ),
    VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (⋂ n, (f n)ᶜ) ≤
      VectorMeasure.restrict 0 (⋂ n, (f n)ᶜ)
μA : ℝ≥0
hA₁✝ hA₁ : True
hA₃✝¹ : ∀ (n : ℕ), ↑μA ≤ ↑(1 / (↑n + 1)) * ↑↑ν (⋂ n, (f n)ᶜ)
νA : ℝ≥0
hA₃✝ hA₃ : ∀ (n : ℕ), ↑μA ≤ ↑(1 / (↑n + 1)) * ↑νA
hb : 0 < νA
c : ℝ≥0
hc : 0 < c
⊢ 0 < (↑νA)⁻¹

Next tactic:
rw [_root_.inv_pos]
/-- If two finite measures `μ` and `ν` are not mutually singular, there exists some `ε > 0` and
a measurable set `E`, such that `ν(E) > 0` and `E` is positive with respect to `μ - εν`.

This lemma is useful for the Lebesgue decomposition theorem. -/
theorem exists_positive_of_not_mutuallySingular (μ ν : Measure α) [IsFiniteMeasure μ]
    [IsFiniteMeasure ν] (h : ¬μ ⟂ₘ ν) :
    ∃ ε : ℝ≥0, 0 < ε ∧
      ∃ E : Set α,
        MeasurableSet E ∧ 0 < ν E ∧ 0 ≤[E] μ.toSignedMeasure - (ε • ν).toSignedMeasure := by
  -- for all `n : ℕ`, obtain the Hahn decomposition for `μ - (1 / n) ν`
  have :
    ∀ n : ℕ, ∃ i : Set α,
      MeasurableSet i ∧
        0 ≤[i] μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ∧
          μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[iᶜ] 0 := by
    intro; exact exists_compl_positive_negative _
  choose f hf₁ hf₂ hf₃ using this
  -- set `A` to be the intersection of all the negative parts of obtained Hahn decompositions
  -- and we show that `μ A = 0`
  set A := ⋂ n, (f n)ᶜ with hA₁
  have hAmeas : MeasurableSet A := MeasurableSet.iInter fun n => (hf₁ n).compl
  have hA₂ : ∀ n : ℕ, μ.toSignedMeasure - ((1 / (n + 1) : ℝ≥0) • ν).toSignedMeasure ≤[A] 0 := by
    intro n; exact restrict_le_restrict_subset _ _ (hf₁ n).compl (hf₃ n) (iInter_subset _ _)
  have hA₃ : ∀ n : ℕ, μ A ≤ (1 / (n + 1) : ℝ≥0) * ν A := by
    intro n
    have := nonpos_of_restrict_le_zero _ (hA₂ n)
    rwa [toSignedMeasure_sub_apply hAmeas, sub_nonpos, ENNReal.toReal_le_toReal] at this
    exacts [ne_of_lt (measure_lt_top _ _), ne_of_lt (measure_lt_top _ _)]
  have hμ : μ A = 0 := by
    lift μ A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with μA
    lift ν A to ℝ≥0 using ne_of_lt (measure_lt_top _ _) with νA
    rw [ENNReal.coe_eq_zero]
    by_cases hb : 0 < νA
    · suffices ∀ b, 0 < b → μA ≤ b by
        by_contra h
        have h' := this (μA / 2) (half_pos (zero_lt_iff.2 h))
        rw [← @Classical.not_not (μA ≤ μA / 2)] at h'
        exact h' (not_le.2 (NNReal.half_lt_self h))
      intro c hc
      have : ∃ n : ℕ, 1 / (n + 1 : ℝ) < c * (νA : ℝ)⁻¹; refine' exists_nat_one_div_lt _
      · refine' mul_pos hc _
        rw [_root_.inv_pos]; 

Proof state:
case this
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ✝ ν✝ μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
h : ¬μ ⟂ₘ ν
f : ℕ → Set α
hf₁ : ∀ (n : ℕ), MeasurableSet (f n)
hf₂ :
  ∀ (n : ℕ),
    VectorMeasure.restrict 0 (f n) ≤
      VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (f n)
hf₃ :
  ∀ (n : ℕ),
    VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (f n)ᶜ ≤
      VectorMeasure.restrict 0 (f n)ᶜ
A : Set α := ⋂ n, (f n)ᶜ
hAmeas : MeasurableSet (⋂ n, (f n)ᶜ)
hA₂ :
  ∀ (n : ℕ),
    VectorMeasure.restrict (toSignedMeasure μ - toSignedMeasure ((1 / (↑n + 1)) • ν)) (⋂ n, (f n)ᶜ) ≤
      VectorMeasure.restrict 0 (⋂ n, (f n)ᶜ)
μA : ℝ≥0
hA₁✝ hA₁ : True
hA₃✝¹ : ∀ (n : ℕ), ↑μA ≤ ↑(1 / (↑n + 1)) * ↑↑ν (⋂ n, (f n)ᶜ)
νA : ℝ≥0
hA₃✝ hA₃ : ∀ (n : ℕ), ↑μA ≤ ↑(1 / (↑n + 1)) * ↑νA
hb : 0 < νA
c : ℝ≥0
hc : 0 < c
⊢ 0 < ↑νA

Next tactic:
exact hb
theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν :=
  ⟨measurable_zero, fun A _ => by 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
A : Set α
x✝ : MeasurableSet A
⊢ ∫⁻ (x : α) in A, OfNat.ofNat 0 x ∂μ ≤ ↑↑ν A

Next tactic:
simp
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
⊢ (fun a => f a ⊔ g a) ∈ measurableLE μ ν

Next tactic:
simp_rw [ENNReal.sup_eq_max]
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
⊢ (fun a => max (f a) (g a)) ∈ measurableLE μ ν

Next tactic:
refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
⊢ ∫⁻ (x : α) in A, (fun a => max (f a) (g a)) x ∂μ ≤ ↑↑ν A

Next tactic:
have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
h₁ : MeasurableSet (A ∩ {a | f a ≤ g a})
⊢ ∫⁻ (x : α) in A, (fun a => max (f a) (g a)) x ∂μ ≤ ↑↑ν A

Next tactic:
have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
  have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
h₁ : MeasurableSet (A ∩ {a | f a ≤ g a})
h₂ : MeasurableSet (A ∩ {a | g a < f a})
⊢ ∫⁻ (x : α) in A, (fun a => max (f a) (g a)) x ∂μ ≤ ↑↑ν A

Next tactic:
rw [set_lintegral_max hf.1 hg.1]
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
  have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
  rw [set_lintegral_max hf.1 hg.1]
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
h₁ : MeasurableSet (A ∩ {a | f a ≤ g a})
h₂ : MeasurableSet (A ∩ {a | g a < f a})
⊢ ∫⁻ (x : α) in A ∩ {x | f x ≤ g x}, g x ∂μ + ∫⁻ (x : α) in A ∩ {x | g x < f x}, f x ∂μ ≤ ↑↑ν A

Next tactic:
refine' (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq _
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
  have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
  rw [set_lintegral_max hf.1 hg.1]
  refine' (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq _
  · 

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
h₁ : MeasurableSet (A ∩ {a | f a ≤ g a})
h₂ : MeasurableSet (A ∩ {a | g a < f a})
⊢ ↑↑ν (A ∩ {a | f a ≤ g a}) + ↑↑ν (A ∩ {a | g a < f a}) = ↑↑ν A

Next tactic:
simp only [← not_le, ← compl_setOf, ← diff_eq]
theorem sup_mem_measurableLE {f g : α → ℝ≥0∞} (hf : f ∈ measurableLE μ ν)
    (hg : g ∈ measurableLE μ ν) : (fun a => f a ⊔ g a) ∈ measurableLE μ ν := by
  simp_rw [ENNReal.sup_eq_max]
  refine' ⟨Measurable.max hf.1 hg.1, fun A hA => _⟩
  have h₁ := hA.inter (measurableSet_le hf.1 hg.1)
  have h₂ := hA.inter (measurableSet_lt hg.1 hf.1)
  rw [set_lintegral_max hf.1 hg.1]
  refine' (add_le_add (hg.2 _ h₁) (hf.2 _ h₂)).trans_eq _
  · simp only [← not_le, ← compl_setOf, ← diff_eq]
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f g : α → ℝ≥0∞
hf : f ∈ measurableLE μ ν
hg : g ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
h₁ : MeasurableSet (A ∩ {a | f a ≤ g a})
h₂ : MeasurableSet (A ∩ {a | g a < f a})
⊢ ↑↑ν (A ∩ {a | f a ≤ g a}) + ↑↑ν (A \ {a | f a ≤ g a}) = ↑↑ν A

Next tactic:
exact measure_inter_add_diff _ (measurableSet_le hf.1 hg.1)
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  

Proof state:
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
refine Option.ext fun x => ?_
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  

Proof state:
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
⊢ x ∈ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a ↔ x ∈ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
simp only [Option.mem_def, ENNReal.some_eq_coe]
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  

Proof state:
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x ↔ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x

Next tactic:
constructor
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> 

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x → f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x

Next tactic:
intro h
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> 

Proof state:
case mpr
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
⊢ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x → ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x

Next tactic:
intro h
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> 

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x
⊢ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x

Next tactic:
rw [← h]
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> 

Proof state:
case mpr
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x

Next tactic:
rw [← h]
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; 

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x
⊢ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
case mpr
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
symm
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
case mpr
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a = ↑x
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
    -- Specifying the type is weirdly necessary
    refine' ⟨_, _⟩
    · refine' iSup₂_le fun n hn => _
      rcases Nat.of_le_succ hn with (h | h)
      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
      · exact h ▸ le_sup_left
    · refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
      convert @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ m.succ le_rfl
      rfl
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
h : ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = ↑x
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
⊢ c = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ c = d

Next tactic:
rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
    -- Specifying the type is weirdly necessary
    

Proof state:
case mp
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a ∧
    f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a ≤ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a

Next tactic:
refine' ⟨_, _⟩
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
    -- Specifying the type is weirdly necessary
    refine' ⟨_, _⟩
    · 

Proof state:
case mp.refine'_1
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
refine' iSup₂_le fun n hn => _
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
    -- Specifying the type is weirdly necessary
    refine' ⟨_, _⟩
    · refine' iSup₂_le fun n hn => _
      

Proof state:
case mp.refine'_1
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
n : ℕ
hn : n ≤ m + 1
⊢ f n a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
rcases Nat.of_le_succ hn with (h | h)
theorem iSup_succ_eq_sup {α} (f : ℕ → α → ℝ≥0∞) (m : ℕ) (a : α) :
    ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a = f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a := by
  refine Option.ext fun x => ?_
  simp only [Option.mem_def, ENNReal.some_eq_coe]
  constructor <;> intro h <;> rw [← h]; symm
  all_goals
    set c := ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a with hc
    set d := f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a with hd
    rw [@le_antisymm_iff ℝ≥0∞, hc, hd]
    -- Specifying the type is weirdly necessary
    refine' ⟨_, _⟩
    · refine' iSup₂_le fun n hn => _
      rcases Nat.of_le_succ hn with (h | h)
      · 

Proof state:
case mp.refine'_1.inl
α✝ : Type u_1
β : Type u_2
m✝ : MeasurableSpace α✝
μ ν : Measure α✝
α : Sort u_3
f : ℕ → α → ℝ≥0∞
m : ℕ
a : α
x : ℝ≥0
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
h✝ : c = ↑x
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
n : ℕ
hn : n ≤ m + 1
h : n ≤ m
⊢ f n a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)