module Algebra.Group.Cat.Base where

The category of groupsπ

The category of groups, as the name implies, has its objects the Groups, with the morphisms between them the group homomorphisms.

open Group-on
open is-group-hom

Group-structure : β β β Thin-structure β Group-on
Group-structure β .is-hom f G G' = el! (is-group-hom G G' f)

Group-structure β .id-is-hom        .pres-β x y = refl
Group-structure β .β-is-hom f g Ξ± Ξ² .pres-β x y =
ap f (Ξ² .pres-β x y) β Ξ± .pres-β _ _

Group-structure β .id-hom-unique {s = s} {t = t} Ξ± Ξ² i =
record
{ _β_          = Ξ» x y β Ξ± .pres-β x y i
; has-is-group =
is-propβpathp (Ξ» i β is-group-is-prop {_*_ = Ξ» x y β Ξ± .pres-β x y i})
(s .has-is-group)
(t .has-is-group)
i
}

Groups : β β β Precategory (lsuc β) β
Groups β = Structured-objects (Group-structure β)

Groups-is-category : β {β} β is-category (Groups β)
Groups-is-category = Structured-objects-is-category (Group-structure _)

instance
Groups-equational : β {β} β is-equational (Group-structure β)
Groups-equational .is-equational.invert-id-hom x .pres-β a b = sym (x .pres-β a b)

module Groups {β} = Cat (Groups β)

Group : β β β Type (lsuc β)
Group _ = Groups.Ob

to-group : β {β} {A : Type β} β make-group A β Group β
to-group {A = A} mg = el A (mg .make-group.group-is-set) , (to-group-on mg)

The underlying setπ

The category of groups admits a faithful functor into the category of sets, written which projects out the underlying set of the group. Faithfulness of this functor says, in more specific words, that equality of group homomorphisms can be tested by comparing the underlying morphisms of sets.

GrpβͺSets : Functor (Groups β) (Sets β)
GrpβͺSets = Forget-structure (Group-structure _)

GrpβͺSets-is-faithful : is-faithful (GrpβͺSets {β})
GrpβͺSets-is-faithful = Structured-hom-path (Group-structure _)