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