Skip to content

Classical.Small.Structures.Semigroup

Level-fixed Semigroups

This is the Classical.Small.Structures.Semigroup module of the Agda Universal Algebra Library.

This module specializes Classical.Structures.Semigroup to the common case where the universe level of both the carrier and the equivalence is 0โ„“ (i.e., Set-valued carriers with propositional or set-truncated equivalence). The motivation matches the corresponding magma veneer in Classical.Small.Structures.Magma: finite-template CSP, finite cases relevant to FLRP intuition, and tutorial contexts in Examples/ and Demos/ live in this small case, and pulling the level-fixed specialization out keeps the polymorphic core unencumbered.

{-# OPTIONS --cubical-compatible --exact-split --safe #-}

module Classical.Small.Structures.Semigroup where

open import Agda.Primitive using () renaming ( Set to Type )

-- Imports from the Agda Standard Library ----------------------------
open import Level                                  using ( 0โ„“ ; suc )
open import Relation.Binary.PropositionalEquality  using ( _โ‰ก_ )

-- Imports from the Agda Universal Algebra Library ----------------------------
import Classical.Structures.Semigroup as Polymorphic

The Level-fixed Semigroup Type

Semigroup : Type (suc 0โ„“)
Semigroup = Polymorphic.Semigroup 0โ„“ 0โ„“

Small eqsToSemigroup

The polymorphic eqsToSemigroup specializes immediately: with ฮฑ = 0โ„“, it produces a Polymorphic.Semigroup 0โ„“ 0โ„“ from (A : Type 0โ„“), a binary operation, and an associativity proof, which is exactly the level-fixed Semigroup above.

eqsToSemigroup  : (A : Type 0โ„“) (_ยท_ : A โ†’ A โ†’ A)
  โ†’ (โˆ€ a b c โ†’ (a ยท b) ยท c โ‰ก a ยท (b ยท c))
  โ†’ Semigroup
eqsToSemigroup A = Polymorphic.eqsToSemigroup {A = A}