Theorem: refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set
File: Mathlib/Topology/Paracompact.lean

tactic: set K' : CompactExhaustion X := CompactExhaustion.choice X
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: set K : CompactExhaustion X := K'.shiftr.shiftr
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: set Kdiff := fun n ↦ K (n + 1) \ interior (K n)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: have hKcov : ∀ x, x ∈ Kdiff (K'.find x + 1) := by
  intro x
  simpa only [K'.find_shiftr] using
    diff_subset_diff_right interior_subset (K'.shiftr.mem_diff_shiftr_find x)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: have Kdiffc : ∀ n, IsCompact (Kdiff n ∩ s) :=
  fun n ↦ ((K.isCompact _).diff isOpen_interior).inter_right hs
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: have : ∀ (n) (x : ↑(Kdiff (n + 1) ∩ s)), K nᶜ ∈ 𝓝 (x : X) :=
  fun n x ↦ IsOpen.mem_nhds (K.isClosed n).isOpen_compl
    fun hx' ↦ x.2.1.2 <| K.subset_interior_succ _ hx'
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: choose! r hrp hr using fun n (x : ↑(Kdiff (n + 1) ∩ s)) ↦ (hB x x.2.2).mem_iff.1 (this n x)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: have hxr : ∀ (n x) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n ⟨x, hx⟩) ∈ 𝓝 x := fun n x hx ↦
  (hB x hx.2).mem_of_mem (hrp _ ⟨x, hx⟩)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: choose T hT using fun n ↦ (Kdiffc (n + 1)).elim_nhds_subcover' _ (hxr n)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: set T' : ∀ n, Set ↑(Kdiff (n + 1) ∩ s) := fun n ↦ T n
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: refine' ⟨Σn, T' n, fun a ↦ a.2, fun a ↦ r a.1 a.2, _, _, _⟩
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
⊢ ∃ α c r, (∀ (a : α), c a ∈ s ∧ p (c a) (r a)) ∧ (s ⊆ ⋃ (a : α), B (c a) (r a)) ∧ LocallyFinite fun a => B (c a) (r a)

tactic: intro x
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
⊢ ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)

tactic: simpa only [K'.find_shiftr] using
  diff_subset_diff_right interior_subset (K'.shiftr.mem_diff_shiftr_find x)
state_before: ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
x : X
⊢ x ∈ Kdiff (CompactExhaustion.find K' x + 1)

tactic: rintro ⟨n, x, hx⟩
state_before: case refine'_1
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
⊢ ∀ (a : (n : ℕ) × ↑(T' n)), (fun a => ↑↑a.snd) a ∈ s ∧ p ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)

tactic: exact ⟨x.2.2, hrp _ _⟩
state_before: case refine'_1.mk.mk
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
n : ℕ
x : ↑(Kdiff (n + 1) ∩ s)
hx : x ∈ T' n
⊢ (fun a => ↑↑a.snd) { fst := n, snd := { val := x, property := hx } } ∈ s ∧
    p ((fun a => ↑↑a.snd) { fst := n, snd := { val := x, property := hx } })
      ((fun a => r a.fst ↑a.snd) { fst := n, snd := { val := x, property := hx } })

tactic: refine' fun x hx ↦ mem_iUnion.2 _
state_before: case refine'_2
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
⊢ s ⊆ ⋃ (a : (n : ℕ) × ↑(T' n)), B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)

tactic: rcases mem_iUnion₂.1 (hT _ ⟨hKcov x, hx⟩) with ⟨⟨c, hc⟩, hcT, hcx⟩
state_before: case refine'_2
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
hx : x ∈ s
⊢ ∃ i, x ∈ B ((fun a => ↑↑a.snd) i) ((fun a => r a.fst ↑a.snd) i)

tactic: exact ⟨⟨_, ⟨c, hc⟩, hcT⟩, hcx⟩
state_before: case refine'_2.intro.mk.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
hx : x ∈ s
c : X
hc : c ∈ Kdiff (CompactExhaustion.find K' x + 1) ∩ s
hcT : { val := c, property := hc } ∈ T (CompactExhaustion.find K' x)
hcx :
  x ∈
    B (↑{ val := c, property := hc })
      (r (CompactExhaustion.find K' x)
        { val := ↑{ val := c, property := hc },
          property := (_ : ↑{ val := c, property := hc } ∈ Kdiff (CompactExhaustion.find K' x + 1) ∩ s) })
⊢ ∃ i, x ∈ B ((fun a => ↑↑a.snd) i) ((fun a => r a.fst ↑a.snd) i)

tactic: intro x
state_before: case refine'_3
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
⊢ LocallyFinite fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)

tactic: refine'
  ⟨interior (K (K'.find x + 3)),
    IsOpen.mem_nhds isOpen_interior (K.subset_interior_succ _ (hKcov x).1), _⟩
state_before: case refine'_3
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
⊢ ∃ t, t ∈ 𝓝 x ∧ Set.Finite {i | Set.Nonempty ((fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)) i ∩ t)}

tactic: have : (⋃ k ≤ K'.find x + 2, range <| Sigma.mk k : Set (Σn, T' n)).Finite :=
  (finite_le_nat _).biUnion fun k _ ↦ finite_range _
state_before: case refine'_3
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
⊢ Set.Finite
    {i |
      Set.Nonempty
        ((fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)) i ∩
          interior (CompactExhaustion.toFun K (CompactExhaustion.find K' x + 3)))}

tactic: apply this.subset
state_before: case refine'_3
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k))
⊢ Set.Finite
    {i |
      Set.Nonempty
        ((fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)) i ∩
          interior (CompactExhaustion.toFun K (CompactExhaustion.find K' x + 3)))}

tactic: rintro ⟨k, c, hc⟩
state_before: case refine'_3
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k))
⊢ {i |
      Set.Nonempty
        ((fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)) i ∩
          interior (CompactExhaustion.toFun K (CompactExhaustion.find K' x + 3)))} ⊆
    ⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k)

tactic: simp only [mem_iUnion, mem_setOf_eq, mem_image, Subtype.coe_mk]
state_before: case refine'_3.mk.mk
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
⊢ { fst := k, snd := { val := c, property := hc } } ∈
      {i |
        Set.Nonempty
          ((fun a => B ((fun a => ↑↑a.snd) a) ((fun a => r a.fst ↑a.snd) a)) i ∩
            interior (CompactExhaustion.toFun K (CompactExhaustion.find K' x + 3)))} →
    { fst := k, snd := { val := c, property := hc } } ∈
      ⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k)

tactic: rintro ⟨x, hxB : x ∈ B c (r k c), hxK⟩
state_before: case refine'_3.mk.mk
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
⊢ Set.Nonempty
      (B (↑c) (r k c) ∩
        interior
          (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
            (CompactExhaustion.find (CompactExhaustion.choice X) x + 3))) →
    ∃ i i_1, { fst := k, snd := { val := c, property := hc } } ∈ range (Sigma.mk i)

tactic: refine' ⟨k, _, ⟨c, hc⟩, rfl⟩
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
⊢ ∃ i i_1, { fst := k, snd := { val := c, property := hc } } ∈ range (Sigma.mk i)

tactic: have := (mem_compl_iff _ _).1 (hr k c hxB)
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
⊢ k ≤ CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 2

tactic: revert this
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝¹ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this✝ : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
this : ¬x ∈ CompactExhaustion.toFun K k
⊢ k ≤ CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 2

tactic: contrapose!
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
⊢ ¬x ∈ CompactExhaustion.toFun K k → k ≤ CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 2

tactic: simp only [ge_iff_le, not_le]
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
⊢ ¬k ≤ CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 2 →
    x ∈ CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr K')) k

tactic: exact fun hnk ↦ K.subset hnk (interior_subset hxK)
state_before: case refine'_3.mk.mk.intro.intro
ι✝ : Type u
X : Type v
Y : Type w
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : LocallyCompactSpace X
inst✝¹ : SigmaCompactSpace X
inst✝ : T2Space X
ι : X → Type u
p : (x : X) → ι x → Prop
B : (x : X) → ι x → Set X
s : Set X
hs : IsClosed s
hB : ∀ (x : X), x ∈ s → HasBasis (𝓝 x) (p x) (B x)
K' : CompactExhaustion X := CompactExhaustion.choice X
K : CompactExhaustion X := CompactExhaustion.shiftr (CompactExhaustion.shiftr K')
Kdiff : ℕ → Set X := fun n => CompactExhaustion.toFun K (n + 1) \ interior (CompactExhaustion.toFun K n)
hKcov : ∀ (x : X), x ∈ Kdiff (CompactExhaustion.find K' x + 1)
Kdiffc : ∀ (n : ℕ), IsCompact (Kdiff n ∩ s)
this✝ : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), CompactExhaustion.toFun K nᶜ ∈ 𝓝 ↑x
r : (n : ℕ) → (x : ↑(Kdiff (n + 1) ∩ s)) → ι ↑x
hrp : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), p (↑x) (r n x)
hr : ∀ (n : ℕ) (x : ↑(Kdiff (n + 1) ∩ s)), B (↑x) (r n x) ⊆ CompactExhaustion.toFun K nᶜ
hxr : ∀ (n : ℕ) (x : X) (hx : x ∈ Kdiff (n + 1) ∩ s), B x (r n { val := x, property := hx }) ∈ 𝓝 x
T : (n : ℕ) → Finset ↑(Kdiff (n + 1) ∩ s)
hT :
  ∀ (n : ℕ),
    Kdiff (n + 1) ∩ s ⊆
      ⋃ (x : ↑(Kdiff (n + 1) ∩ s)) (_ : x ∈ T n), B (↑x) (r n { val := ↑x, property := (_ : ↑x ∈ Kdiff (n + 1) ∩ s) })
T' : (n : ℕ) → Set ↑(Kdiff (n + 1) ∩ s) := fun n => ↑(T n)
x✝ : X
this : Set.Finite (⋃ (k : ℕ) (_ : k ≤ CompactExhaustion.find K' x✝ + 2), range (Sigma.mk k))
k : ℕ
c : ↑(Kdiff (k + 1) ∩ s)
hc : c ∈ T' k
x : X
hxB : x ∈ B (↑c) (r k c)
hxK :
  x ∈
    interior
      (CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X)))
        (CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 3))
⊢ CompactExhaustion.find (CompactExhaustion.choice X) x✝ + 2 < k →
    x ∈ CompactExhaustion.toFun (CompactExhaustion.shiftr (CompactExhaustion.shiftr (CompactExhaustion.choice X))) k