Discrete categories #
We define Discrete α
as a structure containing a term a : α
for any type α
,
and use this type alias to provide a SmallCategory
instance
whose only morphisms are the identities.
There is an annoying technical difficulty that it has turned out to be inconvenient
to allow categories with morphisms living in Prop
,
so instead of defining X ⟶ Y
in Discrete α
as X = Y
,
one might define it as PLift (X = Y)
.
In fact, to allow Discrete α
to be a SmallCategory
(i.e. with morphisms in the same universe as the objects),
we actually define the hom type X ⟶ Y
as ULift (PLift (X = Y))
.
Discrete.functor
promotes a function f : I → C
(for any category C
) to a functor
Discrete.functor f : Discrete I ⥤ C
.
Similarly, Discrete.natTrans
and Discrete.natIso
promote I
-indexed families of morphisms,
or I
-indexed families of isomorphisms to natural transformations or natural isomorphism.
We show equivalences of types are the same as (categorical) equivalences of the corresponding discrete categories.
- as : α
A wrapper for promoting any type to a category, with the only morphisms being equalities.
A wrapper for promoting any type to a category, with the only morphisms being equalities.
Instances For
Discrete α
is equivalent to the original type α
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CategoryTheory.instDecidableEqDiscrete = Equiv.decidableEq CategoryTheory.discreteEquiv
The "Discrete" category on a type, whose morphisms are equalities.
Because we do not allow morphisms in Prop
(only in Type
),
somewhat annoyingly we have to define X ⟶ Y
as ULift (PLift (X = Y))
.
See https://stacks.math.columbia.edu/tag/001A
Equations
- CategoryTheory.discreteCategory α = CategoryTheory.Category.mk
Equations
- CategoryTheory.Discrete.instInhabitedDiscrete = { default := { as := default } }
A simple tactic to run cases
on any Discrete α
hypotheses.
Equations
- CategoryTheory.Discrete.tacticDiscrete_cases = Lean.ParserDescr.node `CategoryTheory.Discrete.tacticDiscrete_cases 1024 (Lean.ParserDescr.nonReservedSymbol "discrete_cases" false)
Instances For
Use:
attribute [local aesop safe tactic (rule_sets [CategoryTheory])]
CategoryTheory.Discrete.discreteCases
to locally gives aesop_cat
the ability to call cases
on
Discrete
and (_ : Discrete _) ⟶ (_ : Discrete _)
hypotheses.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- CategoryTheory.Discrete.instUniqueDiscrete = Unique.mk' (CategoryTheory.Discrete α)
Extract the equation from a morphism in a discrete category.
Promote an equation between the wrapped terms in X Y : Discrete α
to a morphism X ⟶ Y
in the discrete category.
Equations
- CategoryTheory.Discrete.eqToHom h = CategoryTheory.eqToHom (_ : X = Y)
Instances For
Promote an equation between the wrapped terms in X Y : Discrete α
to an isomorphism X ≅ Y
in the discrete category.
Equations
- CategoryTheory.Discrete.eqToIso h = CategoryTheory.eqToIso (_ : X = Y)
Instances For
A variant of eqToHom
that lifts terms to the discrete category.
Instances For
A variant of eqToIso
that lifts terms to the discrete category.
Instances For
Any function I → C
gives a functor Discrete I ⥤ C
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The discrete functor induced by a composition of maps can be written as a composition of two discrete functors.
Equations
- CategoryTheory.Discrete.functorComp f g = CategoryTheory.NatIso.ofComponents fun X => CategoryTheory.Iso.refl ((CategoryTheory.Discrete.functor (f ∘ g)).obj X)
Instances For
For functors out of a discrete category, a natural transformation is just a collection of maps, as the naturality squares are trivial.
Equations
Instances For
For functors out of a discrete category, a natural isomorphism is just a collection of isomorphisms, as the naturality squares are trivial.
Instances For
Every functor F
from a discrete category is naturally isomorphic (actually, equal) to
discrete.functor (F.obj)
.
Equations
- CategoryTheory.Discrete.natIsoFunctor = CategoryTheory.Discrete.natIso fun x => CategoryTheory.Iso.refl (F.obj x)
Instances For
Composing discrete.functor F
with another functor G
amounts to composing F
with G.obj
Equations
Instances For
We can promote a type-level Equiv
to
an equivalence between the corresponding discrete
categories.
Equations
- One or more equations did not get rendered due to their size.
Instances For
We can convert an equivalence of discrete
categories to a type-level Equiv
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A discrete category is equivalent to its opposite category.
Equations
- One or more equations did not get rendered due to their size.