Theorem: limsup_eq_tendsto_sum_indicator_nat_atTop
File: Mathlib/Topology/Algebra/Order/LiminfLimsup.lean

tactic: ext ω
state_before: α : Type u
β : Type v
s : ℕ → Set α
⊢ limsup s atTop = {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}

tactic: simp only [limsup_eq_iInf_iSup_of_nat, ge_iff_le, Set.iSup_eq_iUnion, Set.iInf_eq_iInter,
  Set.mem_iInter, Set.mem_iUnion, exists_prop]
state_before: case h
α : Type u
β : Type v
s : ℕ → Set α
ω : α
⊢ ω ∈ limsup s atTop ↔ ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}

tactic: constructor
state_before: case h
α : Type u
β : Type v
s : ℕ → Set α
ω : α
⊢ (∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1) ↔
    ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}

tactic: intro hω
state_before: case h.mp
α : Type u
β : Type v
s : ℕ → Set α
ω : α
⊢ (∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1) →
    ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}

tactic: refine' tendsto_atTop_atTop_of_monotone' (fun n m hnm ↦ Finset.sum_mono_set_of_nonneg
  (fun i ↦ Set.indicator_nonneg (fun _ _ ↦ zero_le_one) _) (Finset.range_mono hnm)) _
state_before: case h.mp
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
⊢ ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}

tactic: rintro ⟨i, h⟩
state_before: case h.mp
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
⊢ ¬BddAbove (Set.range fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω)

tactic: simp only [mem_upperBounds, Set.mem_range, forall_exists_index, forall_apply_eq_imp_iff'] at h
state_before: case h.mp.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h : i ∈ upperBounds (Set.range fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω)
⊢ False

tactic: induction' i with k hk
state_before: case h.mp.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
⊢ False

tactic: obtain ⟨j, hj₁, hj₂⟩ := hω 1
state_before: case h.mp.intro.zero
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.zero
⊢ False

tactic: refine' not_lt.2 (h <| j + 1)
  (lt_of_le_of_lt (Finset.sum_const_zero.symm : 0 = ∑ k in Finset.range (j + 1), 0).le _)
state_before: case h.mp.intro.zero.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.zero
j : ℕ
hj₁ : 1 ≤ j
hj₂ : ω ∈ s j
⊢ False

tactic: refine' Finset.sum_lt_sum (fun m _ ↦ Set.indicator_nonneg (fun _ _ ↦ zero_le_one) _)
  ⟨j - 1, Finset.mem_range.2 (lt_of_le_of_lt (Nat.sub_le _ _) j.lt_succ_self), _⟩
state_before: case h.mp.intro.zero.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.zero
j : ℕ
hj₁ : 1 ≤ j
hj₂ : ω ∈ s j
⊢ ∑ _x in Finset.range (j + 1), 0 < ∑ k in Finset.range (j + 1), Set.indicator (s (k + 1)) 1 ω

tactic: rw [Nat.sub_add_cancel hj₁, Set.indicator_of_mem hj₂]
state_before: case h.mp.intro.zero.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.zero
j : ℕ
hj₁ : 1 ≤ j
hj₂ : ω ∈ s j
⊢ 0 < Set.indicator (s (j - 1 + 1)) 1 ω

tactic: exact zero_lt_one
state_before: case h.mp.intro.zero.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.zero
j : ℕ
hj₁ : 1 ≤ j
hj₂ : ω ∈ s j
⊢ 0 < OfNat.ofNat 1 ω

tactic: rw [imp_false] at hk
state_before: case h.mp.intro.succ
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
k : ℕ
hk : (∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ k) → False
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
⊢ False

tactic: push_neg  at hk
state_before: case h.mp.intro.succ
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
k : ℕ
hk : ¬∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ k
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
⊢ False

tactic: obtain ⟨i, hi⟩ := hk
state_before: case h.mp.intro.succ
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
hk : ∃ a, k < ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
⊢ False

tactic: obtain ⟨j, hj₁, hj₂⟩ := hω (i + 1)
state_before: case h.mp.intro.succ.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i : ℕ
hi : k < ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω
⊢ False

tactic: replace hi : (∑ k in Finset.range i, (s (k + 1)).indicator 1 ω) = k + 1 :=
  le_antisymm (h i) hi
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i : ℕ
hi : k < ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω
j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
⊢ False

tactic: refine' not_lt.2 (h <| j + 1) _
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ False

tactic: rw [← Finset.sum_range_add_sum_Ico _ (i.le_succ.trans (hj₁.trans j.le_succ)), hi]
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ Nat.succ k < ∑ k in Finset.range (j + 1), Set.indicator (s (k + 1)) 1 ω

tactic: refine' lt_add_of_pos_right _ _
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ Nat.succ k < k + 1 + ∑ k in Finset.Ico i (Nat.succ j), Set.indicator (s (k + 1)) 1 ω

tactic: rw [(Finset.sum_const_zero.symm : 0 = ∑ k in Finset.Ico i (j + 1), 0)]
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ 0 < ∑ k in Finset.Ico i (Nat.succ j), Set.indicator (s (k + 1)) 1 ω

tactic: refine' Finset.sum_lt_sum (fun m _ ↦ Set.indicator_nonneg (fun _ _ ↦ zero_le_one) _)
  ⟨j - 1, Finset.mem_Ico.2 ⟨(Nat.le_sub_iff_add_le (le_trans ((le_add_iff_nonneg_left _).2
    zero_le') hj₁)).2 hj₁, lt_of_le_of_lt (Nat.sub_le _ _) j.lt_succ_self⟩, _⟩
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ ∑ _x in Finset.Ico i (j + 1), 0 < ∑ k in Finset.Ico i (Nat.succ j), Set.indicator (s (k + 1)) 1 ω

tactic: rw [Nat.sub_add_cancel (le_trans ((le_add_iff_nonneg_left _).2 zero_le') hj₁),
  Set.indicator_of_mem hj₂]
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ 0 < Set.indicator (s (j - 1 + 1)) 1 ω

tactic: exact zero_lt_one
state_before: case h.mp.intro.succ.intro.intro.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
i✝ : ℕ
h✝ : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ i✝
k : ℕ
h : ∀ (a : ℕ), ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω ≤ Nat.succ k
i j : ℕ
hj₁ : i + 1 ≤ j
hj₂ : ω ∈ s j
hi : ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω = k + 1
⊢ 0 < OfNat.ofNat 1 ω

tactic: rintro hω i
state_before: case h.mpr
α : Type u
β : Type v
s : ℕ → Set α
ω : α
⊢ ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop} →
    ∀ (i : ℕ), ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1

tactic: rw [Set.mem_setOf_eq, tendsto_atTop_atTop] at hω
state_before: case h.mpr
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ω ∈ {ω | Tendsto (fun n => ∑ k in Finset.range n, Set.indicator (s (k + 1)) 1 ω) atTop atTop}
i : ℕ
⊢ ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1

tactic: by_contra hcon
state_before: case h.mpr
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
⊢ ∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1

tactic: push_neg  at hcon
state_before: case h.mpr
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ¬∃ i_1, i ≤ i_1 ∧ ω ∈ s i_1
⊢ False

tactic: obtain ⟨j, h⟩ := hω (i + 1)
state_before: case h.mpr
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
⊢ False

tactic: exact not_le.2 (lt_of_lt_of_le i.lt_succ_self <| h _ le_rfl) this
state_before: case h.mpr.intro
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
this : ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
⊢ False

tactic: by_cases hij : j < i
state_before: α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
⊢ ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: refine' fun j hij ↦
  (Finset.sum_le_card_nsmul _ _ _ _ : _ ≤ (Finset.range j).card • 1).trans _
state_before: α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
⊢ ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: exact fun m _ ↦ Set.indicator_apply_le' (fun _ ↦ le_rfl) fun _ ↦ zero_le_one
state_before: case refine'_1
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j✝ : ℕ
h : ∀ (a : ℕ), j✝ ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
j : ℕ
hij : j ≤ i
⊢ ∀ (x : ℕ), x ∈ Finset.range j → Set.indicator (s (x + 1)) 1 ω ≤ 1

tactic: simpa only [Finset.card_range, smul_eq_mul, mul_one]
state_before: case refine'_2
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j✝ : ℕ
h : ∀ (a : ℕ), j✝ ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
j : ℕ
hij : j ≤ i
⊢ Finset.card (Finset.range j) • 1 ≤ i

tactic: exact hle _ hij.le
state_before: case pos
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : j < i
⊢ ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: rw [← Finset.sum_range_add_sum_Ico _ (not_lt.1 hij)]
state_before: case neg
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
⊢ ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: suffices (∑ k in Finset.Ico i j, (s (k + 1)).indicator 1 ω) = 0 by
  rw [this, add_zero]
  exact hle _ le_rfl
state_before: case neg
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
⊢ ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω + ∑ k in Finset.Ico i j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: refine' Finset.sum_eq_zero fun m hm ↦ _
state_before: case neg
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
⊢ ∑ k in Finset.Ico i j, Set.indicator (s (k + 1)) 1 ω = 0

tactic: exact Set.indicator_of_not_mem (hcon _ <| (Finset.mem_Ico.1 hm).1.trans m.le_succ) _
state_before: case neg
α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
m : ℕ
hm : m ∈ Finset.Ico i j
⊢ Set.indicator (s (m + 1)) 1 ω = 0

tactic: rw [this, add_zero]
state_before: α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
this : ∑ k in Finset.Ico i j, Set.indicator (s (k + 1)) 1 ω = 0
⊢ ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω + ∑ k in Finset.Ico i j, Set.indicator (s (k + 1)) 1 ω ≤ i

tactic: exact hle _ le_rfl
state_before: α : Type u
β : Type v
s : ℕ → Set α
ω : α
hω : ∀ (b : ℕ), ∃ i, ∀ (a : ℕ), i ≤ a → b ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
i : ℕ
hcon : ∀ (i_1 : ℕ), i ≤ i_1 → ¬ω ∈ s i_1
j : ℕ
h : ∀ (a : ℕ), j ≤ a → i + 1 ≤ ∑ k in Finset.range a, Set.indicator (s (k + 1)) 1 ω
hle : ∀ (j : ℕ), j ≤ i → ∑ k in Finset.range j, Set.indicator (s (k + 1)) 1 ω ≤ i
hij : ¬j < i
this : ∑ k in Finset.Ico i j, Set.indicator (s (k + 1)) 1 ω = 0
⊢ ∑ k in Finset.range i, Set.indicator (s (k + 1)) 1 ω ≤ i