/-
Copyright (c) 2026 Terence Rokop. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Terence Rokop
-/modulepublicimportGeb.Mathlib.CategoryTheory.FinSetSkel.BasicpublicimportMathlib.CategoryTheory.Category.CatpublicimportMathlib.CategoryTheory.FintypeCatpublicimportMathlib.CategoryTheory.Skeletal
FinSetSkel compared with mathlib's skeleton
FinSetSkel and FintypeCat.Skeleton are the same category
presented differently: the comparison functors are mutually inverse on
the nose, giving an isomorphism in Cat rather than merely an
equivalence.
This module is allowlisted for Classical.choice, which
CategoryTheory.Cat.category depends on: an isomorphism in Cat is
an Iso with respect to that instance, so its type carries the
dependence however it is constructed. The comparison functors
themselves are choice-free; the taint enters the composite identities
through CategoryTheory.Functor.comp in their statements. Everything
pointwise is in FinSetSkel.Basic, so this module packages rather
than argues.
The isomorphism is closed by CategoryTheory.Functor.hext, which
takes object equality together with HEq of the morphism components.
Functor.ext does not close it: its h_map obligation retains
eqToHom applied to (F ⋙ G).obj X = (𝟭 _).obj X, on which
eqToHom_refl cannot fire. Write Functor.ext qualified — under
open CategoryTheory a bare Functor.ext resolves to the
LawfulFunctor lemma and errors with a message mentioning f <$> x.
Functor.hext is unambiguous, there being no _root_.Functor.hext,
and is written qualified only for symmetry.
Main definitions
FinSetSkel.toSkeleton, FinSetSkel.ofSkeleton — the comparison
functors.
FinSetSkel.catIso — the isomorphism in Cat.
FinSetSkel.skeletonEquivalence — the equivalence, defined as
Cat.equivOfIso of the isomorphism so that a reader arriving at the
weaker statement is led to the stronger one.
FinSetSkel.incl — the inclusion into FintypeCat.
Main statements
FinSetSkel.skeletal — isomorphic objects are equal.
FinSetSkel.isSkeleton — FinSetSkel is a skeleton of
FintypeCat.
Implementation notes
FinSetSkel is not an instantiation of FintypeCat.Skeleton because it
cannot be. mathlib's SmallCategory Skeleton instance fixes
Hom X Y := ULift (Fin X.len) → ULift (Fin Y.len), and instance search
selects one Category structure per type, so a category with the same
objects and vector morphisms is a distinct type rather than a
re-instantiation. The representation is what makes the constructions
decidable: mathlib's finite limits and colimits on FintypeCat are
layered over noncomputable constructions, so nothing transported along
the equivalence computes. Measured at v4.33.0-rc1.