Built with Alectryon, running Coq+SerAPI v8.19.0+0.19.3. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
(** * Limits and Colimits *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Functor.Composition.Core.Require Import ExponentialLaws.Law1.Functors FunctorCategory.Core.Require Import KanExtensions.Core InitialTerminalCategory.Core NatCategory.Require Import Functor.Paths.Local Set Warnings"-notation-overridden". (* work around bug #5567, https://coq.inria.fr/bugs/show_bug.cgi?id=5567, notation-overridden,parsing should not trigger for only printing notations *)Import Comma.Core.Local Set Warnings"notation-overridden".Set Universe Polymorphism.Set Implicit Arguments.Generalizable All Variables.Set Asymmetric Patterns.LocalOpen Scope functor_scope.LocalOpen Scope category_scope.(** ** The diagonal or "constant diagram" functor Δ *)Sectiondiagonal_functor.Context `{Funext}.VariablesCD : PreCategory.(** Quoting Dwyer and Spalinski: There is a diagonal or ``constant diagram'' functor<< Δ : C → Cᴰ,>> which carries an object [X : C] to the constant functor [Δ X : D -> C] (by definition, this ``constant functor'' sends each object of [D] to [X] and each morphism of [D] to [Identity X]). The functor Δ assigns to each morphism [f : X -> X'] of [C] the constant natural transformation [t(f) : Δ X -> Δ X'] determined by the formula [t(f) d = f] for each object [d] of [D]. **)(** We use [C¹] rather than [C] for judgemental compatibility with Kan extensions. *)Definitiondiagonal_functor : Functor (1 -> C) (D -> C)
:= @pullback_along _ D 1 C (Functors.to_terminal _).Definitiondiagonal_functor' : Functor C (D -> C)
:= diagonal_functor o ExponentialLaws.Law1.Functors.inverse _.Sectionconvert.
transport
(funGO : D -> C =>
forallsd : D,
morphism D s d -> morphism C (GO s) (GO d)) 1
(fun (sd : D) (_ : morphism D s d) =>
(X _1 (center Unit))%morphism) =
(fun (sd : D) (_ : morphism D s d) => 1%morphism)
H: Funext C, D: PreCategory X: 1 -> C
(fun (sd : D) (_ : morphism D s d) =>
(X _1 (center Unit))%morphism) =
(fun (sd : D) (_ : morphism D s d) => 1%morphism)
H: Funext C, D: PreCategory X: 1 -> C x, x0: D x1: morphism D x x0
H: Funext C, D, D': PreCategory x: 1 -> C F: Functor D' D
((diagonal_functor C D) _0 x)%object o F =
((diagonal_functor C D') _0 x)%object
H: Funext C, D, D': PreCategory x: 1 -> C F: Functor D' D
((diagonal_functor C D) _0 x)%object o F =
((diagonal_functor C D') _0 x)%object
path_functor.Qed.Definitioncompose_diagonal_functor_natural_transformationx (F : Functor D' D)
: NaturalTransformation (diagonal_functor C D x o F) (diagonal_functor _ _ x)
:= Build_NaturalTransformation
(diagonal_functor C D x o F)
(diagonal_functor _ _ x)
(funz => identity _)
(fun___ => transitivity
(left_identity _ _ _ _)
(symmetry
_ _
(right_identity _ _ _ _))).Enddiagonal_functor_lemmas.#[export]
Hint Rewrite @compose_diagonal_functor : category.SectionLimit.Context `{Funext}.VariablesCD : PreCategory.VariableF : Functor D C.(** ** Definition of Limit *)(** Quoting Dwyer and Spalinski: Let [D] be a small category and [F : D -> C] a functor. A limit for [F] is an object [L] of [C] together with a natural transformation [t : Δ L -> F] such that for every object [X] of [C] and every natural transformation [s : Δ X -> F], there exists a unique map [s' : X -> L] in [C] such that [t (Δ s') = s]. **)DefinitionIsLimit
:= @IsRightKanExtensionAlong _ D 1 C (Functors.to_terminal _) F.(*Definition IsLimit' := @IsTerminalMorphism (_ -> _) (_ -> _) (diagonal_functor C D) F.*)(* Definition Limit (L : C) := { t : SmallNaturalTransformation ((diagonal_functor C D) L) F & forall X : C, forall s : SmallNaturalTransformation ((diagonal_functor C D) X) F, { s' : C.(Morphism) X L | unique (fun s' => SNTComposeT t ((diagonal_functor C D).(MorphismOf) s') = s) s' } }.*)(** Quoting Dwyer and Spalinski: Let [D] be a small category and [F : D -> C] a functor. A colimit for [F] is an object [c] of [C] together with a natural transformation [t : F -> Δ c] such that for every object [X] of [C] and every natural transformation [s : F -> Δ X], there exists a unique map [s' : c -> X] in [C] such that [(Δ s') t = s]. **)(** ** Definition of Colimit *)DefinitionIsColimit
:= @IsLeftKanExtensionAlong _ D 1 C (Functors.to_terminal _) F.(*Definition IsColimit' := @IsInitialMorphism (_ -> _) (_ -> _) F (diagonal_functor C D).*)(* Definition Colimit (c : C) := { t : SmallNaturalTransformation F ((diagonal_functor C D) c) & forall X : C, forall s : SmallNaturalTransformation F ((diagonal_functor C D) X), { s' : C.(Morphism) c X | is_unique s' /\ SNTComposeT ((diagonal_functor C D).(MorphismOf) s') t = s } }.*)(** TODO(JasonGross): Figure out how to get good introduction and elimination rules working, which don't mention spurious identities. *)(*Section AbstractionBarrier. Section Limit. Set Printing Implicit. Section IntroductionAbstractionBarrier. Local Open Scope morphism_scope. Definition Build_IsLimit (lim_obj : C) (lim_mor : morphism (D -> C) (diagonal_functor' C D lim_obj) F) (lim := CommaCategory.Build_object (diagonal_functor C D) !(F : object (_ -> _)) !lim_obj (center _) lim_mor) (UniversalProperty : forall (lim_obj' : C) (lim_mor' : morphism (D -> C) (diagonal_functor' C D lim_obj') F), Contr { m : morphism C lim_obj' lim_obj | lim_mor o morphism_of (diagonal_functor' C D) m = lim_mor' }) : IsTerminalMorphism lim. Proof. apply Build_IsTerminalMorphism. intros A' p'. specialize (UniversalProperty (A' (center _))).*)EndLimit.(** TODO(JasonGross): Port MorphismsBetweenLimits from catdb *)