l3lab/ntp-mathlib huggingface dataset:
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)
      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
      · 

Proof state:
case mp.refine'_1.inr
α✝ : 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 = Nat.succ m
⊢ f n a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
exact h ▸ le_sup_left
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)
      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
      · exact h ▸ le_sup_left
    · 

Proof state:
case mp.refine'_2
α✝ : 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
⊢ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a ≤ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a

Next tactic:
refine' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
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)
      · 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)
      

Proof state:
case mp.refine'_2
α✝ : 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
⊢ f (Nat.succ m) a ≤ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a

Next tactic:
convert @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ m.succ le_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
    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
      

Proof state:
case h.e'_3
α✝ : 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
⊢ f (Nat.succ m) a = f (Nat.succ m) a

Next tactic:
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 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:
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 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
c : ℝ≥0∞ := ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
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 mpr
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
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 mpr
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
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 mpr.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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
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 mpr.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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
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 mpr.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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h✝ : d = ↑x
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)
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)
      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
      · 

Proof state:
case mpr.refine'_1.inr
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h✝ : d = ↑x
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
n : ℕ
hn : n ≤ m + 1
h : n = Nat.succ m
⊢ f n a ≤ f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a

Next tactic:
exact h ▸ le_sup_left
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)
      · exact le_sup_of_le_right (le_iSup₂ (f := fun k (_ : k ≤ m) => f k a) n h)
      · exact h ▸ le_sup_left
    · 

Proof state:
case mpr.refine'_2
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
hd : d = 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' sup_le _ (biSup_mono fun n hn => hn.trans m.le_succ)
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)
      · 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)
      

Proof state:
case mpr.refine'_2
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ f (Nat.succ m) a ≤ ⨆ k, ⨆ (_ : k ≤ m + 1), f k a

Next tactic:
convert @le_iSup₂ ℝ≥0∞ ℕ (fun i => i ≤ m + 1) _ _ m.succ le_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
    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
      

Proof state:
case h.e'_3
α✝ : 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
hc : c = ⨆ k, ⨆ (_ : k ≤ m + 1), f k a
d : ℝ≥0∞ := f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
h : d = ↑x
hd : d = f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ f (Nat.succ m) a = f (Nat.succ m) a

Next tactic:
rfl
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
n : ℕ
⊢ (fun x => ⨆ k, ⨆ (_ : k ≤ n), f k x) ∈ measurableLE μ ν

Next tactic:
induction' n with m hm
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · 

Proof state:
case zero
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
⊢ (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.zero), f k x) ∈ measurableLE μ ν

Next tactic:
refine' ⟨_, _⟩
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · 

Proof state:
case zero.refine'_1
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
⊢ Measurable fun x => ⨆ k, ⨆ (_ : k ≤ Nat.zero), f k x

Next tactic:
simp [(hf 0).1]
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · 

Proof state:
case zero.refine'_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
⊢ ∀ (A : Set α), MeasurableSet A → ∫⁻ (x : α) in A, (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.zero), f k x) x ∂μ ≤ ↑↑ν A

Next tactic:
intro A hA
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · intro A hA; 

Proof state:
case zero.refine'_2
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
A : Set α
hA : MeasurableSet A
⊢ ∫⁻ (x : α) in A, (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.zero), f k x) x ∂μ ≤ ↑↑ν A

Next tactic:
simp [(hf 0).2 A hA]
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · intro A hA; simp [(hf 0).2 A hA]
  · 

Proof state:
case succ
α : Type u_1
β : Type u_2
m✝ : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
m : ℕ
hm : (fun x => ⨆ k, ⨆ (_ : k ≤ m), f k x) ∈ measurableLE μ ν
⊢ (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.succ m), f k x) ∈ measurableLE μ ν

Next tactic:
have :
      (fun a : α => ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a =>
        f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
      funext fun _ => iSup_succ_eq_sup _ _ _
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · intro A hA; simp [(hf 0).2 A hA]
  · have :
      (fun a : α => ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a =>
        f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
      funext fun _ => iSup_succ_eq_sup _ _ _
    

Proof state:
case succ
α : Type u_1
β : Type u_2
m✝ : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
m : ℕ
hm : (fun x => ⨆ k, ⨆ (_ : k ≤ m), f k x) ∈ measurableLE μ ν
this : (fun a => ⨆ k, ⨆ (_ : k ≤ m + 1), f k a) = fun a => f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
⊢ (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.succ m), f k x) ∈ measurableLE μ ν

Next tactic:
refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · intro A hA; simp [(hf 0).2 A hA]
  · have :
      (fun a : α => ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a =>
        f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
      funext fun _ => iSup_succ_eq_sup _ _ _
    refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
    

Proof state:
case succ
α : Type u_1
β : Type u_2
m✝ : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
m : ℕ
hm : (fun x => ⨆ k, ⨆ (_ : k ≤ m), f k x) ∈ measurableLE μ ν
this : (fun a => ⨆ k, ⨆ (_ : k ≤ m + 1), f k a) = fun a => f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
A : Set α
hA : MeasurableSet A
⊢ ∫⁻ (x : α) in A, (fun x => ⨆ k, ⨆ (_ : k ≤ Nat.succ m), f k x) x ∂μ ≤ ↑↑ν A

Next tactic:
rw [this]
theorem iSup_mem_measurableLE (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (fun x => ⨆ (k) (_ : k ≤ n), f k x) ∈ measurableLE μ ν := by
  induction' n with m hm
  · refine' ⟨_, _⟩
    · simp [(hf 0).1]
    · intro A hA; simp [(hf 0).2 A hA]
  · have :
      (fun a : α => ⨆ (k : ℕ) (_ : k ≤ m + 1), f k a) = fun a =>
        f m.succ a ⊔ ⨆ (k : ℕ) (_ : k ≤ m), f k a :=
      funext fun _ => iSup_succ_eq_sup _ _ _
    refine' ⟨measurable_iSup fun n => Measurable.iSup_Prop _ (hf n).1, fun A hA => _⟩
    rw [this]; 

Proof state:
case succ
α : Type u_1
β : Type u_2
m✝ : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
m : ℕ
hm : (fun x => ⨆ k, ⨆ (_ : k ≤ m), f k x) ∈ measurableLE μ ν
this : (fun a => ⨆ k, ⨆ (_ : k ≤ m + 1), f k a) = fun a => f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a
A : Set α
hA : MeasurableSet A
⊢ ∫⁻ (a : α) in A, f (Nat.succ m) a ⊔ ⨆ k, ⨆ (_ : k ≤ m), f k a ∂μ ≤ ↑↑ν A

Next tactic:
exact (sup_mem_measurableLE (hf m.succ) hm).2 A hA
theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν := by
  

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
n : ℕ
⊢ ⨆ k, ⨆ (_ : k ≤ n), f k ∈ measurableLE μ ν

Next tactic:
convert iSup_mem_measurableLE f hf n
theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν := by
  convert iSup_mem_measurableLE f hf n
  

Proof state:
case h.e'_4.h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
n : ℕ
x✝ : α
⊢ iSup (fun k => ⨆ (_ : k ≤ n), f k) x✝ = ⨆ k, ⨆ (_ : k ≤ n), f k x✝

Next tactic:
refine Option.ext fun x => ?_
theorem iSup_mem_measurableLE' (f : ℕ → α → ℝ≥0∞) (hf : ∀ n, f n ∈ measurableLE μ ν) (n : ℕ) :
    (⨆ (k) (_ : k ≤ n), f k) ∈ measurableLE μ ν := by
  convert iSup_mem_measurableLE f hf n
  refine Option.ext fun x => ?_; 

Proof state:
case h.e'_4.h
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
f : ℕ → α → ℝ≥0∞
hf : ∀ (n : ℕ), f n ∈ measurableLE μ ν
n : ℕ
x✝ : α
x : ℝ≥0
⊢ x ∈ iSup (fun k => ⨆ (_ : k ≤ n), f k) x✝ ↔ x ∈ ⨆ k, ⨆ (_ : k ≤ n), f k x✝

Next tactic:
simp
/-- Any pair of finite measures `μ` and `ν`, `HaveLebesgueDecomposition`. That is to say,
there exist a measure `ξ` and a measurable function `f`, such that `ξ` is mutually singular
with respect to `ν` and `μ = ξ + ν.withDensity f`.

This is not an instance since this is also shown for the more general σ-finite measures with
`MeasureTheory.Measure.haveLebesgueDecomposition_of_sigmaFinite`. -/
theorem haveLebesgueDecomposition_of_finiteMeasure [IsFiniteMeasure μ] [IsFiniteMeasure ν] :
    HaveLebesgueDecomposition μ ν :=
  ⟨by
    

Proof state:
α : Type u_1
β : Type u_2
m : MeasurableSpace α
μ ν : Measure α
inst✝¹ : IsFiniteMeasure μ
inst✝ : IsFiniteMeasure ν
⊢ ∃ p, Measurable p.2 ∧ p.1 ⟂ₘ ν ∧ μ = p.1 + withDensity ν p.2

Next tactic:
have h :=
      @exists_seq_tendsto_sSup _ _ _ _ _ (measurableLEEval ν μ)
        ⟨0, 0, zero_mem_measurableLE, by simp⟩ (OrderTop.bddAbove _)