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.
(** * Fundamental Pregroupoids *)
[Loading ML file number_string_notation_plugin.cmxs (using legacy method) ... done]
Require Import HoTT.Truncations.Core. Require Import HoTT.Basics. Set Universe Polymorphism. Set Implicit Arguments. Generalizable All Variables. Set Asymmetric Patterns. Local Open Scope path_scope. Local Open Scope category_scope. (** Quoting the HoTT Book: Example. For _any_ type [X], there is a precategory with [X] as its type of objects and with [hom(x,y) : āˆ„x = yāˆ„ā‚€]. The composition operation [āˆ„y = zāˆ„ā‚€ ā†’ āˆ„x = yāˆ„ā‚€ ā†’ āˆ„x = zāˆ„ā‚€] is defined by induction on truncation from concatenation [(y = z) ā†’ (x = y) ā†’ (x = z)]. We call this the fundamental pregroupoid of [X]. *) (** We don't want access to all of the internals of a groupoid category at top level. *) Module FundamentalPreGroupoidCategoryInternals. Section fundamental_pregroupoid_category. Variable X : Type. Local Notation object := X (only parsing). Local Notation morphism s d := (Trunc 0 (s = d :> X)) (only parsing).
X: Type
s, d, d': X
m: Trunc 0 (d = d')
m': Trunc 0 (s = d)

Trunc 0 (s = d')
X: Type
s, d, d': X
m: Trunc 0 (d = d')
m': Trunc 0 (s = d)

Trunc 0 (s = d')
X: Type
s, d, d': X
m: Trunc 0 (d = d')
m': s = d

Trunc 0 (s = d')
X: Type
s, d, d': X
m': s = d
m: d = d'

Trunc 0 (s = d')
X: Type
s, d, d': X
m': s = d
m: d = d'

s = d'
exact (m' @ m). Defined. Definition identity x : morphism x x := tr (reflexivity _). Global Arguments compose [s d d'] m m' / . Global Arguments identity x / . End fundamental_pregroupoid_category. End FundamentalPreGroupoidCategoryInternals. (** ** Categorification of the fundamental pregroupoid of a type *)
X: Type

PreCategory
X: Type

PreCategory
refine (@Build_PreCategory X _ (@FundamentalPreGroupoidCategoryInternals.identity X) (@FundamentalPreGroupoidCategoryInternals.compose X) _ _ _ _); simpl; intros; abstract ( repeat match goal with | [ m : Trunc _ _ |- _ ] => revert m; apply Trunc_ind; [ intro; match goal with | [ |- IsHSet (?a = ?b :> ?T) ] => generalize a b; intros; let H := fresh in assert (H : forall x y : T, IsHProp (x = y)) end; typeclasses eauto | intro ] end; simpl; apply ap; first [ apply concat_p_pp | apply concat_1p | apply concat_p1 ] ). Defined.