module Algebra.Group.Concrete.FinitelyComplete {} where

Finite limits of concrete groups🔗

Since the category of concrete groups is equivalent to the category of groups, and the latter is finitely complete, then so is the former.

ConcreteGroups-finitely-complete : Finitely-complete (ConcreteGroups )
ConcreteGroups-finitely-complete = subst Finitely-complete
  (sym (eqv→path ConcreteGroups-is-category Groups-is-category _ π₁F-is-equivalence))
  Groups-finitely-complete

However, the construction of binary products of concrete groups (corresponding to the direct product of groups) is natural enough to spell out explicitly: one can simply take the product of the underlying groupoids!

Direct-product-concrete : ConcreteGroup   ConcreteGroup   ConcreteGroup 
Direct-product-concrete G H .B = B G ×∙ B H
Direct-product-concrete G H .has-is-connected = is-connected→is-connected∙ $
  ×-is-n-connected 2
    (is-connected∙→is-connected (G .has-is-connected))
    (is-connected∙→is-connected (H .has-is-connected))
Direct-product-concrete G H .has-is-groupoid = ×-is-hlevel 3
  (G .has-is-groupoid)
  (H .has-is-groupoid)

ConcreteGroups-products
  : (X Y : ConcreteGroup )  Product (ConcreteGroups ) X Y
ConcreteGroups-products X Y = prod where
  prod : Product (ConcreteGroups ) X Y
  prod .apex = Direct-product-concrete X Y
  prod .π₁ = fst∙
  prod .π₂ = snd∙
  prod .has-is-product .⟨_,_⟩ f g .fst x = f # x , g # x
  prod .has-is-product .⟨_,_⟩ f g .snd = f .snd ,ₚ g .snd
  prod .has-is-product .π₁∘⟨⟩ = funext∙  _  refl) (∙-idr _)
  prod .has-is-product .π₂∘⟨⟩ = funext∙  _  refl) (∙-idr _)
  prod .has-is-product .unique {Q} {f} {g} {u} p1 p2 =
    funext∙  x  p1 #ₚ x ,ₚ p2 #ₚ x) (fix  square)
    where
      square : Square
        (p1 #ₚ pt Q ,ₚ p2 #ₚ pt Q) ((fst∙ ∘∙ u) .snd ,ₚ (snd∙ ∘∙ u) .snd)
        (f .snd ,ₚ g .snd) refl
      square i = p1 i .snd ,ₚ p2 i .snd

      fix : u .snd  ((fst∙ ∘∙ u) .snd ,ₚ (snd∙ ∘∙ u) .snd)
      fix i = ∙-idr (ap fst (u .snd)) (~ i) ,ₚ ∙-idr (ap snd (u .snd)) (~ i)

Similarly, the terminal concrete group is just the unit type.

Terminal-concrete : ConcreteGroup 
Terminal-concrete .B = Lift _  , _
Terminal-concrete .has-is-connected = is-connected→is-connected∙ (n-connected 2)
Terminal-concrete .has-is-groupoid = hlevel 3