Natural isomorphisms #
For the most part, natural isomorphisms are just another sort of isomorphism.
We provide some special support for extracting components:
- if
α : F ≅ G
, thena.app X : F.obj X ≅ G.obj X
, and building natural isomorphisms from components:
NatIso.ofComponents
(app : ∀ X : C, F.obj X ≅ G.obj X)
(naturality : ∀ {X Y : C} (f : X ⟶ Y), F.map f ≫ (app Y).hom = (app X).hom ≫ G.map f) :
F ≅ G
only needing to check naturality in one direction.
Implementation #
Note that NatIso
is a namespace without a corresponding definition;
we put some declarations that are specifically about natural isomorphisms in the Iso
namespace so that they are available using dot notation.
The application of a natural isomorphism to an object. We put this definition in a different
namespace, so that we can use α.app
Equations
- α.app X = CategoryTheory.Iso.mk (α.hom.app X) (α.inv.app X)
Instances For
Unfortunately we need a separate set of cancellation lemmas for components of natural isomorphisms,
because the simp
normal form is α.hom.app X
, rather than α.app.hom X
.
(With the later, the morphism would be visibly part of an isomorphism, so general lemmas about isomorphisms would apply.)
In the future, we should consider a redesign that changes this simp norm form, but for now it breaks too many proofs.
The components of a natural isomorphism are isomorphisms.
Construct a natural isomorphism between functors by giving object level isomorphisms, and checking naturality only in the forward direction.
Equations
- CategoryTheory.NatIso.ofComponents app = CategoryTheory.Iso.mk (CategoryTheory.NatTrans.mk fun X => (app X).hom) (CategoryTheory.NatTrans.mk fun X => (app X).inv)
Instances For
A natural transformation is an isomorphism if all its components are isomorphisms.
Horizontal composition of natural isomorphisms.
Equations
- CategoryTheory.NatIso.hcomp α β = CategoryTheory.Iso.mk (α.hom ◫ β.hom) (α.inv ◫ β.inv)