-- Mathlib/MeasureTheory/Decomposition/SignedHahn.lean
theorem exists_subset_restrict_nonpos' (hi₁ : MeasurableSet i) (hi₂ : s i < 0)
    (hn : ¬∀ n : ℕ, ¬s ≤[i \ ⋃ l < n, restrictNonposSeq s i l] 0) :
    ∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ s j < 0

Proof state:
case neg.hm
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
i✝ : ℕ
⊢ MeasurableSet (⋃ (_ : i✝ < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i i✝)

Tactic:
exact MeasurableSet.iUnion fun _ => restrictNonposSeq_measurableSet _

Result:
no goals

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
h₁ : ∀ l < k, 0 ≤ ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
this : 0 ≤ ∑' (l : ℕ), ↑s (⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
⊢ ↑s i < ∑' (i_1 : ℕ), ↑s (⋃ (_ : i_1 < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i i_1)

Tactic:
exact lt_of_lt_of_le hi₂ this

Result:
no goals

Proof state:
case neg.hd
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
a b : ℕ
hab : a ≠ b
x✝ : a < k
⊢ Disjoint (MeasureTheory.SignedMeasure.restrictNonposSeq s i a)
    ((fun l => ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l) b)

Tactic:
refine Set.disjoint_iUnion_right.mpr fun _ => ?_

Result:
case neg.hd
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
a b : ℕ
hab : a ≠ b
x✝¹ : a < k
x✝ : b < k
⊢ Disjoint (MeasureTheory.SignedMeasure.restrictNonposSeq s i a) (MeasureTheory.SignedMeasure.restrictNonposSeq s i b)

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
h₁ : ∀ l < k, 0 ≤ ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
this : 0 ≤ ∑' (l : ℕ), ↑s (⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
⊢ ↑s i - ∑' (i_1 : ℕ), ↑s (⋃ (_ : i_1 < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i i_1) < 0

Tactic:
rw [sub_neg]

Result:
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
h₁ : ∀ l < k, 0 ≤ ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
this : 0 ≤ ∑' (l : ℕ), ↑s (⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
⊢ ↑s i < ∑' (i_1 : ℕ), ↑s (⋃ (_ : i_1 < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i i_1)

Proof state:
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
⊢ ∀ l < k, 0 ≤ ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i l)

Tactic:
intro l hl

Result:
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
hmeas : MeasurableSet (⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l)
l : ℕ
hl : l < k
⊢ 0 ≤ ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i l)

Proof state:
case neg
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
⊢ ∃ j, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ ↑s j < 0

Tactic:
have hk₂ : s ≤[i \ ⋃ l < k, restrictNonposSeq s i l] 0 := Nat.find_spec hn

Result:
case neg
α : Type u_1
inst✝ : MeasurableSpace α
s : SignedMeasure α
i : Set α
hi₁ : MeasurableSet i
hi₂ : ↑s i < 0
h : ¬s ≤[i] 0
hn : ∃ n, s ≤[i \ ⋃ l, ⋃ (_ : l < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
k : ℕ := Nat.find hn
hk₂ : s ≤[i \ ⋃ l, ⋃ (_ : l < k), MeasureTheory.SignedMeasure.restrictNonposSeq s i l] 0
⊢ ∃ j, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ ↑s j < 0