-- Mathlib/Topology/Maps/Proper/Basic.lean
theorem isProperMap_iff_isClosedMap_filter {X : Type u} {Y : Type v} [TopologicalSpace X]
    [TopologicalSpace Y] {f : X → Y} :
    IsProperMap f ↔ Continuous f ∧ IsClosedMap
      (Prod.map f id : X × Filter X → Y × Filter X)

Proof state:
case mpr.intro.mk.intro.refl.intro.mk.intro.intro
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : ∀ t ∈ 𝓝 (x, 𝒰.1), (t ∩ {xℱ | xℱ.2 = pure xℱ.1}).Nonempty
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
z : X
hz : z ∈ U
hz' : Uᶜ ∈ pure z
⊢ False

Tactic:
exact hz' hz

Result:
no goals

Proof state:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : (x, 𝒰.1) ∈ F
⊢ ∃ x_1, f x_1 = f x ∧ ↑𝒰 ≤ 𝓝 x_1

Tactic:
refine ⟨x, rfl, fun U hU ↦ Ultrafilter.compl_not_mem_iff.mp fun hUc ↦ ?_⟩

Result:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : (x, 𝒰.1) ∈ F
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
⊢ False

Proof state:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Tactic:
let F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}

Result:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Proof state:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : ∀ t ∈ 𝓝 (x, 𝒰.1), (t ∩ {xℱ | xℱ.2 = pure xℱ.1}).Nonempty
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
⊢ False

Tactic:
rcases hx (U ×ˢ {𝒢 | Uᶜ ∈ 𝒢}) (prod_mem_nhds hU (isOpen_setOf_mem.mem_nhds hUc)) with
  ⟨⟨z, 𝒢⟩, ⟨⟨hz : z ∈ U, hz' : Uᶜ ∈ 𝒢⟩, rfl : 𝒢 = pure z⟩⟩

Result:
case mpr.intro.mk.intro.refl.intro.mk.intro.intro
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : ∀ t ∈ 𝓝 (x, 𝒰.1), (t ∩ {xℱ | xℱ.2 = pure xℱ.1}).Nonempty
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
z : X
hz : z ∈ U
hz' : Uᶜ ∈ pure z
⊢ False

Proof state:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Tactic:
have : (y, ↑𝒰) ∈ Prod.map f id '' F :=
this.mem_of_tendsto (hy.prod_mk_nhds (Filter.tendsto_pure_self (𝒰 : Filter X)))
    (Eventually.of_forall fun x ↦ ⟨⟨x, pure x⟩, subset_closure rfl, rfl⟩)

Result:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this✝ : IsClosed (Prod.map f id '' F)
this : (y, ↑𝒰) ∈ Prod.map f id '' F
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Proof state:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : (x, 𝒰.1) ∈ F
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
⊢ False

Tactic:
rw [mem_closure_iff_nhds] at hx

Result:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : ∀ t ∈ 𝓝 (x, 𝒰.1), (t ∩ {xℱ | xℱ.2 = pure xℱ.1}).Nonempty
U : Set X
hU : U ∈ 𝓝 x
hUc : Uᶜ ∈ 𝒰
⊢ False

Proof state:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this✝ : IsClosed (Prod.map f id '' F)
this : (y, ↑𝒰) ∈ Prod.map f id '' F
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Tactic:
rcases this with ⟨⟨x, _⟩, hx, ⟨_, _⟩⟩

Result:
case mpr.intro.mk.intro.refl
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
x : X
hy : Tendsto f (↑𝒰) (𝓝 (f x))
hx : (x, 𝒰.1) ∈ F
⊢ ∃ x_1, f x_1 = f x ∧ ↑𝒰 ≤ 𝓝 x_1

Proof state:
case mp
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : IsProperMap f
⊢ Continuous f ∧ IsClosedMap (Prod.map f id)

Tactic:
exact ⟨H.continuous, H.universally_closed _⟩

Result:
no goals

Proof state:
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
⊢ IsProperMap f ↔ Continuous f ∧ IsClosedMap (Prod.map f id)

Tactic:
constructor <;> intro H

Result:
case mp
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : IsProperMap f
⊢ Continuous f ∧ IsClosedMap (Prod.map f id)

case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
⊢ IsProperMap f

Proof state:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
⊢ Continuous f ∧ ∀ ⦃𝒰 : Ultrafilter X⦄ ⦃y : Y⦄, Tendsto f (↑𝒰) (𝓝 y) → ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Tactic:
refine ⟨H.1, fun 𝒰 y hy ↦ ?_⟩

Result:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Proof state:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x

Tactic:
have := H.2 F isClosed_closure

Result:
case mpr
X : Type u
Y : Type v
inst✝¹ : TopologicalSpace X
inst✝ : TopologicalSpace Y
f : X → Y
H : Continuous f ∧ IsClosedMap (Prod.map f id)
𝒰 : Ultrafilter X
y : Y
hy : Tendsto f (↑𝒰) (𝓝 y)
F : Set (X × Filter X) := closure {xℱ | xℱ.2 = pure xℱ.1}
this : IsClosed (Prod.map f id '' F)
⊢ ∃ x, f x = y ∧ ↑𝒰 ≤ 𝓝 x