l3lab/ntp-mathlib huggingface dataset:
theorem closure_image_mem_nhds_of_uniformInducing {s : Set (α × α)} {e : α → β} (b : β)
    (he₁ : UniformInducing e) (he₂ : DenseInducing e) (hs : s ∈ 𝓤 α) :
    ∃ a, closure (e '' { a' | (a, a') ∈ s }) ∈ 𝓝 b := by
  obtain ⟨U, ⟨hU, hUo, hsymm⟩, hs⟩ :
    ∃ U, (U ∈ 𝓤 β ∧ IsOpen U ∧ SymmetricRel U) ∧ Prod.map e e ⁻¹' U ⊆ s := by
      rwa [← he₁.comap_uniformity, (uniformity_hasBasis_open_symmetric.comap _).mem_iff] at hs
  rcases he₂.dense.mem_nhds (UniformSpace.ball_mem_nhds b hU) with ⟨a, ha⟩
  refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| ball_mono hs a)⟩
  have ho : IsOpen (UniformSpace.ball (e a) U) := UniformSpace.isOpen_ball (e a) hUo
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set (α × α)
e : α → β
b : β
he₁ : UniformInducing e
he₂ : DenseInducing e
hs✝ : s ∈ 𝓤 α
U : Set (β × β)
hs : Prod.map e e ⁻¹' U ⊆ s
hU : U ∈ 𝓤 β
hUo : IsOpen U
hsymm : SymmetricRel U
a : α
ha : e a ∈ UniformSpace.ball b U
ho : IsOpen (UniformSpace.ball (e a) U)
⊢ closure (e '' UniformSpace.ball a (Prod.map e e ⁻¹' U)) ∈ 𝓝 b

Next tactic:
refine mem_of_superset (ho.mem_nhds <| (mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
theorem closure_image_mem_nhds_of_uniformInducing {s : Set (α × α)} {e : α → β} (b : β)
    (he₁ : UniformInducing e) (he₂ : DenseInducing e) (hs : s ∈ 𝓤 α) :
    ∃ a, closure (e '' { a' | (a, a') ∈ s }) ∈ 𝓝 b := by
  obtain ⟨U, ⟨hU, hUo, hsymm⟩, hs⟩ :
    ∃ U, (U ∈ 𝓤 β ∧ IsOpen U ∧ SymmetricRel U) ∧ Prod.map e e ⁻¹' U ⊆ s := by
      rwa [← he₁.comap_uniformity, (uniformity_hasBasis_open_symmetric.comap _).mem_iff] at hs
  rcases he₂.dense.mem_nhds (UniformSpace.ball_mem_nhds b hU) with ⟨a, ha⟩
  refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| ball_mono hs a)⟩
  have ho : IsOpen (UniformSpace.ball (e a) U) := UniformSpace.isOpen_ball (e a) hUo
  refine mem_of_superset (ho.mem_nhds <| (mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set (α × α)
e : α → β
b : β
he₁ : UniformInducing e
he₂ : DenseInducing e
hs✝ : s ∈ 𝓤 α
U : Set (β × β)
hs : Prod.map e e ⁻¹' U ⊆ s
hU : U ∈ 𝓤 β
hUo : IsOpen U
hsymm : SymmetricRel U
a : α
ha : e a ∈ UniformSpace.ball b U
ho : IsOpen (UniformSpace.ball (e a) U)
y : β
hy : y ∈ UniformSpace.ball (e a) U
⊢ y ∈ closure (e '' UniformSpace.ball a (Prod.map e e ⁻¹' U))

Next tactic:
refine mem_closure_iff_nhds.2 fun V hV => ?_
theorem closure_image_mem_nhds_of_uniformInducing {s : Set (α × α)} {e : α → β} (b : β)
    (he₁ : UniformInducing e) (he₂ : DenseInducing e) (hs : s ∈ 𝓤 α) :
    ∃ a, closure (e '' { a' | (a, a') ∈ s }) ∈ 𝓝 b := by
  obtain ⟨U, ⟨hU, hUo, hsymm⟩, hs⟩ :
    ∃ U, (U ∈ 𝓤 β ∧ IsOpen U ∧ SymmetricRel U) ∧ Prod.map e e ⁻¹' U ⊆ s := by
      rwa [← he₁.comap_uniformity, (uniformity_hasBasis_open_symmetric.comap _).mem_iff] at hs
  rcases he₂.dense.mem_nhds (UniformSpace.ball_mem_nhds b hU) with ⟨a, ha⟩
  refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| ball_mono hs a)⟩
  have ho : IsOpen (UniformSpace.ball (e a) U) := UniformSpace.isOpen_ball (e a) hUo
  refine mem_of_superset (ho.mem_nhds <| (mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
  refine mem_closure_iff_nhds.2 fun V hV => ?_
  

Proof state:
case intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set (α × α)
e : α → β
b : β
he₁ : UniformInducing e
he₂ : DenseInducing e
hs✝ : s ∈ 𝓤 α
U : Set (β × β)
hs : Prod.map e e ⁻¹' U ⊆ s
hU : U ∈ 𝓤 β
hUo : IsOpen U
hsymm : SymmetricRel U
a : α
ha : e a ∈ UniformSpace.ball b U
ho : IsOpen (UniformSpace.ball (e a) U)
y : β
hy : y ∈ UniformSpace.ball (e a) U
V : Set β
hV : V ∈ 𝓝 y
⊢ Set.Nonempty (V ∩ e '' UniformSpace.ball a (Prod.map e e ⁻¹' U))

Next tactic:
rcases he₂.dense.mem_nhds (inter_mem hV (ho.mem_nhds hy)) with ⟨x, hxV, hxU⟩
theorem closure_image_mem_nhds_of_uniformInducing {s : Set (α × α)} {e : α → β} (b : β)
    (he₁ : UniformInducing e) (he₂ : DenseInducing e) (hs : s ∈ 𝓤 α) :
    ∃ a, closure (e '' { a' | (a, a') ∈ s }) ∈ 𝓝 b := by
  obtain ⟨U, ⟨hU, hUo, hsymm⟩, hs⟩ :
    ∃ U, (U ∈ 𝓤 β ∧ IsOpen U ∧ SymmetricRel U) ∧ Prod.map e e ⁻¹' U ⊆ s := by
      rwa [← he₁.comap_uniformity, (uniformity_hasBasis_open_symmetric.comap _).mem_iff] at hs
  rcases he₂.dense.mem_nhds (UniformSpace.ball_mem_nhds b hU) with ⟨a, ha⟩
  refine ⟨a, mem_of_superset ?_ (closure_mono <| image_subset _ <| ball_mono hs a)⟩
  have ho : IsOpen (UniformSpace.ball (e a) U) := UniformSpace.isOpen_ball (e a) hUo
  refine mem_of_superset (ho.mem_nhds <| (mem_ball_symmetry hsymm).2 ha) fun y hy => ?_
  refine mem_closure_iff_nhds.2 fun V hV => ?_
  rcases he₂.dense.mem_nhds (inter_mem hV (ho.mem_nhds hy)) with ⟨x, hxV, hxU⟩
  

Proof state:
case intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set (α × α)
e : α → β
b : β
he₁ : UniformInducing e
he₂ : DenseInducing e
hs✝ : s ∈ 𝓤 α
U : Set (β × β)
hs : Prod.map e e ⁻¹' U ⊆ s
hU : U ∈ 𝓤 β
hUo : IsOpen U
hsymm : SymmetricRel U
a : α
ha : e a ∈ UniformSpace.ball b U
ho : IsOpen (UniformSpace.ball (e a) U)
y : β
hy : y ∈ UniformSpace.ball (e a) U
V : Set β
hV : V ∈ 𝓝 y
x : α
hxV : e x ∈ V
hxU : e x ∈ UniformSpace.ball (e a) U
⊢ Set.Nonempty (V ∩ e '' UniformSpace.ball a (Prod.map e e ⁻¹' U))

Next tactic:
exact ⟨e x, hxV, mem_image_of_mem e hxU⟩
theorem uniformEmbedding_subtypeEmb (p : α → Prop) {e : α → β} (ue : UniformEmbedding e)
    (de : DenseEmbedding e) : UniformEmbedding (DenseEmbedding.subtypeEmb p e) :=
  { comap_uniformity := by
      

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
p : α → Prop
e : α → β
ue : UniformEmbedding e
de : DenseEmbedding e
⊢ comap (fun x => (DenseEmbedding.subtypeEmb p e x.1, DenseEmbedding.subtypeEmb p e x.2))
      (𝓤 { x // x ∈ closure (e '' {x | p x}) }) =
    𝓤 { x // p x }

Next tactic:
simp [comap_comap, (· ∘ ·), DenseEmbedding.subtypeEmb, uniformity_subtype,
        ue.comap_uniformity.symm]
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
⊢ IsComplete s

Next tactic:
intro f hf hfs
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  intro f hf hfs
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : f ≤ 𝓟 s
⊢ ∃ x ∈ s, f ≤ 𝓝 x

Next tactic:
rw [le_principal_iff] at hfs
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  intro f hf hfs
  rw [le_principal_iff] at hfs
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : s ∈ f
⊢ ∃ x ∈ s, f ≤ 𝓝 x

Next tactic:
obtain ⟨_, ⟨x, hx, rfl⟩, hyf⟩ : ∃ y ∈ m '' s, map m f ≤ 𝓝 y
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  intro f hf hfs
  rw [le_principal_iff] at hfs
  obtain ⟨_, ⟨x, hx, rfl⟩, hyf⟩ : ∃ y ∈ m '' s, map m f ≤ 𝓝 y
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : s ∈ f
⊢ ∃ y ∈ m '' s, map m f ≤ 𝓝 y
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : s ∈ f
x : α
hx : x ∈ s
hyf : map m f ≤ 𝓝 (m x)
⊢ ∃ x ∈ s, f ≤ 𝓝 x

Next tactic:
exact hs (f.map m) (hf.map hm.uniformContinuous) (le_principal_iff.2 (image_mem_map hfs))
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  intro f hf hfs
  rw [le_principal_iff] at hfs
  obtain ⟨_, ⟨x, hx, rfl⟩, hyf⟩ : ∃ y ∈ m '' s, map m f ≤ 𝓝 y
  exact hs (f.map m) (hf.map hm.uniformContinuous) (le_principal_iff.2 (image_mem_map hfs))
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : s ∈ f
x : α
hx : x ∈ s
hyf : map m f ≤ 𝓝 (m x)
⊢ ∃ x ∈ s, f ≤ 𝓝 x

Next tactic:
rw [map_le_iff_le_comap, ← nhds_induced, ← hm.inducing.induced] at hyf
theorem isComplete_of_complete_image {m : α → β} {s : Set α} (hm : UniformInducing m)
    (hs : IsComplete (m '' s)) : IsComplete s := by
  intro f hf hfs
  rw [le_principal_iff] at hfs
  obtain ⟨_, ⟨x, hx, rfl⟩, hyf⟩ : ∃ y ∈ m '' s, map m f ≤ 𝓝 y
  exact hs (f.map m) (hf.map hm.uniformContinuous) (le_principal_iff.2 (image_mem_map hfs))
  rw [map_le_iff_le_comap, ← nhds_induced, ← hm.inducing.induced] at hyf
  

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
hs : IsComplete (m '' s)
f : Filter α
hf : Cauchy f
hfs : s ∈ f
x : α
hx : x ∈ s
hyf : f ≤ 𝓝 x
⊢ ∃ x ∈ s, f ≤ 𝓝 x

Next tactic:
exact ⟨x, hx, hyf⟩
theorem IsComplete.completeSpace_coe {s : Set α} (hs : IsComplete s) : CompleteSpace s :=
  completeSpace_iff_isComplete_univ.2 <|
    isComplete_of_complete_image uniformEmbedding_subtype_val.toUniformInducing <| by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set α
hs : IsComplete s
⊢ IsComplete (Subtype.val '' univ)

Next tactic:
simp [hs]
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
⊢ IsComplete (m '' s) ↔ IsComplete s

Next tactic:
refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
⊢ IsComplete (m '' s)

Next tactic:
haveI : CompleteSpace s := c.completeSpace_coe
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
⊢ IsComplete (m '' s)

Next tactic:
set m' : s → β := m ∘ (↑)
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
⊢ IsComplete (m '' s)

Next tactic:
suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this✝ : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
this : IsComplete (range m')
⊢ IsComplete (m '' s)

Next tactic:
rwa [range_comp, Subtype.range_coe] at this
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
⊢ IsComplete (range m')

Next tactic:
have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
⊢ IsComplete (range m')

Next tactic:
intro f hf hfm
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  intro f hf hfm
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
f : Filter β
hf : Cauchy f
hfm : f ≤ 𝓟 (range m')
⊢ ∃ x ∈ range m', f ≤ 𝓝 x

Next tactic:
rw [Filter.le_principal_iff] at hfm
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  intro f hf hfm
  rw [Filter.le_principal_iff] at hfm
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
f : Filter β
hf : Cauchy f
hfm : range m' ∈ f
⊢ ∃ x ∈ range m', f ≤ 𝓝 x

Next tactic:
have cf' : Cauchy (comap m' f) :=
    hf.comap' hm'.comap_uniformity.le (NeBot.comap_of_range_mem hf.1 hfm)
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  intro f hf hfm
  rw [Filter.le_principal_iff] at hfm
  have cf' : Cauchy (comap m' f) :=
    hf.comap' hm'.comap_uniformity.le (NeBot.comap_of_range_mem hf.1 hfm)
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
f : Filter β
hf : Cauchy f
hfm : range m' ∈ f
cf' : Cauchy (comap m' f)
⊢ ∃ x ∈ range m', f ≤ 𝓝 x

Next tactic:
rcases CompleteSpace.complete cf' with ⟨x, hx⟩
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  intro f hf hfm
  rw [Filter.le_principal_iff] at hfm
  have cf' : Cauchy (comap m' f) :=
    hf.comap' hm'.comap_uniformity.le (NeBot.comap_of_range_mem hf.1 hfm)
  rcases CompleteSpace.complete cf' with ⟨x, hx⟩
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
f : Filter β
hf : Cauchy f
hfm : range m' ∈ f
cf' : Cauchy (comap m' f)
x : ↑s
hx : comap m' f ≤ 𝓝 x
⊢ ∃ x ∈ range m', f ≤ 𝓝 x

Next tactic:
rw [hm'.inducing.nhds_eq_comap, comap_le_comap_iff hfm] at hx
/-- A set is complete iff its image under a uniform inducing map is complete. -/
theorem isComplete_image_iff {m : α → β} {s : Set α} (hm : UniformInducing m) :
    IsComplete (m '' s) ↔ IsComplete s := by
  refine' ⟨isComplete_of_complete_image hm, fun c => _⟩
  haveI : CompleteSpace s := c.completeSpace_coe
  set m' : s → β := m ∘ (↑)
  suffices IsComplete (range m') by rwa [range_comp, Subtype.range_coe] at this
  have hm' : UniformInducing m' := hm.comp uniformEmbedding_subtype_val.toUniformInducing
  intro f hf hfm
  rw [Filter.le_principal_iff] at hfm
  have cf' : Cauchy (comap m' f) :=
    hf.comap' hm'.comap_uniformity.le (NeBot.comap_of_range_mem hf.1 hfm)
  rcases CompleteSpace.complete cf' with ⟨x, hx⟩
  rw [hm'.inducing.nhds_eq_comap, comap_le_comap_iff hfm] at hx
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
m : α → β
s : Set α
hm : UniformInducing m
c : IsComplete s
this : CompleteSpace ↑s
m' : ↑s → β := m ∘ Subtype.val
hm' : UniformInducing m'
f : Filter β
hf : Cauchy f
hfm : range m' ∈ f
cf' : Cauchy (comap m' f)
x : ↑s
hx : f ≤ 𝓝 (m' x)
⊢ ∃ x ∈ range m', f ≤ 𝓝 x

Next tactic:
exact ⟨m' x, mem_range_self _, hx⟩
theorem completeSpace_iff_isComplete_range {f : α → β} (hf : UniformInducing f) :
    CompleteSpace α ↔ IsComplete (range f) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
f : α → β
hf : UniformInducing f
⊢ CompleteSpace α ↔ IsComplete (range f)

Next tactic:
rw [completeSpace_iff_isComplete_univ, ← isComplete_image_iff hf, image_univ]
theorem completeSpace_congr {e : α ≃ β} (he : UniformEmbedding e) :
    CompleteSpace α ↔ CompleteSpace β := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
e : α ≃ β
he : UniformEmbedding ⇑e
⊢ CompleteSpace α ↔ CompleteSpace β

Next tactic:
rw [completeSpace_iff_isComplete_range he.toUniformInducing, e.range_eq_univ,
    completeSpace_iff_isComplete_univ]
theorem completeSpace_coe_iff_isComplete {s : Set α} : CompleteSpace s ↔ IsComplete s :=
  (completeSpace_iff_isComplete_range uniformEmbedding_subtype_val.toUniformInducing).trans <| by
    

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : UniformSpace α
inst✝¹ : UniformSpace β
inst✝ : UniformSpace γ
s : Set α
⊢ IsComplete (range Subtype.val) ↔ IsComplete s

Next tactic:
rw [Subtype.range_coe]
theorem totallyBounded_preimage {f : α → β} {s : Set β} (hf : UniformEmbedding f)
    (hs : TotallyBounded s) : TotallyBounded (f ⁻¹' s) := fun t ht => by
  

Proof state:
α : 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 ∈ 𝓤 α
⊢ ∃ t_1, Set.Finite t_1 ∧ f ⁻¹' s ⊆ ⋃ y ∈ t_1, {x | (x, y) ∈ t}

Next tactic:
rw [← hf.comap_uniformity] at ht
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
  

Proof state:
α : 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_1, Set.Finite t_1 ∧ f ⁻¹' s ⊆ ⋃ y ∈ t_1, {x | (x, y) ∈ t}

Next tactic:
rcases mem_comap.2 ht with ⟨t', ht', ts⟩
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⟩
  

Proof state:
case 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
⊢ ∃ t_1, Set.Finite t_1 ∧ f ⁻¹' s ⊆ ⋃ y ∈ t_1, {x | (x, y) ∈ t}

Next tactic:
rcases totallyBounded_iff_subset.1 (totallyBounded_subset (image_preimage_subset f s) hs) _ ht'
    with ⟨c, cs, hfc, hct⟩