Theorem: piiUnionInter_singleton
File: Mathlib/MeasureTheory/PiSystem.lean

tactic: ext1 s
state_before: α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
⊢ piiUnionInter π {i} = π i ∪ {univ}
state_after: case h
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ piiUnionInter π {i} ↔ s ∈ π i ∪ {univ}

tactic: simp only [piiUnionInter, exists_prop, mem_union]
state_before: case h
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ piiUnionInter π {i} ↔ s ∈ π i ∪ {univ}
state_after: case h
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x} ↔ s ∈ π i ∨ s ∈ {univ}

tactic: refine ⟨?_, fun h => ?_⟩
state_before: case h
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x} ↔ s ∈ π i ∨ s ∈ {univ}
state_after: case h.refine_1
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x} → s ∈ π i ∨ s ∈ {univ}

case h.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
h : s ∈ π i ∨ s ∈ {univ}
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}

tactic: rintro ⟨t, hti, f, hfπ, rfl⟩
state_before: case h.refine_1
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x} → s ∈ π i ∨ s ∈ {univ}
state_after: case h.refine_1.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
hti : ↑t ⊆ {i}
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

tactic: simp only [subset_singleton_iff, Finset.mem_coe] at hti
state_before: case h.refine_1.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
hti : ↑t ⊆ {i}
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: case h.refine_1.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

tactic: by_cases hi : i ∈ t
state_before: case h.refine_1.intro.intro.intro.intro
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

case neg
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

tactic: have ht_eq_i : t = {i} := by
  ext1 x
  rw [Finset.mem_singleton]
  exact ⟨fun h => hti x h, fun h => h.symm ▸ hi⟩
state_before: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

tactic: simp only [ht_eq_i, Finset.mem_singleton, iInter_iInter_eq_left]
state_before: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ f i ∈ π i ∨ f i ∈ {univ}

tactic: exact Or.inl (hfπ i hi)
state_before: case pos
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ f i ∈ π i ∨ f i ∈ {univ}
state_after: no goals

tactic: ext1 x
state_before: α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
⊢ t = {i}
state_after: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
x : ι
⊢ x ∈ t ↔ x ∈ {i}

tactic: rw [Finset.mem_singleton]
state_before: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
x : ι
⊢ x ∈ t ↔ x ∈ {i}
state_after: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
x : ι
⊢ x ∈ t ↔ x = i

tactic: exact ⟨fun h => hti x h, fun h => h.symm ▸ hi⟩
state_before: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∈ t
x : ι
⊢ x ∈ t ↔ x = i
state_after: no goals

tactic: have ht_empty : t = ∅ := by
  ext1 x
  simp only [Finset.not_mem_empty, iff_false_iff]
  exact fun hx => hi (hti x hx ▸ hx)
state_before: case neg
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: case neg
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
ht_empty : t = ∅
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}

tactic: simp [ht_empty, Finset.not_mem_empty, iInter_false, iInter_univ, Set.mem_singleton univ,
  or_true_iff]
state_before: case neg
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
ht_empty : t = ∅
⊢ ⋂ x ∈ t, f x ∈ π i ∨ ⋂ x ∈ t, f x ∈ {univ}
state_after: no goals

tactic: ext1 x
state_before: α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
⊢ t = ∅
state_after: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
x : ι
⊢ x ∈ t ↔ x ∈ ∅

tactic: simp only [Finset.not_mem_empty, iff_false_iff]
state_before: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
x : ι
⊢ x ∈ t ↔ x ∈ ∅
state_after: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
x : ι
⊢ x ∉ t

tactic: exact fun hx => hi (hti x hx ▸ hx)
state_before: case a
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ x ∈ t, f x ∈ π x
hti : ∀ y ∈ t, y = i
hi : i ∉ t
x : ι
⊢ x ∉ t
state_after: no goals

tactic: cases' h with hs hs
state_before: case h.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
h : s ∈ π i ∨ s ∈ {univ}
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}
state_after: case h.refine_2.inl
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}

case h.refine_2.inr
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ {univ}
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}

tactic: refine ⟨{i}, ?_, fun _ => s, ⟨fun x hx => ?_, ?_⟩⟩
state_before: case h.refine_2.inl
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}
state_after: case h.refine_2.inl.refine_1
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ ↑{i} ⊆ {i}

case h.refine_2.inl.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
x : ι
hx : x ∈ {i}
⊢ (fun x => s) x ∈ π x

case h.refine_2.inl.refine_3
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ s = ⋂ x ∈ {i}, (fun x => s) x

tactic: rw [Finset.coe_singleton]
state_before: case h.refine_2.inl.refine_1
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ ↑{i} ⊆ {i}
state_after: no goals

tactic: rw [Finset.mem_singleton] at hx
state_before: case h.refine_2.inl.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
x : ι
hx : x ∈ {i}
⊢ (fun x => s) x ∈ π x
state_after: case h.refine_2.inl.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
x : ι
hx : x = i
⊢ (fun x => s) x ∈ π x

tactic: rwa [hx]
state_before: case h.refine_2.inl.refine_2
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
x : ι
hx : x = i
⊢ (fun x => s) x ∈ π x
state_after: no goals

tactic: simp only [Finset.mem_singleton, iInter_iInter_eq_left]
state_before: case h.refine_2.inl.refine_3
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ π i
⊢ s = ⋂ x ∈ {i}, (fun x => s) x
state_after: no goals

tactic: refine ⟨∅, ?_⟩
state_before: case h.refine_2.inr
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ {univ}
⊢ s ∈ {s | ∃ t, ↑t ⊆ {i} ∧ ∃ f, (∀ x ∈ t, f x ∈ π x) ∧ s = ⋂ x ∈ t, f x}
state_after: case h.refine_2.inr
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ {univ}
⊢ ↑∅ ⊆ {i} ∧ ∃ f, (∀ x ∈ ∅, f x ∈ π x) ∧ s = ⋂ x ∈ ∅, f x

tactic: simpa only [Finset.coe_empty, subset_singleton_iff, mem_empty_iff_false, IsEmpty.forall_iff,
  imp_true_iff, Finset.not_mem_empty, iInter_false, iInter_univ, true_and_iff,
  exists_const] using hs
state_before: case h.refine_2.inr
α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
s : Set α
hs : s ∈ {univ}
⊢ ↑∅ ⊆ {i} ∧ ∃ f, (∀ x ∈ ∅, f x ∈ π x) ∧ s = ⋂ x ∈ ∅, f x
state_after: no goals