Library UniMath.CategoryTheory.Limits.Examples.CategoryOfSetGroupoidsLimits

1. The terminal setgroupoid

Definition terminal_setgroupoid
  : setgroupoid.
Proof.
  use make_setgroupoid.
  - use make_setcategory.
    + exact unit_category.
    + apply isasetunit.
  - exact (pr2 (path_univalent_groupoid (hlevelntosn 2 unit (hlevelntosn 1 unit isapropunit)))).
Defined.

Proposition terminal_obj_setgroupoid_eq
            {G : setgroupoid}
            (F : G terminal_setgroupoid)
  : F = functor_to_unit G.
Proof.
  use functor_eq.
  {
    apply homset_property.
  }
  use functor_data_eq_alt.
  - intro x.
    apply isapropunit.
  - intros x y f.
    apply isasetunit.
Qed.

Definition terminal_obj_setgroupoid
  : Terminal cat_of_setgroupoid.
Proof.
  use make_Terminal.
  - exact terminal_setgroupoid.
  - intros G.
    simple refine (_ ,, _).
    + apply functor_to_unit.
    + intro F.
      exact (terminal_obj_setgroupoid_eq F).
Defined.