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 _)