Theorem: Monotone.piecewise_eventually_eq_iUnion
File: Mathlib/Order/Filter/AtTopBot.lean

tactic: rcases em (∃ i, a ∈ s i) with ⟨i, hi⟩ | ha
state_before: ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
⊢ ∀ᶠ (i : ι) in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a
state_after: case inl.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
i : ι
hi : a ∈ s i
⊢ ∀ᶠ (i : ι) in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a

case inr
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
ha : ¬∃ i, a ∈ s i
⊢ ∀ᶠ (i : ι) in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a

tactic: refine (eventually_ge_atTop i).mono fun j hij ↦ ?_
state_before: case inl.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
i : ι
hi : a ∈ s i
⊢ ∀ᶠ (i : ι) in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a
state_after: case inl.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
i : ι
hi : a ∈ s i
j : ι
hij : i ≤ j
⊢ (s j).piecewise f g a = (⋃ i, s i).piecewise f g a

tactic: simp only [Set.piecewise_eq_of_mem, hs hij hi, subset_iUnion _ _ hi]
state_before: case inl.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
i : ι
hi : a ∈ s i
j : ι
hij : i ≤ j
⊢ (s j).piecewise f g a = (⋃ i, s i).piecewise f g a
state_after: no goals

tactic: filter_upwards with i
state_before: case inr
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
ha : ¬∃ i, a ∈ s i
⊢ ∀ᶠ (i : ι) in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a
state_after: case inr.h
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
ha : ¬∃ i, a ∈ s i
i : ι
⊢ (s i).piecewise f g a = (⋃ i, s i).piecewise f g a

tactic: simp only [Set.piecewise_eq_of_not_mem, not_exists.1 ha i, mt mem_iUnion.1 ha,
  not_false_eq_true, exists_false]
state_before: case inr.h
ι : Type u_1
ι' : Type u_2
α : Type u_3
β✝ : Type u_4
γ : Type u_5
β : α → Type u_6
inst✝² : Preorder ι
s : ι → Set α
inst✝¹ : (i : ι) → DecidablePred fun x => x ∈ s i
inst✝ : DecidablePred fun x => x ∈ ⋃ i, s i
hs : Monotone s
f g : (a : α) → β a
a : α
ha : ¬∃ i, a ∈ s i
i : ι
⊢ (s i).piecewise f g a = (⋃ i, s i).piecewise f g a
state_after: no goals