l3lab/ntp-mathlib huggingface dataset:
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
⊢ ∃ t_1, Set.Finite t_1 ∧ f ⁻¹' s ⊆ ⋃ y ∈ t_1, {x | (x, y) ∈ t}

Next tactic:
refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
x : α
h : x ∈ f ⁻¹' s
⊢ x ∈ ⋃ y ∈ f ⁻¹' c, {x | (x, y) ∈ t}

Next tactic:
have := hct (mem_image_of_mem f h)
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
  have := hct (mem_image_of_mem f h); 

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
x : α
h : x ∈ f ⁻¹' s
this : f x ∈ ⋃ y ∈ c, {x | (x, y) ∈ t'}
⊢ x ∈ ⋃ y ∈ f ⁻¹' c, {x | (x, y) ∈ t}

Next tactic:
simp at this ⊢
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
  have := hct (mem_image_of_mem f h); simp at this ⊢
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
x : α
h : x ∈ f ⁻¹' s
this : ∃ i ∈ c, (f x, i) ∈ t'
⊢ ∃ i, f i ∈ c ∧ (x, i) ∈ t

Next tactic:
rcases this with ⟨z, zc, zt⟩
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
  have := hct (mem_image_of_mem f h); simp at this ⊢
  rcases this with ⟨z, zc, zt⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
x : α
h : x ∈ f ⁻¹' s
z : β
zc : z ∈ c
zt : (f x, z) ∈ t'
⊢ ∃ i, f i ∈ c ∧ (x, i) ∈ t

Next tactic:
rcases cs zc with ⟨y, -, rfl⟩
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  rw [← hf.comap_uniformity] at ht
  rcases mem_comap.2 ht with ⟨t', ht', ts⟩
  rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩
  refine' ⟨f ⁻¹' c, hfc.preimage (hf.inj.injOn _), fun x h => _⟩
  have := hct (mem_image_of_mem f h); simp at this ⊢
  rcases this with ⟨z, zc, zt⟩
  rcases cs zc with ⟨y, -, rfl⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
s : Set β
hf : UniformEmbedding f
hs : TotallyBounded s
t : Set (α × α)
ht : t ∈ comap (fun x => (f x.1, f x.2)) (𝓤 β)
t' : Set (β × β)
ht' : t' ∈ 𝓤 β
ts : (fun x => (f x.1, f x.2)) ⁻¹' t' ⊆ t
c : Set β
cs : c ⊆ f '' (f ⁻¹' s)
hfc : Set.Finite c
hct : f '' (f ⁻¹' s) ⊆ ⋃ y ∈ c, {x | (x, y) ∈ t'}
x : α
h : x ∈ f ⁻¹' s
y : α
zc : f y ∈ c
zt : (f x, f y) ∈ t'
⊢ ∃ i, f i ∈ c ∧ (x, i) ∈ t

Next tactic:
exact ⟨y, zc, ts zt⟩
instance CompleteSpace.sum [CompleteSpace α] [CompleteSpace β] : CompleteSpace (Sum α β) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁴ : UniformSpace α
inst✝³ : UniformSpace β
inst✝² : UniformSpace γ
inst✝¹ : CompleteSpace α
inst✝ : CompleteSpace β
⊢ CompleteSpace (α ⊕ β)

Next tactic:
rw [completeSpace_iff_isComplete_univ, ← range_inl_union_range_inr]
instance CompleteSpace.sum [CompleteSpace α] [CompleteSpace β] : CompleteSpace (Sum α β) := by
  rw [completeSpace_iff_isComplete_univ, ← range_inl_union_range_inr]
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝⁴ : UniformSpace α
inst✝³ : UniformSpace β
inst✝² : UniformSpace γ
inst✝¹ : CompleteSpace α
inst✝ : CompleteSpace β
⊢ IsComplete (range Sum.inl ∪ range Sum.inr)

Next tactic:
exact uniformEmbedding_inl.toUniformInducing.isComplete_range.union
    uniformEmbedding_inr.toUniformInducing.isComplete_range
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
have de : DenseEmbedding e := he.denseEmbedding hd
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (fun x => f ↑x) (comap (DenseEmbedding.subtypeEmb p e) (𝓝 { val := b, property := this })) (𝓝 c)
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (fun x => f ↑x) (comap (DenseEmbedding.subtypeEmb p e) (𝓝 { val := b, property := this })) (𝓝 c)
⊢ Tendsto (f ∘ Subtype.val) (comap Subtype.val (comap e (𝓝 b))) (𝓝 c)

Next tactic:
simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (f ∘ Subtype.val) (comap Subtype.val (comap e (𝓝 b))) (𝓝 c)
⊢ ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c)

Next tactic:
refine ⟨c, (tendsto_comap'_iff ?_).1 hc⟩
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
  refine ⟨c, (tendsto_comap'_iff ?_).1 hc⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (f ∘ Subtype.val) (comap Subtype.val (comap e (𝓝 b))) (𝓝 c)
⊢ range Subtype.val ∈ comap e (𝓝 b)

Next tactic:
rw [Subtype.range_coe_subtype]
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
  refine ⟨c, (tendsto_comap'_iff ?_).1 hc⟩
  rw [Subtype.range_coe_subtype]
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (f ∘ Subtype.val) (comap Subtype.val (comap e (𝓝 b))) (𝓝 c)
⊢ {x | p x} ∈ comap e (𝓝 b)

Next tactic:
exact ⟨_, hb, by rwa [← de.toInducing.closure_eq_preimage_closure_image, hs.closure_eq]⟩
theorem uniform_extend_subtype [CompleteSpace γ] {p : α → Prop} {e : α → β} {f : α → γ} {b : β}
    {s : Set α} (hf : UniformContinuous fun x : Subtype p => f x.val) (he : UniformEmbedding e)
    (hd : ∀ x : β, x ∈ closure (range e)) (hb : closure (e '' s) ∈ 𝓝 b) (hs : IsClosed s)
    (hp : ∀ x ∈ s, p x) : ∃ c, Tendsto f (comap e (𝓝 b)) (𝓝 c) := by
  have de : DenseEmbedding e := he.denseEmbedding hd
  have de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e) := de.subtype p
  have ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e) := uniformEmbedding_subtypeEmb _ he de
  have : b ∈ closure (e '' { x | p x }) :=
    (closure_mono <| monotone_image <| hp) (mem_of_mem_nhds hb)
  let ⟨c, hc⟩ := uniformly_extend_exists ue'.toUniformInducing de'.dense hf ⟨b, this⟩
  replace hc : Tendsto (f ∘ Subtype.val) (((𝓝 b).comap e).comap Subtype.val) (𝓝 c) := by
    simpa only [nhds_subtype_eq_comap, comap_comap, DenseEmbedding.subtypeEmb_coe] using hc
  refine ⟨c, (tendsto_comap'_iff ?_).1 hc⟩
  rw [Subtype.range_coe_subtype]
  exact ⟨_, hb, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e✝ : β → α
h_e : UniformInducing e✝
h_dense : DenseRange e✝
f✝ : β → γ
h_f : UniformContinuous f✝
inst✝ : CompleteSpace γ
p : α → Prop
e : α → β
f : α → γ
b : β
s : Set α
hf : UniformContinuous fun x => f ↑x
he : UniformEmbedding e
hd : ∀ (x : β), x ∈ closure (range e)
hb : closure (e '' s) ∈ 𝓝 b
hs : IsClosed s
hp : ∀ x ∈ s, p x
de : DenseEmbedding e
de' : DenseEmbedding (DenseEmbedding.subtypeEmb p e)
ue' : UniformEmbedding (DenseEmbedding.subtypeEmb p e)
this : b ∈ closure (e '' {x | p x})
c : γ
hc : Tendsto (f ∘ Subtype.val) (comap Subtype.val (comap e (𝓝 b))) (𝓝 c)
⊢ e ⁻¹' closure (e '' s) ⊆ {x | p x}

Next tactic:
rwa [← de.toInducing.closure_eq_preimage_closure_image, hs.closure_eq]
theorem uniformly_extend_spec [CompleteSpace γ] (a : α) : Tendsto f (comap e (𝓝 a)) (𝓝 (ψ a)) := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
inst✝³ : UniformSpace α
inst✝² : UniformSpace β
inst✝¹ : UniformSpace γ
e : β → α
h_e : UniformInducing e
h_dense : DenseRange e
f : β → γ
h_f : UniformContinuous f
inst✝ : CompleteSpace γ
a : α
⊢ Tendsto f (comap e (𝓝 a)) (𝓝 (DenseInducing.extend (_ : DenseInducing e) f a))

Next tactic:
simpa only [DenseInducing.extend] using
    tendsto_nhds_limUnder (uniformly_extend_exists h_e ‹_› h_f _)