l3lab/ntp-mathlib huggingface dataset:
@[simp] lemma exterior_eq_empty : exterior s = ∅ ↔ s = ∅ :=
  ⟨eq_bot_mono subset_exterior, by 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
s t : Set α
a x y : α
⊢ s = ∅ → exterior s = ∅

Next tactic:
rintro rfl
@[simp] lemma exterior_eq_empty : exterior s = ∅ ↔ s = ∅ :=
  ⟨eq_bot_mono subset_exterior, by rintro rfl; 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝¹ : TopologicalSpace α
inst✝ : TopologicalSpace β
t : Set α
a x y : α
⊢ exterior ∅ = ∅

Next tactic:
exact exterior_empty
@[simp] lemma isOpen_exterior : IsOpen (exterior s) := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ IsOpen (exterior s)

Next tactic:
rw [exterior_def]
@[simp] lemma isOpen_exterior : IsOpen (exterior s) := by
  rw [exterior_def]; 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ IsOpen (⋂₀ {t | IsOpen t ∧ s ⊆ t})

Next tactic:
exact isOpen_sInter $ fun _ ↦ And.left
@[simp] lemma exterior_subset_iff_isOpen : exterior s ⊆ s ↔ IsOpen s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ exterior s ⊆ s ↔ IsOpen s

Next tactic:
simp only [exterior_eq_iff_isOpen.symm, Subset.antisymm_iff, subset_exterior, and_true]
lemma exterior_singleton_subset_iff_mem_nhds : exterior {a} ⊆ t ↔ t ∈ 𝓝 a := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ exterior {a} ⊆ t ↔ t ∈ 𝓝 a

Next tactic:
simp [exterior_subset_iff_mem_nhdsSet]
lemma gc_exterior_interior : GaloisConnection (exterior : Set α → Set α) interior :=
  fun s t ↦ by 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s✝ t✝ : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
s t : Set α
⊢ exterior s ≤ t ↔ s ≤ interior t

Next tactic:
simp [exterior_subset_iff, subset_interior_iff]
@[simp] lemma nhdsSet_exterior (s : Set α) : 𝓝ˢ (exterior s) = 𝓝ˢ s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s✝ t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
s : Set α
⊢ 𝓝ˢ (exterior s) = 𝓝ˢ s

Next tactic:
ext t
@[simp] lemma nhdsSet_exterior (s : Set α) : 𝓝ˢ (exterior s) = 𝓝ˢ s := by
  ext t; 

Proof state:
case a
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s✝ t✝ : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
s t : Set α
⊢ t ∈ 𝓝ˢ (exterior s) ↔ t ∈ 𝓝ˢ s

Next tactic:
simp_rw [← exterior_subset_iff_mem_nhdsSet, exterior_exterior]
@[simp] lemma principal_exterior (s : Set α) : 𝓟 (exterior s) = 𝓝ˢ s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s✝ t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
s : Set α
⊢ 𝓟 (exterior s) = 𝓝ˢ s

Next tactic:
rw [← nhdsSet_exterior, isOpen_exterior.nhdsSet_eq]
@[simp] lemma exterior_subset_exterior : exterior s ⊆ exterior t ↔ 𝓝ˢ s ≤ 𝓝ˢ t := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ exterior s ⊆ exterior t ↔ 𝓝ˢ s ≤ 𝓝ˢ t

Next tactic:
refine ⟨?_, fun h ↦ ker_mono h⟩
@[simp] lemma exterior_subset_exterior : exterior s ⊆ exterior t ↔ 𝓝ˢ s ≤ 𝓝ˢ t := by
  refine ⟨?_, fun h ↦ ker_mono h⟩
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ exterior s ⊆ exterior t → 𝓝ˢ s ≤ 𝓝ˢ t

Next tactic:
simp_rw [le_def, ← exterior_subset_iff_mem_nhdsSet]
@[simp] lemma exterior_subset_exterior : exterior s ⊆ exterior t ↔ 𝓝ˢ s ≤ 𝓝ˢ t := by
  refine ⟨?_, fun h ↦ ker_mono h⟩
  simp_rw [le_def, ← exterior_subset_iff_mem_nhdsSet]
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ exterior s ⊆ exterior t → ∀ (x : Set α), exterior t ⊆ x → exterior s ⊆ x

Next tactic:
exact fun h u ↦ h.trans
lemma specializes_iff_exterior_subset : x ⤳ y ↔ exterior {x} ⊆ exterior {y} := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ x ⤳ y ↔ exterior {x} ⊆ exterior {y}

Next tactic:
simp [Specializes]
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
⊢ IsOpen s ↔ ∀ (x y : α), x ⤳ y → y ∈ s → x ∈ s

Next tactic:
refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : ∀ (x y : α), x ⤳ y → y ∈ s → x ∈ s
⊢ IsOpen s

Next tactic:
simp_rw [specializes_iff_exterior_subset] at hs
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
  simp_rw [specializes_iff_exterior_subset] at hs
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : ∀ (x y : α), exterior {x} ⊆ exterior {y} → y ∈ s → x ∈ s
⊢ IsOpen s

Next tactic:
simp_rw [isOpen_iff_mem_nhds, mem_nhds_iff]
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
  simp_rw [specializes_iff_exterior_subset] at hs
  simp_rw [isOpen_iff_mem_nhds, mem_nhds_iff]
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : ∀ (x y : α), exterior {x} ⊆ exterior {y} → y ∈ s → x ∈ s
⊢ ∀ a ∈ s, ∃ t ⊆ s, IsOpen t ∧ a ∈ t

Next tactic:
rintro a ha
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
  simp_rw [specializes_iff_exterior_subset] at hs
  simp_rw [isOpen_iff_mem_nhds, mem_nhds_iff]
  rintro a ha
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a✝ x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : ∀ (x y : α), exterior {x} ⊆ exterior {y} → y ∈ s → x ∈ s
a : α
ha : a ∈ s
⊢ ∃ t ⊆ s, IsOpen t ∧ a ∈ t

Next tactic:
refine ⟨_, fun b hb ↦ hs _ _ ?_ ha, isOpen_exterior, subset_exterior $ mem_singleton _⟩
lemma isOpen_iff_forall_specializes : IsOpen s ↔ ∀ x y, x ⤳ y → y ∈ s → x ∈ s := by
  refine' ⟨fun hs x y hxy ↦ hxy.mem_open hs, fun hs ↦ _⟩
  simp_rw [specializes_iff_exterior_subset] at hs
  simp_rw [isOpen_iff_mem_nhds, mem_nhds_iff]
  rintro a ha
  refine ⟨_, fun b hb ↦ hs _ _ ?_ ha, isOpen_exterior, subset_exterior $ mem_singleton _⟩
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a✝ x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : ∀ (x y : α), exterior {x} ⊆ exterior {y} → y ∈ s → x ∈ s
a : α
ha : a ∈ s
b : α
hb : b ∈ exterior {a}
⊢ exterior {b} ⊆ exterior {a}

Next tactic:
rwa [isOpen_exterior.exterior_subset, singleton_subset_iff]
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
⊢ IsCompact (exterior s)

Next tactic:
classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
  exact fun _ ↦ hf _
  refine fun a ha ↦ mem_iUnion₂.2 ⟨_, ?_, hg _ $ subset_exterior ha⟩
  simp only [Finset.mem_image, Finset.mem_attach, true_and, Subtype.exists, Finite.mem_toFinset]
  exact ⟨a, ha, rfl⟩
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
⊢ IsCompact (exterior s)

Next tactic:
refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
⊢ ∃ t, exterior s ⊆ ⋃ i ∈ t, f i

Next tactic:
choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
⊢ ∃ t, exterior s ⊆ ⋃ i ∈ t, f i

Next tactic:
refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
  

Proof state:
case refine_1
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
i : ι✝
⊢ i ∈ Finset.image (fun a => g ↑a (_ : ↑a ∈ exterior s)) (Finset.attach (Finite.toFinset hs)) → IsOpen (f i)
case refine_2
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
⊢ s ⊆ ⋃ i ∈ Finset.image (fun a => g ↑a (_ : ↑a ∈ exterior s)) (Finset.attach (Finite.toFinset hs)), f i

Next tactic:
exact fun _ ↦ hf _
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
  exact fun _ ↦ hf _
  

Proof state:
case refine_2
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
⊢ s ⊆ ⋃ i ∈ Finset.image (fun a => g ↑a (_ : ↑a ∈ exterior s)) (Finset.attach (Finite.toFinset hs)), f i

Next tactic:
refine fun a ha ↦ mem_iUnion₂.2 ⟨_, ?_, hg _ $ subset_exterior ha⟩
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
  exact fun _ ↦ hf _
  refine fun a ha ↦ mem_iUnion₂.2 ⟨_, ?_, hg _ $ subset_exterior ha⟩
  

Proof state:
case refine_2
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a✝ x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
a : α
ha : a ∈ s
⊢ g a (_ : a ∈ exterior s) ∈ Finset.image (fun a => g ↑a (_ : ↑a ∈ exterior s)) (Finset.attach (Finite.toFinset hs))

Next tactic:
simp only [Finset.mem_image, Finset.mem_attach, true_and, Subtype.exists, Finite.mem_toFinset]
lemma Set.Finite.isCompact_exterior (hs : s.Finite) : IsCompact (exterior s) := by
  classical
  refine isCompact_of_finite_subcover fun f hf hsf ↦ ?_
  choose g hg using fun a (ha : a ∈ exterior s) ↦ mem_iUnion.1 (hsf ha)
  refine ⟨hs.toFinset.attach.image fun a ↦ g a.1 $ subset_exterior $ (Finite.mem_toFinset _).1 a.2,
    (isOpen_iUnion fun i ↦ isOpen_iUnion ?_).exterior_subset.2 ?_⟩
  exact fun _ ↦ hf _
  refine fun a ha ↦ mem_iUnion₂.2 ⟨_, ?_, hg _ $ subset_exterior ha⟩
  simp only [Finset.mem_image, Finset.mem_attach, true_and, Subtype.exists, Finite.mem_toFinset]
  

Proof state:
case refine_2
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a✝ x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
hs : Set.Finite s
ι✝ : Type u_3
f : ι✝ → Set α
hf : ∀ (i : ι✝), IsOpen (f i)
hsf : exterior s ⊆ ⋃ i, f i
g : (a : α) → a ∈ exterior s → ι✝
hg : ∀ (a : α) (ha : a ∈ exterior s), a ∈ f (g a ha)
a : α
ha : a ∈ s
⊢ ∃ a_1,
    ∃ (h : a_1 ∈ s),
      g a_1 (_ : ↑{ val := a_1, property := (_ : a_1 ∈ Finite.toFinset hs) } ∈ exterior s) = g a (_ : a ∈ exterior s)

Next tactic:
exact ⟨a, ha, rfl⟩
lemma Inducing.alexandrovDiscrete {f : β → α} (h : Inducing f) : AlexandrovDiscrete β where
  isOpen_sInter S hS := by
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
f : β → α
h : Inducing f
S : Set (Set β)
hS : ∀ s ∈ S, IsOpen s
⊢ IsOpen (⋂₀ S)

Next tactic:
simp_rw [h.isOpen_iff] at hS ⊢
lemma Inducing.alexandrovDiscrete {f : β → α} (h : Inducing f) : AlexandrovDiscrete β where
  isOpen_sInter S hS := by
    simp_rw [h.isOpen_iff] at hS ⊢
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
f : β → α
h : Inducing f
S : Set (Set β)
hS : ∀ s ∈ S, ∃ t, IsOpen t ∧ f ⁻¹' t = s
⊢ ∃ t, IsOpen t ∧ f ⁻¹' t = ⋂₀ S

Next tactic:
choose U hU htU using hS
lemma Inducing.alexandrovDiscrete {f : β → α} (h : Inducing f) : AlexandrovDiscrete β where
  isOpen_sInter S hS := by
    simp_rw [h.isOpen_iff] at hS ⊢
    choose U hU htU using hS
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
f : β → α
h : Inducing f
S : Set (Set β)
U : (s : Set β) → s ∈ S → Set α
hU : ∀ (s : Set β) (a : s ∈ S), IsOpen (U s a)
htU : ∀ (s : Set β) (a : s ∈ S), f ⁻¹' U s a = s
⊢ ∃ t, IsOpen t ∧ f ⁻¹' t = ⋂₀ S

Next tactic:
refine ⟨_, isOpen_iInter₂ hU, ?_⟩
lemma Inducing.alexandrovDiscrete {f : β → α} (h : Inducing f) : AlexandrovDiscrete β where
  isOpen_sInter S hS := by
    simp_rw [h.isOpen_iff] at hS ⊢
    choose U hU htU using hS
    refine ⟨_, isOpen_iInter₂ hU, ?_⟩
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
f : β → α
h : Inducing f
S : Set (Set β)
U : (s : Set β) → s ∈ S → Set α
hU : ∀ (s : Set β) (a : s ∈ S), IsOpen (U s a)
htU : ∀ (s : Set β) (a : s ∈ S), f ⁻¹' U s a = s
⊢ f ⁻¹' ⋂ i, ⋂ (j : i ∈ S), U i j = ⋂₀ S

Next tactic:
simp_rw [preimage_iInter, htU, sInter_eq_biInter]
lemma alexandrovDiscrete_coinduced {β : Type*} {f : α → β} :
    @AlexandrovDiscrete β (coinduced f ‹_›) :=
  @AlexandrovDiscrete.mk β (coinduced f ‹_›) fun S hS ↦ by
    

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β✝ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β✝
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β✝
β : Type u_5
f : α → β
S : Set (Set β)
hS : ∀ s ∈ S, IsOpen s
⊢ IsOpen (⋂₀ S)

Next tactic:
rw [isOpen_coinduced, preimage_sInter]
lemma alexandrovDiscrete_coinduced {β : Type*} {f : α → β} :
    @AlexandrovDiscrete β (coinduced f ‹_›) :=
  @AlexandrovDiscrete.mk β (coinduced f ‹_›) fun S hS ↦ by
    rw [isOpen_coinduced, preimage_sInter]; 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β✝ : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β✝
s t : Set α
a x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β✝
β : Type u_5
f : α → β
S : Set (Set β)
hS : ∀ s ∈ S, IsOpen s
⊢ IsOpen (⋂ t ∈ S, f ⁻¹' t)

Next tactic:
exact isOpen_iInter₂ hS
instance AlexandrovDiscrete.toFirstCountable : FirstCountableTopology α where
  nhds_generated_countable a := ⟨{exterior {a}}, countable_singleton _, by 

Proof state:
ι : Sort u_1
κ : ι → Sort u_2
α : Type u_3
β : Type u_4
inst✝³ : TopologicalSpace α
inst✝² : TopologicalSpace β
s t : Set α
a✝ x y : α
inst✝¹ : AlexandrovDiscrete α
inst✝ : AlexandrovDiscrete β
a : α
⊢ 𝓝 a = generate {exterior {a}}

Next tactic:
simp
/-- This is an auxiliary lemma for `measurable_kernel_prod_mk_left`. -/
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
    (hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
  -- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
  -- by boxes to prove the result by induction.
  -- Porting note: added motive
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
a : α
t : Set (α × β)
ht : MeasurableSet t
hκs : ∀ (a : α), IsFiniteMeasure (κ a)
⊢ Measurable fun a => ↑↑(κ a) (Prod.mk a ⁻¹' t)

Next tactic:
refine' MeasurableSpace.induction_on_inter
    (C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
    generateFrom_prod.symm isPiSystem_prod _ _ _ _ ht
/-- This is an auxiliary lemma for `measurable_kernel_prod_mk_left`. -/
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
    (hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
  -- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
  -- by boxes to prove the result by induction.
  -- Porting note: added motive
  refine' MeasurableSpace.induction_on_inter
    (C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
    generateFrom_prod.symm isPiSystem_prod _ _ _ _ ht
  ·-- case `t = ∅`
    

Proof state:
case refine'_1
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
a : α
t : Set (α × β)
ht : MeasurableSet t
hκs : ∀ (a : α), IsFiniteMeasure (κ a)
⊢ (fun t => Measurable fun a => ↑↑(κ a) (Prod.mk a ⁻¹' t)) ∅

Next tactic:
simp only [preimage_empty, measure_empty, measurable_const]
/-- This is an auxiliary lemma for `measurable_kernel_prod_mk_left`. -/
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
    (hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
  -- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
  -- by boxes to prove the result by induction.
  -- Porting note: added motive
  refine' MeasurableSpace.induction_on_inter
    (C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
    generateFrom_prod.symm isPiSystem_prod _ _ _ _ ht
  ·-- case `t = ∅`
    simp only [preimage_empty, measure_empty, measurable_const]
  · -- case of a box: `t = t₁ ×ˢ t₂` for measurable sets `t₁` and `t₂`
    

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
a : α
t : Set (α × β)
ht : MeasurableSet t
hκs : ∀ (a : α), IsFiniteMeasure (κ a)
⊢ ∀ t ∈ image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t},
    (fun t => Measurable fun a => ↑↑(κ a) (Prod.mk a ⁻¹' t)) t

Next tactic:
intro t' ht'
/-- This is an auxiliary lemma for `measurable_kernel_prod_mk_left`. -/
theorem measurable_kernel_prod_mk_left_of_finite {t : Set (α × β)} (ht : MeasurableSet t)
    (hκs : ∀ a, IsFiniteMeasure (κ a)) : Measurable fun a => κ a (Prod.mk a ⁻¹' t) := by
  -- `t` is a measurable set in the product `α × β`: we use that the product σ-algebra is generated
  -- by boxes to prove the result by induction.
  -- Porting note: added motive
  refine' MeasurableSpace.induction_on_inter
    (C := fun t => Measurable fun a => κ a (Prod.mk a ⁻¹' t))
    generateFrom_prod.symm isPiSystem_prod _ _ _ _ ht
  ·-- case `t = ∅`
    simp only [preimage_empty, measure_empty, measurable_const]
  · -- case of a box: `t = t₁ ×ˢ t₂` for measurable sets `t₁` and `t₂`
    intro t' ht'
    

Proof state:
case refine'_2
α : Type u_1
β : Type u_2
γ : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
mγ : MeasurableSpace γ
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
a : α
t : Set (α × β)
ht : MeasurableSet t
hκs : ∀ (a : α), IsFiniteMeasure (κ a)
t' : Set (α × β)
ht' : t' ∈ image2 (fun x x_1 => x ×ˢ x_1) {s | MeasurableSet s} {t | MeasurableSet t}
⊢ Measurable fun a => ↑↑(κ a) (Prod.mk a ⁻¹' t')

Next tactic:
simp only [Set.mem_image2, Set.mem_setOf_eq, exists_and_left] at ht'