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.
(** * Laws about product categories *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Category.Core Functor.Core InitialTerminalCategory.Core InitialTerminalCategory.Functors Category.Prod Functor.Prod Functor.Composition.Core Functor.Identity Functor.Composition.Laws.Set Universe Polymorphism.Set Implicit Arguments.Generalizable All Variables.Set Asymmetric Patterns.LocalOpen Scope category_scope.LocalOpen Scope functor_scope.Local Notationprod_type := Basics.Overture.prod.Local Notationfst_type := Basics.Overture.fst.Local Notationsnd_type := Basics.Overture.snd.Local Notationpair_type := Basics.Overture.pair.(** ** Swap functor [C × D → D × C] *)ModuleSwap.Definitionfunctor (CD : PreCategory)
: Functor (C * D) (D * C)
:= Build_Functor (C * D) (D * C)
(funcd => (snd_type cd, fst_type cd)%core)
(fun__m => (snd_type m, fst_type m)%core)
(fun_____ => idpath)
(fun_ => idpath).Definitionlaw (CD : PreCategory)
: functor C D o functor D C = 1
:= idpath.EndSwap.(** ** [A * (B * C) ≅ (A * B) * C] *)ModuleAssociativity.Sectionassociativity.VariablesABC : PreCategory.Definitionfunctor : Functor (A * (B * C)) ((A * B) * C)
:= (fst * (fst o snd)) * (snd o snd).Definitioninverse : Functor ((A * B) * C) (A * (B * C))
:= (fst o fst) * ((snd o fst) * snd).Definitionlaw
: functor o inverse = 1
/\ inverse o functor = 1
:= (idpath, idpath)%core.Endassociativity.EndAssociativity.(** ** Laws about the initial category [0] *)ModuleLaw0.Sectionlaw0.Context `{Funext}.Context `{IsInitialCategory zero}.LocalNotation"0" := zero : category_scope.VariableC : PreCategory.#[export] Instanceis_initial_category__product
: IsInitialCategory (C * 0)
:= funPc => initial_category_ind P (snd c).#[export] Instanceis_initial_category__product'
: IsInitialCategory (0 * C)
:= funPc => initial_category_ind P (fst c).Definitionfunctor : Functor (C * 0) 0 := Functors.from_initial _.Definitionfunctor' : Functor (0 * C) 0 := Functors.from_initial _.Definitioninverse : Functor 0 (C * 0) := Functors.from_initial _.Definitioninverse' : Functor 0 (0 * C) := Functors.from_initial _.(** *** [C × 0 ≅ 0] *)Definitionlaw
: functor o inverse = 1
/\ inverse o functor = 1
:= center _.(** *** [0 × C ≅ 0] *)Definitionlaw'
: functor' o inverse' = 1
/\ inverse' o functor' = 1
:= center _.Endlaw0.EndLaw0.(** ** Laws about the terminal category [1] *)ModuleLaw1.Sectionlaw1.Context `{Funext}.Context `{IsTerminalCategory one}.LocalNotation"1" := one : category_scope.VariableC : PreCategory.Definitionfunctor : Functor (C * 1) C
:= fst.Definitionfunctor' : Functor (1 * C) C
:= snd.Definitioninverse : Functor C (C * 1)
:= 1 * Functors.to_terminal _.Definitioninverse' : Functor C (1 * C)
:= Functors.to_terminal _ * 1.(** We could throw this in a [repeat match goal with ... end], but we know the order, so we hard-code the order to speed it up by a factor of about 10. *)Local Ltact_prod :=
split;
tryfirst [ exact (compose_fst_prod _ _)
| exact (compose_snd_prod _ _) ];
[];
apply Functor.Prod.Universal.path_prod;
rewrite <- !Functor.Composition.Laws.associativity byassumption;
(rewrite?compose_fst_prod, ?compose_snd_prod,
?Functor.Composition.Laws.left_identity,
?Functor.Composition.Laws.right_identity
byassumption);
try (reflexivity || exact (center _)).(** *** [C × 1 ≅ C] *)