-- Mathlib/Topology/Bases.lean
theorem IsTopologicalBasis.insert_empty {s : Set (Set α)} (h : IsTopologicalBasis s) :
    IsTopologicalBasis (insert ∅ s)

Proof state:
case refine_1.inr.inr.intro.intro.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ t₂
t₃ : Set α
h₃ : t₃ ∈ s
hs : x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

Tactic:
exact ⟨t₃, .inr h₃, hs⟩

Result:
no goals

Proof state:
case refine_2.inl
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ IsOpen ∅

Tactic:
exact @isOpen_empty _ (generateFrom s)

Result:
no goals

Proof state:
case refine_1
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ ∀ t₁ ∈ insert ∅ s, ∀ t₂ ∈ insert ∅ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

Tactic:
rintro t₁ (rfl | h₁) t₂ (rfl | h₂) x ⟨hx₁, hx₂⟩

Result:
case refine_1.inl.inl.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
x : α
hx₁ hx₂ : x ∈ ∅
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ ∅ ∩ ∅

case refine_1.inl.inr.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ ∅
hx₂ : x ∈ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ ∅ ∩ t₂

case refine_1.inr.inl.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ ∅
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ ∅

case refine_1.inr.inr.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

Proof state:
case refine_1.inl.inl.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
x : α
hx₁ hx₂ : x ∈ ∅
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ ∅ ∩ ∅

Tactic:
cases hx₁

Result:
no goals

Proof state:
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ IsTopologicalBasis (insert ∅ s)

Tactic:
refine ⟨?_, by rw [sUnion_insert, empty_union, h.sUnion_eq], ?_⟩

Result:
case refine_1
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ ∀ t₁ ∈ insert ∅ s, ∀ t₂ ∈ insert ∅ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

case refine_2
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ t = generateFrom (insert ∅ s)

Proof state:
case refine_1.inr.inl.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ ∅
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ ∅

Tactic:
cases hx₂

Result:
no goals

Proof state:
case refine_2.inr
α : Type u
t✝ : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t : Set α
ht : t ∈ s
⊢ IsOpen t

Tactic:
exact .basic t ht

Result:
no goals

Proof state:
case refine_2
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ generateFrom s = generateFrom (insert ∅ s)

Tactic:
refine le_antisymm (le_generateFrom fun t => ?_) (generateFrom_anti <| subset_insert ∅ s)

Result:
case refine_2
α : Type u
t✝ : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t : Set α
⊢ t ∈ insert ∅ s → IsOpen t

Proof state:
case refine_2
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ t = generateFrom (insert ∅ s)

Tactic:
rw [h.eq_generateFrom]

Result:
case refine_2
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ generateFrom s = generateFrom (insert ∅ s)

Proof state:
case refine_1.inr.inr.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

Tactic:
obtain ⟨t₃, h₃, hs⟩ := h.exists_subset_inter _ h₁ _ h₂ x ⟨hx₁, hx₂⟩

Result:
case refine_1.inr.inr.intro.intro.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₁ : Set α
h₁ : t₁ ∈ s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ t₁
hx₂ : x ∈ t₂
t₃ : Set α
h₃ : t₃ ∈ s
hs : x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂

Proof state:
case refine_2
α : Type u
t✝ : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t : Set α
⊢ t ∈ insert ∅ s → IsOpen t

Tactic:
rintro (rfl | ht)

Result:
case refine_2.inl
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ IsOpen ∅

case refine_2.inr
α : Type u
t✝ : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t : Set α
ht : t ∈ s
⊢ IsOpen t

Proof state:
case refine_1.inl.inr.intro
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
t₂ : Set α
h₂ : t₂ ∈ s
x : α
hx₁ : x ∈ ∅
hx₂ : x ∈ t₂
⊢ ∃ t₃ ∈ insert ∅ s, x ∈ t₃ ∧ t₃ ⊆ ∅ ∩ t₂

Tactic:
cases hx₁

Result:
no goals

Proof state:
α : Type u
t : TopologicalSpace α
s : Set (Set α)
h : IsTopologicalBasis s
⊢ ⋃₀ insert ∅ s = univ

Tactic:
rw [sUnion_insert, empty_union, h.sUnion_eq]

Result:
no goals