Concrete categories #
A concrete category is a category C
with a fixed faithful functor
forget : C ⥤ Type*
. We define concrete categories using class ConcreteCategory
.
In particular, we impose no restrictions on the
carrier type C
, so Type
is a concrete category with the identity
forgetful functor.
Each concrete category C
comes with a canonical faithful functor
forget C : C ⥤ Type*
. We say that a concrete category C
admits a
forgetful functor to a concrete category D
, if it has a functor
forget₂ C D : C ⥤ D
such that (forget₂ C D) ⋙ (forget D) = forget C
,
see class HasForget₂
. Due to Faithful.div_comp
, it suffices
to verify that forget₂.obj
and forget₂.map
agree with the equality
above; then forget₂
will satisfy the functor laws automatically, see
HasForget₂.mk'
.
Two classes helping construct concrete categories in the two most
common cases are provided in the files BundledHom
and
UnbundledHom
, see their documentation for details.
References #
See [Ahrens and Lumsdaine, Displayed Categories][ahrens2017] for related work.
A concrete category is a category C
with a fixed faithful functor Forget : C ⥤ Type
.
Note that ConcreteCategory
potentially depends on three independent universe levels,
- the universe level
w
appearing inForget : C ⥤ Type w
- the universe level
v
of the morphisms (i.e. we have aCategory.{v} C
) - the universe level
u
of the objects (i.eC : Type u
) They are specified that order, to avoid unnecessary universe annotations.
- forget : CategoryTheory.Functor C (Type w)
We have a functor to Type
- forget_faithful : CategoryTheory.ConcreteCategory.forget.Faithful
That functor is faithful
Instances
That functor is faithful
The forgetful functor from a concrete category to Type u
.
Equations
- CategoryTheory.forget C = CategoryTheory.ConcreteCategory.forget
Instances For
Provide a coercion to Type u
for a concrete category. This is not marked as an instance
as it could potentially apply to every type, and so is too expensive in typeclass search.
You can use it on particular examples as:
instance : HasCoeToSort X := ConcreteCategory.hasCoeToSort X
Equations
- CategoryTheory.ConcreteCategory.hasCoeToSort C = { coe := fun (X : C) => (CategoryTheory.forget C).obj X }
Instances For
In any concrete category, (forget C).map
is injective.
Equations
- CategoryTheory.ConcreteCategory.instFunLike = { coe := fun (f : X ⟶ Y) => (CategoryTheory.forget C).map f, coe_injective' := ⋯ }
Instances For
In any concrete category, we can test equality of morphisms by pointwise evaluations.
Analogue of congr_fun h x
,
when h : f = g
is an equality between morphisms in a concrete category.
HasForget₂ C D
, where C
and D
are both concrete categories, provides a functor
forget₂ C D : C ⥤ D
and a proof that forget₂ ⋙ (forget D) = forget C
.
- forget₂ : CategoryTheory.Functor C D
A functor from
C
toD
- forget_comp : CategoryTheory.HasForget₂.forget₂.comp (CategoryTheory.forget D) = CategoryTheory.forget C
It covers the
ConcreteCategory.forget
forC
andD
Instances
It covers the ConcreteCategory.forget
for C
and D
The forgetful functor C ⥤ D
between concrete categories for which we have an instance
HasForget₂ C
.
Equations
- CategoryTheory.forget₂ C D = CategoryTheory.HasForget₂.forget₂
Instances For
Equations
- ⋯ = ⋯
Equations
- CategoryTheory.InducedCategory.hasForget₂ f = { forget₂ := CategoryTheory.inducedFunctor f, forget_comp := ⋯ }
Equations
- CategoryTheory.FullSubcategory.hasForget₂ Z = { forget₂ := CategoryTheory.fullSubcategoryInclusion Z, forget_comp := ⋯ }
In order to construct a “partially forgetting” functor, we do not need to verify functor laws;
it suffices to ensure that compositions agree with forget₂ C D ⋙ forget D = forget C
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Composition of HasForget₂
instances.
Equations
- CategoryTheory.HasForget₂.trans C D E = { forget₂ := (CategoryTheory.forget₂ C D).comp (CategoryTheory.forget₂ D E), forget_comp := ⋯ }
Instances For
Every forgetful functor factors through the identity functor. This is not a global instance as it is prone to creating type class resolution loops.
Equations
- CategoryTheory.hasForgetToType C = { forget₂ := CategoryTheory.forget C, forget_comp := ⋯ }