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}

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}

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 : ι), x ∈ t → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : x ∈ t), f x} ↔ s ∈ π i ∨ s ∈ {univ}

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 : ι), x ∈ t → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : x ∈ t), f x} → s ∈ π i ∨ s ∈ {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 : ι), x ∈ t → f x ∈ π x
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : 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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : 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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : i ∈ t
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : 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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ {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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : i ∈ t
ht_eq_i : t = {i}
⊢ f i ∈ π i ∨ f i ∈ {univ}

tactic: ext1 x
state_before: α : Type u_1
ι : Type u_2
π : ι → Set (Set α)
i : ι
t : Finset ι
f : ι → Set α
hfπ : ∀ (x : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : i ∈ t
⊢ t = {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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), 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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : i ∈ t
x : ι
⊢ x ∈ t ↔ x = i

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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : ¬i ∈ t
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : 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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : ¬i ∈ t
ht_empty : t = ∅
⊢ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ π i ∨ (⋂ (x : ι) (_ : x ∈ t), f x) ∈ {univ}

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

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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : ¬i ∈ t
x : ι
⊢ x ∈ t ↔ x ∈ ∅

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 : ι), x ∈ t → f x ∈ π x
hti : ∀ (y : ι), y ∈ t → y = i
hi : ¬i ∈ t
x : ι
⊢ ¬x ∈ t

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 : ι), x ∈ t → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : 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 : ι), x ∈ t → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : x ∈ t), f 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}

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

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

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 : ι) (_ : x ∈ {i}), (fun x => s) x

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 : ι), x ∈ t → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : x ∈ t), 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 : ι), x ∈ ∅ → f x ∈ π x) ∧ s = ⋂ (x : ι) (_ : x ∈ ∅), f x