Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Topology): Introduce HomeomorphClass #18689

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Mathlib/Topology/Homeomorph.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1048,3 +1048,33 @@ lemma IsHomeomorph.pi_map {ι : Type*} {X Y : ι → Type*} [∀ i, TopologicalS
[∀ i, TopologicalSpace (Y i)] {f : (i : ι) → X i → Y i} (h : ∀ i, IsHomeomorph (f i)) :
IsHomeomorph (fun (x : ∀ i, X i) i ↦ f i (x i)) :=
(Homeomorph.piCongrRight fun i ↦ (h i).homeomorph (f i)).isHomeomorph

/-- `HomeomorphClass F A B` states that `F` is a type of two-sided continuous morphisms.-/
Thmoas-Guan marked this conversation as resolved.
Show resolved Hide resolved
class HomeomorphClass (F : Type*) (A B : outParam Type*)
[TopologicalSpace A] [TopologicalSpace B] [h : EquivLike F A B] : Prop where
continuous_toFun : ∀ (f : F), Continuous (h.coe f)
continuous_invFun : ∀ (f : F), Continuous (h.inv f)

namespace HomeomorphClass

variable {F α β : Type*} [TopologicalSpace α] [TopologicalSpace β] [EquivLike F α β]

/-- Turn an element of a type `F` satisfying `HomeomorphClass F α β` into an actual
`Homeomorph`. This is declared as the default coercion from `F` to `α ≃ₜ β`. -/
Thmoas-Guan marked this conversation as resolved.
Show resolved Hide resolved
def toHomeomorph [h : HomeomorphClass F α β] (f : F) : α ≃ₜ β :={
(f : α ≃ β) with
continuous_toFun := h.continuous_toFun f
continuous_invFun := h.continuous_invFun f
}
Thmoas-Guan marked this conversation as resolved.
Show resolved Hide resolved

instance [HomeomorphClass F α β] : CoeTC F (α ≃ₜ β) :=
⟨HomeomorphClass.toHomeomorph⟩
Comment on lines +1073 to +1074
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please ask on Zulip what is the correct class to use here. CoeTC is not preferred (although it's littered throughout Mathlib). We need to come to a consensus on Zulip about which Coe class is best for coercions from morphism classes to morphisms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asked in a thread of PR review, needed anywhere else?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct choice if you want to infer the left argument from the right is CoeOut. So:

Suggested change
instance [HomeomorphClass F α β] : CoeTC F (α ≃ₜ β) :=
⟨HomeomorphClass.toHomeomorph⟩
instance [HomeomorphClass F α β] : CoeOut F (α ≃ₜ β) :=
⟨HomeomorphClass.toHomeomorph⟩


theorem toHomeomorph_injective [HomeomorphClass F α β] : Function.Injective ((↑) : F → α ≃ₜ β) :=
fun _ _ e ↦ DFunLike.ext _ _ fun a ↦ congr_arg (fun e : α ≃ₜ β ↦ e.toFun a) e
Comment on lines +1076 to +1077
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we have this for other morphism classes. I suspect it's not necessary as we can just apply the coercion to functions and then use DFunLike.coe_injective (probably after simp)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this lemma from MulEquivClass, I didn't think carefully whether it is useful.


instance : HomeomorphClass (α ≃ₜ β) α β where
continuous_toFun e := e.continuous_toFun
continuous_invFun e := e.continuous_invFun

end HomeomorphClass
Loading