Built with Alectryon, running Coq+SerAPI v8.18.0+0.18.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 composition of functors *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import Functor.Paths.Require Import Basics.PathGroupoids Basics.Tactics.Set Universe Polymorphism.Set Implicit Arguments.Generalizable All Variables.Set Asymmetric Patterns.LocalOpen Scope morphism_scope.Sectionidentity_lemmas.Context `{Funext}.VariablesCD : PreCategory.LocalOpen Scope functor_scope.(** ** left identity : [1 ∘ F = F] *)(** If we had that [match (p : a = b) in (_ = y) return (a = y) with idpath => idpath end ≡ p] (a form of eta for paths), this would be judgemental. *)
H: Funext C, D: PreCategory F: Functor C D
1 o F = F
H: Funext C, D: PreCategory F: Functor C D
1 o F = F
by path_functor.Defined.(** ** right identity : [F ∘ 1 = F] *)
H: Funext C, D: PreCategory F: Functor C D
F o 1 = F
H: Funext C, D: PreCategory F: Functor C D
F o 1 = F
by path_functor.Defined.(** ** Action of left and right identity laws on objects *)Definitionleft_identity_fstF
: ap object_of (left_identity F) = idpath
:= @path_functor_uncurried_fst _ _ _ (1 o F) F 11.Definitionright_identity_fstF
: ap object_of (right_identity F) = idpath
:= @path_functor_uncurried_fst _ _ _ (F o 1) F 11.Endidentity_lemmas.#[export]
Hint Rewrite @left_identity @right_identity : category.#[export]
Hint Rewrite @left_identity @right_identity : functor.#[export]
Hint Immediate left_identity right_identity : category functor.Sectioncomposition_lemmas.Context `{fs : Funext}.VariablesBCDE : PreCategory.LocalOpen Scope functor_scope.(** ** associativity : [(H ∘ G) ∘ F = H ∘ (G ∘ F)] *)
fs: Funext B, C, D, E: PreCategory F: Functor B C G: Functor C D H: Functor D E
H o G o F = H o (G o F)
fs: Funext B, C, D, E: PreCategory F: Functor B C G: Functor C D H: Functor D E
H o G o F = H o (G o F)
by path_functor.Defined.(** ** Action of associativity on objects *)Definitionassociativity_fstFGH
: ap object_of (associativity F G H) = idpath
:= @path_functor_uncurried_fst _ _ _ ((H o G) o F) (H o (G o F)) 1%path 1%path.Endcomposition_lemmas.#[export]
Hint Resolve associativity : category functor.Sectioncoherence.Context `{fs : Funext}.LocalOpen Scope path_scope.LocalOpen Scope functor_scope.Local Ltaccoherence_t :=
repeatmatch goal with
| [ |- _ = _ :> (_ = _ :> Functor _ _) ] => apply path_path_functor_uncurried
| _ => reflexivity
| _ => progressrewrite?ap_pp, ?concat_1p, ?concat_p1
| _ => progressrewrite?associativity_fst, ?left_identity_fst, ?right_identity_fst
| _ => progress push_ap_object_of
end.(** ** coherence triangle *)(** The following triangle is coherent<< G ∘ (1 ∘ F) === (G ∘ 1) ∘ F \\ // \\ // \\ // \\ // \\ // \\ // G ∘ F>>*)
fs: Funext C, D, E: PreCategory F: Functor C D G: Functor D E
associativity F 1 G @ ap (compose G) (left_identity F) =
ap (funG' : Functor D E => G' o F) (right_identity G)
fs: Funext C, D, E: PreCategory F: Functor C D G: Functor D E
associativity F 1 G @ ap (compose G) (left_identity F) =
ap (funG' : Functor D E => G' o F) (right_identity G)
fs: Funext A, B, C, D, E: PreCategory F: Functor A B G: Functor B C H: Functor C D K: Functor D E
associativity F G (K o H) @ associativity (G o F) H K =
(ap (funKHG : Functor B E => KHG o F)
(associativity G H K) @ associativity F (H o G) K) @
ap (compose K) (associativity F G H)
fs: Funext A, B, C, D, E: PreCategory F: Functor A B G: Functor B C H: Functor C D K: Functor D E
associativity F G (K o H) @ associativity (G o F) H K =
(ap (funKHG : Functor B E => KHG o F)
(associativity G H K) @ associativity F (H o G) K) @
ap (compose K) (associativity F G H)