/-
Copyright (c) 2024 Christian Merten. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Christian Merten
-/
module
public import Mathlib.CategoryTheory.FintypeCat
public import Mathlib.Topology.Category.TopCat.Basic
/-!
# Category of finite topological spaces
Definition of the category of finite topological spaces with the canonical
forgetful functors.
-/
@[expose] public section
universe u
open CategoryTheory
/-- A bundled finite topological space. -/
structure FinTopCat where
/-- carrier of a finite topological space. -/
toTop : TopCat.{u} -- TODO: turn this into an `extends`?
[fintype : Fintype toTop]
namespace FinTopCat
instance : Inhabited FinTopCat :=
⟨{ toTop := ↧PEmpty }⟩
instance : CoeSort FinTopCat (Type u) :=
⟨fun X => X.toTop⟩
attribute [instance] fintype
instance : Category FinTopCat :=
inferInstanceAs <| Category (InducedCategory _ toTop)
instance : ConcreteCategory FinTopCat (C(·, ·)) :=
inferInstanceAs <| ConcreteCategory (InducedCategory _ toTop) _
/-- Construct a bundled `FinTopCat` from the underlying type and the appropriate typeclasses. -/
def of (X : Type u) [Fintype X] [TopologicalSpace X] : FinTopCat where
toTop := ↧X
fintype := ‹_›
open Lean.PrettyPrinter.Delaborator in
/-- This prints `FinTopCat.of X` as `↧X`. -/
@[app_delab FinTopCat.of]
meta def delabOf : Delab := CategoryTheory.delabOf
@[simp]
theorem coe_of (X : Type u) [Fintype X] [TopologicalSpace X] :
(of X : Type u) = X :=
rfl
/-- The forgetful functor to `FintypeCat`. -/
instance : HasForget₂ FinTopCat FintypeCat :=
HasForget₂.mk' (fun X ↦ ↧X) (fun _ ↦ rfl)
(fun f ↦ FintypeCat.homMk f) HEq.rfl
instance (X : FinTopCat) : TopologicalSpace ((forget₂ FinTopCat FintypeCat).obj X) :=
inferInstanceAs <| TopologicalSpace X
/-- The forgetful functor to `TopCat`. -/
instance : HasForget₂ FinTopCat TopCat :=
inferInstanceAs <| HasForget₂ (InducedCategory _ toTop) _
instance (X : FinTopCat) : Fintype ((forget₂ FinTopCat TopCat).obj X) :=
X.fintype
end FinTopCat
namespace FintypeCatDiscrete
/-- Scoped topological space instance on objects of the category of finite types, assigning
the discrete topology. -/
scoped instance (X : FintypeCat) : TopologicalSpace X := ⊥
scoped instance (X : FintypeCat) : DiscreteTopology X := ⟨rfl⟩
/-- The forgetful functor from finite types to topological spaces, forgetting discreteness.
This is a scoped instance. -/
scoped instance : HasForget₂ FintypeCat TopCat where
forget₂.obj X := ↧X
forget₂.map f := TopCat.ofHom ⟨f, continuous_of_discreteTopology⟩
end FintypeCatDiscrete
¤ Dauer der Verarbeitung: 0.3 Sekunden
¤
*© Formatika GbR, Deutschland