-- Mathlib/Topology/Category/Compactum.lean
theorem cl_cl {X : Compactum} (A : Set X) : cl (cl A) ⊆ cl A

Proof state:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
C1 : ssu := insert AA C0
C2 : Set (Set (Ultrafilter X.A)) := finiteInterClosure C1
claim1 : ∀ B ∈ C0, ∀ C ∈ C0, B ∩ C ∈ C0
claim2 : ∀ B ∈ C0, B.Nonempty
⊢ X.str F ∈ Compactum.cl A

Tactic:
have claim3 : ∀ B ∈ C0, (AA ∩ B).Nonempty := by
  rintro B ⟨Q, hQ, rfl⟩
  have : (Q ∩ cl A).Nonempty := Filter.nonempty_of_mem (inter_mem hQ hF)
  rcases this with ⟨q, hq1, P, hq2, hq3⟩
  refine ⟨P, hq2, ?_⟩
  rw [← hq3] at hq1
  simpa

Result:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
C1 : ssu := insert AA C0
C2 : Set (Set (Ultrafilter X.A)) := finiteInterClosure C1
claim1 : ∀ B ∈ C0, ∀ C ∈ C0, B ∩ C ∈ C0
claim2 : ∀ B ∈ C0, B.Nonempty
claim3 : ∀ B ∈ C0, (AA ∩ B).Nonempty
⊢ X.str F ∈ Compactum.cl A

Proof state:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
C1 : ssu := insert AA C0
C2 : Set (Set (Ultrafilter X.A)) := finiteInterClosure C1
claim1 : ∀ B ∈ C0, ∀ C ∈ C0, B ∩ C ∈ C0
claim2 : ∀ B ∈ C0, B.Nonempty
claim3 : ∀ B ∈ C0, (AA ∩ B).Nonempty
⊢ X.str F ∈ Compactum.cl A

Tactic:
suffices ∀ T : fsu, ι T ⊆ C1 → (⋂₀ ι T).Nonempty by
  obtain ⟨G, h1⟩ := exists_ultrafilter_of_finite_inter_nonempty _ this
  use X.join G
  have : G.map X.str = F := Ultrafilter.coe_le_coe.1 fun S hS => h1 (Or.inr ⟨S, hS, rfl⟩)
  rw [join_distrib, this]
  exact ⟨h1 (Or.inl rfl), rfl⟩

Result:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
C1 : ssu := insert AA C0
C2 : Set (Set (Ultrafilter X.A)) := finiteInterClosure C1
claim1 : ∀ B ∈ C0, ∀ C ∈ C0, B ∩ C ∈ C0
claim2 : ∀ B ∈ C0, B.Nonempty
claim3 : ∀ B ∈ C0, (AA ∩ B).Nonempty
⊢ ∀ (T : fsu), ι T ⊆ C1 → (⋂₀ ι T).Nonempty

Proof state:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
⊢ X.str F ∈ Compactum.cl A

Tactic:
let C1 := insert AA C0

Result:
case intro.intro
X : Compactum
A : Set X.A
F : Ultrafilter X.A
hF : F ∈ Compactum.basic (Compactum.cl A)
fsu : Type u_1 := Finset (Set (Ultrafilter X.A))
ssu : Type u_1 := Set (Set (Ultrafilter X.A))
ι : fsu → ssu := fun x => ↑x
C0 : ssu := {Z | ∃ B ∈ F, X.str ⁻¹' B = Z}
AA : Set (Ultrafilter X.A) := {G | A ∈ G}
C1 : ssu := insert AA C0
⊢ X.str F ∈ Compactum.cl A