Zulip Chat Archive
Stream: Is there code for X?
Topic: Homeomorphism between empty sets (in different types)
Michael Rothgang (Nov 03 2023 at 23:02):
Given the empty set in two different types, does mathlib have the homeomorphism (or even the unique) function between these? MWE
import Mathlib
lemma emptyhom {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {s : Set X} {t : Set Y} (hs : s = ∅) (ht : t = ∅) : Homeomorph s t := sorry
Mathematically, this is obvious (there's a unique function between the empty sets; it's vacuously continuous at each point). I have a proof, but I'm sure this can be golfed much more - and have the itch this should exist somewhere. Loogle and moogle were not helpful, though.
Michael Rothgang (Nov 03 2023 at 23:03):
Current solution: improvements welcome!
lemma emptyhom {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {s : Set X} {t : Set Y}
(hs : s = ∅) (ht : t = ∅) : Homeomorph s t :=
{
toFun := fun ⟨x, hx⟩ ↦ ((Set.mem_empty_iff_false x).mp (hs ▸ hx)).elim
invFun := fun ⟨x, hx⟩ ↦ ((Set.mem_empty_iff_false x).mp (ht ▸ hx)).elim
left_inv := by intro; aesop
right_inv := by intro; aesop
}
Ruben Van de Velde (Nov 03 2023 at 23:23):
For what it's worth, mathlib doesn't usually have arguments that just state that a free variable is equal to something, like your hs
and ht
, as it tends to be easier to just substitute them
Ruben Van de Velde (Nov 03 2023 at 23:23):
And I'm guessing you should use def
rather than lemma
here
Michael Rothgang (Nov 03 2023 at 23:34):
Thanks: updated code
Alex J. Best (Nov 04 2023 at 00:00):
I guess I would expect this to be stated similarly to docs#Equiv.equivOfIsEmpty (which answers your question about the unique function also)
Alex J. Best (Nov 04 2023 at 00:04):
ie
import Mathlib
lemma emptyhom {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [IsEmpty X] [IsEmpty Y]: Homeomorph X Y :=
{ Equiv.equivOfIsEmpty X Y with }
Patrick Massot (Nov 04 2023 at 00:14):
Ruben Van de Velde said:
For what it's worth, mathlib doesn't usually have arguments that just state that a free variable is equal to something, like your
hs
andht
, as it tends to be easier to just substitute them
It is true in general but it is worth saying this isn't always a good idea. It leads to a proliferation of ugly and slow calls to convert.
Scott Morrison (Nov 04 2023 at 07:00):
Michael Rothgang said:
Current solution: improvements welcome!
lemma emptyhom {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {s : Set X} {t : Set Y} (hs : s = ∅) (ht : t = ∅) : Homeomorph s t := { toFun := fun ⟨x, hx⟩ ↦ ((Set.mem_empty_iff_false x).mp (hs ▸ hx)).elim invFun := fun ⟨x, hx⟩ ↦ ((Set.mem_empty_iff_false x).mp (ht ▸ hx)).elim left_inv := by intro; aesop right_inv := by intro; aesop }
Someone really should put := by aesop
as a default argument here!
Michael Rothgang (Nov 04 2023 at 12:48):
Thanks for all the feedback! I have PRed this lemmas a part of #8160.
Last updated: Dec 20 2023 at 11:08 UTC