l3lab/ntp-mathlib huggingface dataset:
/-- If `f` tends to a countably generated filter `l` along `Filter.cofinite`,
then for all but countably many elements, `f x ∈ l.ker`. -/
theorem Tendsto.countable_compl_preimage_ker {f : α → β}
    {l : Filter β} [l.IsCountablyGenerated] (h : Tendsto f cofinite l) :
    Set.Countable (f ⁻¹' l.ker)ᶜ := by 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l✝ : Filter α
f : α → β
l : Filter β
inst✝ : IsCountablyGenerated l
h : Tendsto f cofinite l
⊢ Set.Countable (f ⁻¹' ker l)ᶜ

Next tactic:
rw [← ker_comap]
/-- If `f` tends to a countably generated filter `l` along `Filter.cofinite`,
then for all but countably many elements, `f x ∈ l.ker`. -/
theorem Tendsto.countable_compl_preimage_ker {f : α → β}
    {l : Filter β} [l.IsCountablyGenerated] (h : Tendsto f cofinite l) :
    Set.Countable (f ⁻¹' l.ker)ᶜ := by rw [← ker_comap]; 

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l✝ : Filter α
f : α → β
l : Filter β
inst✝ : IsCountablyGenerated l
h : Tendsto f cofinite l
⊢ Set.Countable (ker (comap f l))ᶜ

Next tactic:
exact countable_compl_ker h.le_comap
lemma Set.Finite.cofinite_inf_principal_compl {s : Set α} (hs : s.Finite) :
    cofinite ⊓ 𝓟 sᶜ = cofinite := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
s : Set α
hs : Set.Finite s
⊢ cofinite ⊓ 𝓟 sᶜ = cofinite

Next tactic:
simpa using hs.compl_mem_cofinite
lemma Set.Finite.cofinite_inf_principal_diff {s t : Set α} (ht : t.Finite) :
    cofinite ⊓ 𝓟 (s \ t) = cofinite ⊓ 𝓟 s := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
s t : Set α
ht : Set.Finite t
⊢ cofinite ⊓ 𝓟 (s \ t) = cofinite ⊓ 𝓟 s

Next tactic:
rw [diff_eq, ← inf_principal, ← inf_assoc, inf_right_comm, ht.cofinite_inf_principal_compl]
/-- For natural numbers the filters `Filter.cofinite` and `Filter.atTop` coincide. -/
theorem Nat.cofinite_eq_atTop : @cofinite ℕ = atTop := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
⊢ cofinite = atTop

Next tactic:
refine' le_antisymm _ atTop_le_cofinite
/-- For natural numbers the filters `Filter.cofinite` and `Filter.atTop` coincide. -/
theorem Nat.cofinite_eq_atTop : @cofinite ℕ = atTop := by
  refine' le_antisymm _ atTop_le_cofinite
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
⊢ cofinite ≤ atTop

Next tactic:
refine' atTop_basis.ge_iff.2 fun N _ => _
/-- For natural numbers the filters `Filter.cofinite` and `Filter.atTop` coincide. -/
theorem Nat.cofinite_eq_atTop : @cofinite ℕ = atTop := by
  refine' le_antisymm _ atTop_le_cofinite
  refine' atTop_basis.ge_iff.2 fun N _ => _
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
N : ℕ
x✝ : True
⊢ Ici N ∈ cofinite

Next tactic:
simpa only [mem_cofinite, compl_Ici] using finite_lt_nat N
theorem Nat.frequently_atTop_iff_infinite {p : ℕ → Prop} :
    (∃ᶠ n in atTop, p n) ↔ Set.Infinite { n | p n } := by
  

Proof state:
ι : Type u_1
α : Type u_2
β : Type u_3
l : Filter α
p : ℕ → Prop
⊢ (∃ᶠ (n : ℕ) in atTop, p n) ↔ Set.Infinite {n | p n}

Next tactic:
rw [← Nat.cofinite_eq_atTop, frequently_cofinite_iff_infinite]
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  

Proof state:
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    

Proof state:
case inl.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
y : α
hys : y ∈ s
x : β
hx : f y < x
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    

Proof state:
case inl.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
y : α
hys : y ∈ s
x : β
hx : f y < x
this : Set.Finite {y | ¬x ≤ f y}
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
simp only [not_le] at this
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    

Proof state:
case inl.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
y : α
hys : y ∈ s
x : β
hx : f y < x
this : Set.Finite {y | f y < x}
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
    

Proof state:
case inl.intro.intro.intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
y : α
hys : y ∈ s
x : β
hx : f y < x
this : Set.Finite {y | f y < x}
a₀ : α
others_bigger : ∀ b ∈ {y | f y < x} ∩ s, f a₀ ≤ f b
ha₀ : f a₀ < x
ha₀s : a₀ ∈ s
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
refine' ⟨a₀, ha₀s, fun a has => (lt_or_le (f a) x).elim _ (le_trans ha₀.le)⟩
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
    refine' ⟨a₀, ha₀s, fun a has => (lt_or_le (f a) x).elim _ (le_trans ha₀.le)⟩
    

Proof state:
case inl.intro.intro.intro.intro.intro.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
y : α
hys : y ∈ s
x : β
hx : f y < x
this : Set.Finite {y | f y < x}
a₀ : α
others_bigger : ∀ b ∈ {y | f y < x} ∩ s, f a₀ ≤ f b
ha₀ : f a₀ < x
ha₀s : a₀ ∈ s
a : α
has : a ∈ s
⊢ f a < x → f a₀ ≤ f a

Next tactic:
exact fun h => others_bigger a ⟨h, has⟩
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
    refine' ⟨a₀, ha₀s, fun a has => (lt_or_le (f a) x).elim _ (le_trans ha₀.le)⟩
    exact fun h => others_bigger a ⟨h, has⟩
  · -- in this case, f is constant because all values are at top
    

Proof state:
case inr
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
not_all_top : ¬∃ y ∈ s, ∃ x, f y < x
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
push_neg at not_all_top
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
    refine' ⟨a₀, ha₀s, fun a has => (lt_or_le (f a) x).elim _ (le_trans ha₀.le)⟩
    exact fun h => others_bigger a ⟨h, has⟩
  · -- in this case, f is constant because all values are at top
    push_neg at not_all_top
    

Proof state:
case inr
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
hs : Set.Nonempty s
f : α → β
hf : Tendsto f cofinite atTop
not_all_top : ∀ y ∈ s, ∀ (x : β), x ≤ f y
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
obtain ⟨a₀, ha₀s⟩ := hs
theorem Filter.Tendsto.exists_within_forall_le {α β : Type*} [LinearOrder β] {s : Set α}
    (hs : s.Nonempty) {f : α → β} (hf : Filter.Tendsto f Filter.cofinite Filter.atTop) :
    ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a := by
  rcases em (∃ y ∈ s, ∃ x, f y < x) with (⟨y, hys, x, hx⟩ | not_all_top)
  · -- the set of points `{y | f y < x}` is nonempty and finite, so we take `min` over this set
    have : { y | ¬x ≤ f y }.Finite := Filter.eventually_cofinite.mp (tendsto_atTop.1 hf x)
    simp only [not_le] at this
    obtain ⟨a₀, ⟨ha₀ : f a₀ < x, ha₀s⟩, others_bigger⟩ :=
      exists_min_image _ f (this.inter_of_left s) ⟨y, hx, hys⟩
    refine' ⟨a₀, ha₀s, fun a has => (lt_or_le (f a) x).elim _ (le_trans ha₀.le)⟩
    exact fun h => others_bigger a ⟨h, has⟩
  · -- in this case, f is constant because all values are at top
    push_neg at not_all_top
    obtain ⟨a₀, ha₀s⟩ := hs
    

Proof state:
case inr.intro
ι : Type u_1
α✝ : Type u_2
β✝ : Type u_3
l : Filter α✝
α : Type u_4
β : Type u_5
inst✝ : LinearOrder β
s : Set α
f : α → β
hf : Tendsto f cofinite atTop
not_all_top : ∀ y ∈ s, ∀ (x : β), x ≤ f y
a₀ : α
ha₀s : a₀ ∈ s
⊢ ∃ a₀ ∈ s, ∀ a ∈ s, f a₀ ≤ f a

Next tactic:
exact ⟨a₀, ha₀s, fun a ha => not_all_top a ha (f a₀)⟩
/-- A key property of `ContinuousMap.compactConvNhd`. It allows us to apply
`TopologicalSpace.nhds_mkOfNhds_filterBasis` below. -/
theorem compactConvNhd_nhd_basis (hV : V ∈ 𝓤 β) :
    ∃ V' ∈ 𝓤 β,
      V' ⊆ V ∧ ∀ g ∈ compactConvNhd K V' f, compactConvNhd K V' g ⊆ compactConvNhd K V f := by
  

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
hV : V ∈ 𝓤 β
⊢ ∃ V' ∈ 𝓤 β, V' ⊆ V ∧ ∀ g ∈ compactConvNhd K V' f, compactConvNhd K V' g ⊆ compactConvNhd K V f

Next tactic:
obtain ⟨V', h₁, h₂⟩ := comp_mem_uniformity_sets hV
/-- A key property of `ContinuousMap.compactConvNhd`. It allows us to apply
`TopologicalSpace.nhds_mkOfNhds_filterBasis` below. -/
theorem compactConvNhd_nhd_basis (hV : V ∈ 𝓤 β) :
    ∃ V' ∈ 𝓤 β,
      V' ⊆ V ∧ ∀ g ∈ compactConvNhd K V' f, compactConvNhd K V' g ⊆ compactConvNhd K V f := by
  obtain ⟨V', h₁, h₂⟩ := comp_mem_uniformity_sets hV
  

Proof state:
case intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
hV : V ∈ 𝓤 β
V' : Set (β × β)
h₁ : V' ∈ 𝓤 β
h₂ : V' ○ V' ⊆ V
⊢ ∃ V' ∈ 𝓤 β, V' ⊆ V ∧ ∀ g ∈ compactConvNhd K V' f, compactConvNhd K V' g ⊆ compactConvNhd K V f

Next tactic:
exact
    ⟨V', h₁, Subset.trans (subset_comp_self_of_mem_uniformity h₁) h₂, fun g hg g' hg' =>
      compactConvNhd_mono f h₂ (compactConvNhd_mem_comp f hg hg')⟩
theorem compactConvNhd_filter_isBasis :
    Filter.IsBasis (fun KV : Set α × Set (β × β) => IsCompact KV.1 ∧ KV.2 ∈ 𝓤 β) fun KV =>
      compactConvNhd KV.1 KV.2 f :=
  { nonempty := compactConvNhd_compact_entourage_nonempty
    inter := by
      

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
⊢ ∀ {i j : Set α × Set (β × β)},
    IsCompact i.1 ∧ i.2 ∈ 𝓤 β →
      IsCompact j.1 ∧ j.2 ∈ 𝓤 β →
        ∃ k,
          (IsCompact k.1 ∧ k.2 ∈ 𝓤 β) ∧ compactConvNhd k.1 k.2 f ⊆ compactConvNhd i.1 i.2 f ∩ compactConvNhd j.1 j.2 f

Next tactic:
rintro ⟨K₁, V₁⟩ ⟨K₂, V₂⟩ ⟨hK₁, hV₁⟩ ⟨hK₂, hV₂⟩
theorem compactConvNhd_filter_isBasis :
    Filter.IsBasis (fun KV : Set α × Set (β × β) => IsCompact KV.1 ∧ KV.2 ∈ 𝓤 β) fun KV =>
      compactConvNhd KV.1 KV.2 f :=
  { nonempty := compactConvNhd_compact_entourage_nonempty
    inter := by
      rintro ⟨K₁, V₁⟩ ⟨K₂, V₂⟩ ⟨hK₁, hV₁⟩ ⟨hK₂, hV₂⟩
      

Proof state:
case mk.mk.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
K₁ : Set α
V₁ : Set (β × β)
K₂ : Set α
V₂ : Set (β × β)
hK₁ : IsCompact (K₁, V₁).1
hV₁ : (K₁, V₁).2 ∈ 𝓤 β
hK₂ : IsCompact (K₂, V₂).1
hV₂ : (K₂, V₂).2 ∈ 𝓤 β
⊢ ∃ k,
    (IsCompact k.1 ∧ k.2 ∈ 𝓤 β) ∧
      compactConvNhd k.1 k.2 f ⊆ compactConvNhd (K₁, V₁).1 (K₁, V₁).2 f ∩ compactConvNhd (K₂, V₂).1 (K₂, V₂).2 f

Next tactic:
exact
        ⟨⟨K₁ ∪ K₂, V₁ ∩ V₂⟩, ⟨hK₁.union hK₂, Filter.inter_mem hV₁ hV₂⟩,
          compactConvNhd_subset_inter f K₁ K₂ V₁ V₂⟩
theorem mem_compactConvergence_nhd_filter (Y : Set C(α, β)) :
    Y ∈ (compactConvergenceFilterBasis f).filter ↔
    ∃ (K : Set α) (V : Set (β × β)) (_hK : IsCompact K) (_hV : V ∈ 𝓤 β),
      compactConvNhd K V f ⊆ Y := by
  

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
Y : Set C(α, β)
⊢ Y ∈ FilterBasis.filter (compactConvergenceFilterBasis f) ↔
    ∃ K V, ∃ (_ : IsCompact K) (_ : V ∈ 𝓤 β), compactConvNhd K V f ⊆ Y

Next tactic:
constructor
theorem mem_compactConvergence_nhd_filter (Y : Set C(α, β)) :
    Y ∈ (compactConvergenceFilterBasis f).filter ↔
    ∃ (K : Set α) (V : Set (β × β)) (_hK : IsCompact K) (_hV : V ∈ 𝓤 β),
      compactConvNhd K V f ⊆ Y := by
  constructor
  · 

Proof state:
case mp
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
Y : Set C(α, β)
⊢ Y ∈ FilterBasis.filter (compactConvergenceFilterBasis f) →
    ∃ K V, ∃ (_ : IsCompact K) (_ : V ∈ 𝓤 β), compactConvNhd K V f ⊆ Y

Next tactic:
rintro ⟨X, ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩, hY⟩
theorem mem_compactConvergence_nhd_filter (Y : Set C(α, β)) :
    Y ∈ (compactConvergenceFilterBasis f).filter ↔
    ∃ (K : Set α) (V : Set (β × β)) (_hK : IsCompact K) (_hV : V ∈ 𝓤 β),
      compactConvNhd K V f ⊆ Y := by
  constructor
  · rintro ⟨X, ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩, hY⟩
    

Proof state:
case mp.intro.intro.intro.mk.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K✝ : Set α
V✝ : Set (β × β)
f : C(α, β)
Y : Set C(α, β)
K : Set α
V : Set (β × β)
hK : IsCompact (K, V).1
hV : (K, V).2 ∈ 𝓤 β
hY : (fun KV => compactConvNhd KV.1 KV.2 f) (K, V) ⊆ Y
⊢ ∃ K V, ∃ (_ : IsCompact K) (_ : V ∈ 𝓤 β), compactConvNhd K V f ⊆ Y

Next tactic:
exact ⟨K, V, hK, hV, hY⟩
theorem mem_compactConvergence_nhd_filter (Y : Set C(α, β)) :
    Y ∈ (compactConvergenceFilterBasis f).filter ↔
    ∃ (K : Set α) (V : Set (β × β)) (_hK : IsCompact K) (_hV : V ∈ 𝓤 β),
      compactConvNhd K V f ⊆ Y := by
  constructor
  · rintro ⟨X, ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩, hY⟩
    exact ⟨K, V, hK, hV, hY⟩
  · 

Proof state:
case mpr
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
Y : Set C(α, β)
⊢ (∃ K V, ∃ (_ : IsCompact K) (_ : V ∈ 𝓤 β), compactConvNhd K V f ⊆ Y) →
    Y ∈ FilterBasis.filter (compactConvergenceFilterBasis f)

Next tactic:
rintro ⟨K, V, hK, hV, hY⟩
theorem mem_compactConvergence_nhd_filter (Y : Set C(α, β)) :
    Y ∈ (compactConvergenceFilterBasis f).filter ↔
    ∃ (K : Set α) (V : Set (β × β)) (_hK : IsCompact K) (_hV : V ∈ 𝓤 β),
      compactConvNhd K V f ⊆ Y := by
  constructor
  · rintro ⟨X, ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩, hY⟩
    exact ⟨K, V, hK, hV, hY⟩
  · rintro ⟨K, V, hK, hV, hY⟩
    

Proof state:
case mpr.intro.intro.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K✝ : Set α
V✝ : Set (β × β)
f : C(α, β)
Y : Set C(α, β)
K : Set α
V : Set (β × β)
hK : IsCompact K
hV : V ∈ 𝓤 β
hY : compactConvNhd K V f ⊆ Y
⊢ Y ∈ FilterBasis.filter (compactConvergenceFilterBasis f)

Next tactic:
exact ⟨compactConvNhd K V f, ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩, hY⟩
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
⊢ 𝓝 f = FilterBasis.filter (compactConvergenceFilterBasis f)

Next tactic:
rw [TopologicalSpace.nhds_mkOfNhds_filterBasis]
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds_filterBasis] <;> 

Proof state:
case h₀
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
⊢ ∀ (x : C(α, β)), ∀ n ∈ compactConvergenceFilterBasis x, x ∈ n

Next tactic:
rintro g - ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds_filterBasis] <;> 

Proof state:
case h₁
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
⊢ ∀ (x : C(α, β)),
    ∀ n ∈ compactConvergenceFilterBasis x,
      ∃ n₁ ∈ compactConvergenceFilterBasis x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ compactConvergenceFilterBasis x', n₂ ⊆ n

Next tactic:
rintro g - ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds_filterBasis] <;> rintro g - ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩
  · 

Proof state:
case h₀.intro.mk.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K✝ : Set α
V✝ : Set (β × β)
f g : C(α, β)
K : Set α
V : Set (β × β)
hK : IsCompact (K, V).1
hV : (K, V).2 ∈ 𝓤 β
⊢ g ∈ (fun KV => compactConvNhd KV.1 KV.2 g) (K, V)

Next tactic:
exact self_mem_compactConvNhd g hV
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds_filterBasis] <;> rintro g - ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩
  · exact self_mem_compactConvNhd g hV
  · 

Proof state:
case h₁.intro.mk.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K✝ : Set α
V✝ : Set (β × β)
f g : C(α, β)
K : Set α
V : Set (β × β)
hK : IsCompact (K, V).1
hV : (K, V).2 ∈ 𝓤 β
⊢ ∃ n₁ ∈ compactConvergenceFilterBasis g,
    n₁ ⊆ (fun KV => compactConvNhd KV.1 KV.2 g) (K, V) ∧
      ∀ x' ∈ n₁, ∃ n₂ ∈ compactConvergenceFilterBasis x', n₂ ⊆ (fun KV => compactConvNhd KV.1 KV.2 g) (K, V)

Next tactic:
obtain ⟨V', hV', h₁, h₂⟩ := compactConvNhd_nhd_basis g hV
theorem nhds_compactConvergence :
    @nhds _ compactConvergenceTopology f = (compactConvergenceFilterBasis f).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds_filterBasis] <;> rintro g - ⟨⟨K, V⟩, ⟨hK, hV⟩, rfl⟩
  · exact self_mem_compactConvNhd g hV
  · obtain ⟨V', hV', h₁, h₂⟩ := compactConvNhd_nhd_basis g hV
    

Proof state:
case h₁.intro.mk.intro.intro.intro.intro.intro
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K✝ : Set α
V✝ : Set (β × β)
f g : C(α, β)
K : Set α
V : Set (β × β)
hK : IsCompact (K, V).1
hV : (K, V).2 ∈ 𝓤 β
V' : Set (β × β)
hV' : V' ∈ 𝓤 β
h₁ : V' ⊆ (K, V).2
h₂ : ∀ g_1 ∈ compactConvNhd ?m.4657 V' g, compactConvNhd ?m.4657 V' g_1 ⊆ compactConvNhd ?m.4657 (K, V).2 g
⊢ ∃ n₁ ∈ compactConvergenceFilterBasis g,
    n₁ ⊆ (fun KV => compactConvNhd KV.1 KV.2 g) (K, V) ∧
      ∀ x' ∈ n₁, ∃ n₂ ∈ compactConvergenceFilterBasis x', n₂ ⊆ (fun KV => compactConvNhd KV.1 KV.2 g) (K, V)

Next tactic:
exact
      ⟨compactConvNhd K V' g, ⟨⟨K, V'⟩, ⟨hK, hV'⟩, rfl⟩, compactConvNhd_mono g h₁, fun g' hg' =>
        ⟨compactConvNhd K V' g', ⟨⟨K, V'⟩, ⟨hK, hV'⟩, rfl⟩, h₂ g' hg'⟩⟩
/-- This is an auxiliary lemma and is unlikely to be of direct use outside of this file. See
`ContinuousMap.tendsto_iff_forall_compact_tendstoUniformlyOn` below for the useful version where the
topology is picked up via typeclass inference. -/
theorem tendsto_iff_forall_compact_tendstoUniformlyOn' {ι : Type u₃} {p : Filter ι}
    {F : ι → C(α, β)} :
    Filter.Tendsto F p (@nhds _ compactConvergenceTopology f) ↔
      ∀ K, IsCompact K → TendstoUniformlyOn (fun i a => F i a) f p K := by
  

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
ι : Type u₃
p : Filter ι
F : ι → C(α, β)
⊢ Tendsto F p (𝓝 f) ↔ ∀ (K : Set α), IsCompact K → TendstoUniformlyOn (fun i a => (F i) a) (⇑f) p K

Next tactic:
simp only [(hasBasis_nhds_compactConvergence f).tendsto_right_iff, TendstoUniformlyOn, and_imp,
    Prod.forall]
/-- This is an auxiliary lemma and is unlikely to be of direct use outside of this file. See
`ContinuousMap.tendsto_iff_forall_compact_tendstoUniformlyOn` below for the useful version where the
topology is picked up via typeclass inference. -/
theorem tendsto_iff_forall_compact_tendstoUniformlyOn' {ι : Type u₃} {p : Filter ι}
    {F : ι → C(α, β)} :
    Filter.Tendsto F p (@nhds _ compactConvergenceTopology f) ↔
      ∀ K, IsCompact K → TendstoUniformlyOn (fun i a => F i a) f p K := by
  simp only [(hasBasis_nhds_compactConvergence f).tendsto_right_iff, TendstoUniformlyOn, and_imp,
    Prod.forall]
  

Proof state:
α : Type u₁
β : Type u₂
inst✝¹ : TopologicalSpace α
inst✝ : UniformSpace β
K : Set α
V : Set (β × β)
f : C(α, β)
ι : Type u₃
p : Filter ι
F : ι → C(α, β)
⊢ (∀ (a : Set α) (b : Set (β × β)), IsCompact a → b ∈ 𝓤 β → ∀ᶠ (x : ι) in p, F x ∈ compactConvNhd a b f) ↔
    ∀ (K : Set α), IsCompact K → ∀ u ∈ 𝓤 β, ∀ᶠ (n : ι) in p, ∀ x ∈ K, (f x, (F n) x) ∈ u

Next tactic:
refine' forall_congr' fun K => _