l3lab/ntp-mathlib huggingface dataset:
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> 

Proof state:
case inl.refine'_2
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
val✝ : α
xs : inl val✝ ∈ s
⊢ (fun p => (inr p.1, inr p.2)) '' univ ⊆ {p | p.1 = inl val✝ → p.2 ∈ s}

Next tactic:
rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
    

Proof state:
case inl.refine'_1.intro.mk.intro.refl.refl
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
fst✝ b : α
xs : inl (fst✝, b).1 ∈ s
h : (fst✝, b) ∈ {p | p.1 = (fst✝, b).1 → p.2 ∈ inl ⁻¹' s}
⊢ ((fun p => (inl p.1, inl p.2)) (fst✝, b)).2 ∈ s

Next tactic:
exact h rfl
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
    exact h rfl
  · 

Proof state:
case inr
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
val✝ : β
xs : inr val✝ ∈ s
⊢ {p | p.1 = inr val✝ → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity

Next tactic:
refine' mem_of_superset
      (union_mem_uniformity_sum univ_mem (mem_nhds_uniformity_iff_right.1 (hs.2.mem_nhds xs)))
        (union_subset _ _)
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
    exact h rfl
  · refine' mem_of_superset
      (union_mem_uniformity_sum univ_mem (mem_nhds_uniformity_iff_right.1 (hs.2.mem_nhds xs)))
        (union_subset _ _) <;> 

Proof state:
case inr.refine'_1
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
val✝ : β
xs : inr val✝ ∈ s
⊢ (fun p => (inl p.1, inl p.2)) '' univ ⊆ {p | p.1 = inr val✝ → p.2 ∈ s}

Next tactic:
rintro _ ⟨⟨a, _⟩, h, ⟨⟩⟩ ⟨⟩
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
    exact h rfl
  · refine' mem_of_superset
      (union_mem_uniformity_sum univ_mem (mem_nhds_uniformity_iff_right.1 (hs.2.mem_nhds xs)))
        (union_subset _ _) <;> 

Proof state:
case inr.refine'_2
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
val✝ : β
xs : inr val✝ ∈ s
⊢ (fun p => (inr p.1, inr p.2)) '' {p | p.1 = val✝ → p.2 ∈ inr ⁻¹' s} ⊆ {p | p.1 = inr val✝ → p.2 ∈ s}

Next tactic:
rintro _ ⟨⟨a, _⟩, h, ⟨⟩⟩ ⟨⟩
theorem uniformity_sum_of_isOpen_aux {s : Set (Sum α β)} (hs : IsOpen s) {x : Sum α β}
    (xs : x ∈ s) : { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈
    (@UniformSpace.Core.sum α β _ _).uniformity := by
  cases x
  · refine' mem_of_superset
      (union_mem_uniformity_sum (mem_nhds_uniformity_iff_right.1 (hs.1.mem_nhds xs)) univ_mem)
        (union_subset _ _) <;> rintro _ ⟨⟨_, b⟩, h, ⟨⟩⟩ ⟨⟩
    exact h rfl
  · refine' mem_of_superset
      (union_mem_uniformity_sum univ_mem (mem_nhds_uniformity_iff_right.1 (hs.2.mem_nhds xs)))
        (union_subset _ _) <;> rintro _ ⟨⟨a, _⟩, h, ⟨⟩⟩ ⟨⟩
    

Proof state:
case inr.refine'_2.intro.mk.intro.refl.refl
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : IsOpen s
a snd✝ : β
xs : inr (a, snd✝).1 ∈ s
h : (a, snd✝) ∈ {p | p.1 = (a, snd✝).1 → p.2 ∈ inr ⁻¹' s}
⊢ ((fun p => (inr p.1, inr p.2)) (a, snd✝)).2 ∈ s

Next tactic:
exact h rfl
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  

Proof state:
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
⊢ IsOpen s

Next tactic:
constructor
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · 

Proof state:
case left
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
⊢ s ∈
    (⇑OrderDual.toDual ∘ (fun t => OrderDual.toDual {s | IsOpen s}) ∘ ⇑OrderDual.ofDual)
      (TopologicalSpace.coinduced inl UniformSpace.toTopologicalSpace)

Next tactic:
refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    

Proof state:
case left
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
a : α
ha : a ∈ inl ⁻¹' s
⊢ {p | p.1 = a → p.2 ∈ inl ⁻¹' s} ∈ 𝓤 α

Next tactic:
rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    

Proof state:
case left.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
a : α
ha : a ∈ inl ⁻¹' s
t : Set (α × α)
ht : t ∈ 𝓤 α
st : (fun p => (inl p.1, inl p.2)) '' t ⊆ {p | p.1 = inl a → p.2 ∈ s}
⊢ {p | p.1 = a → p.2 ∈ inl ⁻¹' s} ∈ 𝓤 α

Next tactic:
refine' mem_of_superset ht _
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    

Proof state:
case left.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
a : α
ha : a ∈ inl ⁻¹' s
t : Set (α × α)
ht : t ∈ 𝓤 α
st : (fun p => (inl p.1, inl p.2)) '' t ⊆ {p | p.1 = inl a → p.2 ∈ s}
⊢ t ⊆ {p | p.1 = a → p.2 ∈ inl ⁻¹' s}

Next tactic:
rintro p pt rfl
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    

Proof state:
case left.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
t : Set (α × α)
ht : t ∈ 𝓤 α
p : α × α
pt : p ∈ t
ha : p.1 ∈ inl ⁻¹' s
st : (fun p => (inl p.1, inl p.2)) '' t ⊆ {p_1 | p_1.1 = inl p.1 → p_1.2 ∈ s}
⊢ p.2 ∈ inl ⁻¹' s

Next tactic:
exact st ⟨_, pt, rfl⟩ rfl
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    exact st ⟨_, pt, rfl⟩ rfl
  · 

Proof state:
case right
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
⊢ s ∈
    (⇑OrderDual.toDual ∘ (fun t => OrderDual.toDual {s | IsOpen s}) ∘ ⇑OrderDual.ofDual)
      (TopologicalSpace.coinduced inr UniformSpace.toTopologicalSpace)

Next tactic:
refine' (@isOpen_iff_mem_nhds β _ _).2 fun b hb => mem_nhds_uniformity_iff_right.2 _
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    exact st ⟨_, pt, rfl⟩ rfl
  · refine' (@isOpen_iff_mem_nhds β _ _).2 fun b hb => mem_nhds_uniformity_iff_right.2 _
    

Proof state:
case right
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
b : β
hb : b ∈ inr ⁻¹' s
⊢ {p | p.1 = b → p.2 ∈ inr ⁻¹' s} ∈ 𝓤 β

Next tactic:
rcases mem_map_iff_exists_image.1 (hs _ hb).2 with ⟨t, ht, st⟩
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    exact st ⟨_, pt, rfl⟩ rfl
  · refine' (@isOpen_iff_mem_nhds β _ _).2 fun b hb => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ hb).2 with ⟨t, ht, st⟩
    

Proof state:
case right.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
b : β
hb : b ∈ inr ⁻¹' s
t : Set (β × β)
ht : t ∈ 𝓤 β
st : (fun p => (inr p.1, inr p.2)) '' t ⊆ {p | p.1 = inr b → p.2 ∈ s}
⊢ {p | p.1 = b → p.2 ∈ inr ⁻¹' s} ∈ 𝓤 β

Next tactic:
refine' mem_of_superset ht _
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    exact st ⟨_, pt, rfl⟩ rfl
  · refine' (@isOpen_iff_mem_nhds β _ _).2 fun b hb => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ hb).2 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    

Proof state:
case right.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
b : β
hb : b ∈ inr ⁻¹' s
t : Set (β × β)
ht : t ∈ 𝓤 β
st : (fun p => (inr p.1, inr p.2)) '' t ⊆ {p | p.1 = inr b → p.2 ∈ s}
⊢ t ⊆ {p | p.1 = b → p.2 ∈ inr ⁻¹' s}

Next tactic:
rintro p pt rfl
theorem isOpen_of_uniformity_sum_aux {s : Set (Sum α β)}
    (hs : ∀ x ∈ s,
      { p : (α ⊕ β) × (α ⊕ β) | p.1 = x → p.2 ∈ s } ∈ (@UniformSpace.Core.sum α β _ _).uniformity) :
    IsOpen s := by
  constructor
  · refine' (@isOpen_iff_mem_nhds α _ _).2 fun a ha => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ ha).1 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    exact st ⟨_, pt, rfl⟩ rfl
  · refine' (@isOpen_iff_mem_nhds β _ _).2 fun b hb => mem_nhds_uniformity_iff_right.2 _
    rcases mem_map_iff_exists_image.1 (hs _ hb).2 with ⟨t, ht, st⟩
    refine' mem_of_superset ht _
    rintro p pt rfl
    

Proof state:
case right.intro.intro
α : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι : Sort u_1
inst✝¹ : UniformSpace α
inst✝ : UniformSpace β
s : Set (α ⊕ β)
hs : ∀ x ∈ s, {p | p.1 = x → p.2 ∈ s} ∈ UniformSpace.Core.sum.uniformity
t : Set (β × β)
ht : t ∈ 𝓤 β
p : β × β
pt : p ∈ t
hb : p.1 ∈ inr ⁻¹' s
st : (fun p => (inr p.1, inr p.2)) '' t ⊆ {p_1 | p_1.1 = inr p.1 → p_1.2 ∈ s}
⊢ p.2 ∈ inr ⁻¹' s

Next tactic:
exact st ⟨_, pt, rfl⟩ rfl
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  

Proof state:
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
⊢ ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, {y | (x, y) ∈ n} ⊆ c i

Next tactic:
let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  

Proof state:
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
⊢ ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, {y | (x, y) ∈ n} ⊆ c i

Next tactic:
have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    rintro x ⟨i, m, hm, h⟩
    rcases comp_mem_uniformity_sets hm with ⟨m', hm', mm'⟩
    apply (𝓤 α).sets_of_superset hm'
    rintro ⟨x, y⟩ hp rfl
    refine' ⟨i, m', hm', fun z hz => h (monotone_id.compRel monotone_const mm' _)⟩
    dsimp [-mem_compRel] at hz ⊢
    rw [compRel_assoc]
    exact ⟨y, hp, hz⟩
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    

Proof state:
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
⊢ ∀ n ∈ 𝓤 α, IsOpen (u n)

Next tactic:
refine' fun n _ => isOpen_uniformity.2 _
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    

Proof state:
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
n : Set (α × α)
x✝ : n ∈ 𝓤 α
⊢ ∀ x ∈ u n, {p | p.1 = x → p.2 ∈ u n} ∈ 𝓤 α

Next tactic:
rintro x ⟨i, m, hm, h⟩
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    rintro x ⟨i, m, hm, h⟩
    

Proof state:
case intro.intro.intro
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
n : Set (α × α)
x✝ : n ∈ 𝓤 α
x : α
i : ι
m : Set (α × α)
hm : m ∈ 𝓤 α
h : {y | (x, y) ∈ m ○ n} ⊆ c i
⊢ {p | p.1 = x → p.2 ∈ u n} ∈ 𝓤 α

Next tactic:
rcases comp_mem_uniformity_sets hm with ⟨m', hm', mm'⟩
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    rintro x ⟨i, m, hm, h⟩
    rcases comp_mem_uniformity_sets hm with ⟨m', hm', mm'⟩
    

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
n : Set (α × α)
x✝ : n ∈ 𝓤 α
x : α
i : ι
m : Set (α × α)
hm : m ∈ 𝓤 α
h : {y | (x, y) ∈ m ○ n} ⊆ c i
m' : Set (α × α)
hm' : m' ∈ 𝓤 α
mm' : m' ○ m' ⊆ m
⊢ {p | p.1 = x → p.2 ∈ u n} ∈ 𝓤 α

Next tactic:
apply (𝓤 α).sets_of_superset hm'
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    rintro x ⟨i, m, hm, h⟩
    rcases comp_mem_uniformity_sets hm with ⟨m', hm', mm'⟩
    apply (𝓤 α).sets_of_superset hm'
    

Proof state:
case intro.intro.intro.intro.intro
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
n : Set (α × α)
x✝ : n ∈ 𝓤 α
x : α
i : ι
m : Set (α × α)
hm : m ∈ 𝓤 α
h : {y | (x, y) ∈ m ○ n} ⊆ c i
m' : Set (α × α)
hm' : m' ∈ 𝓤 α
mm' : m' ○ m' ⊆ m
⊢ m' ⊆ {p | p.1 = x → p.2 ∈ u n}

Next tactic:
rintro ⟨x, y⟩ hp rfl
/-- Let `c : ι → Set α` be an open cover of a compact set `s`. Then there exists an entourage
`n` such that for each `x ∈ s` its `n`-neighborhood is contained in some `c i`. -/
theorem lebesgue_number_lemma {α : Type u} [UniformSpace α] {s : Set α} {ι} {c : ι → Set α}
    (hs : IsCompact s) (hc₁ : ∀ i, IsOpen (c i)) (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ n ∈ 𝓤 α, ∀ x ∈ s, ∃ i, { y | (x, y) ∈ n } ⊆ c i := by
  let u n := { x | ∃ i, ∃ m ∈ 𝓤 α, { y | (x, y) ∈ m ○ n } ⊆ c i }
  have hu₁ : ∀ n ∈ 𝓤 α, IsOpen (u n) := by
    refine' fun n _ => isOpen_uniformity.2 _
    rintro x ⟨i, m, hm, h⟩
    rcases comp_mem_uniformity_sets hm with ⟨m', hm', mm'⟩
    apply (𝓤 α).sets_of_superset hm'
    rintro ⟨x, y⟩ hp rfl
    

Proof state:
case intro.intro.intro.intro.intro.mk
α✝ : Type ua
β : Type ub
γ : Type uc
δ : Type ud
ι✝ : Sort u_1
α : Type u
inst✝ : UniformSpace α
s : Set α
ι : Sort u_2
c : ι → Set α
hs : IsCompact s
hc₁ : ∀ (i : ι), IsOpen (c i)
hc₂ : s ⊆ ⋃ i, c i
u : Set (α × α) → Set α := fun n => {x | ∃ i, ∃ m ∈ 𝓤 α, {y | (x, y) ∈ m ○ n} ⊆ c i}
n : Set (α × α)
x✝ : n ∈ 𝓤 α
i : ι
m : Set (α × α)
hm : m ∈ 𝓤 α
m' : Set (α × α)
hm' : m' ∈ 𝓤 α
mm' : m' ○ m' ⊆ m
x y : α
hp : (x, y) ∈ m'
h : {y_1 | ((x, y).1, y_1) ∈ m ○ n} ⊆ c i
⊢ (x, y).2 ∈ u n

Next tactic:
refine' ⟨i, m', hm', fun z hz => h (monotone_id.compRel monotone_const mm' _)⟩