---
layout: default
title : "Legacy.Base.Structures.Basic module (Agda Universal Algebra Library)"
date : "2021-05-20"
author: "agda-algebras development team"
---
### <a id="basic-definitions">Basic Definitions</a>
This is the [Legacy.Base.Structures.Basic][] module of the [Agda Universal Algebra Library][]. It is a submodule of the Structures module which presents general (relational-algebraic) structures as inhabitants of record types. For a similar development using Sigma types see the Base.Structures.Sigma.Basic module.
```agda
{-# OPTIONS --cubical-compatible --exact-split --safe #-}
module Legacy.Base.Structures.Basic where
open import Agda.Primitive using () renaming ( Set to Type )
open import Function.Base using ( flip ; _β_ )
open import Level using ( _β_ ; suc ; Level )
open import Relation.Binary.Core using () renaming ( Rel to BinRel )
open import Overture using ( Op )
open import Legacy.Base.Relations using ( _|:_ ; _preserves_ ; Rel )
private variable πβ π₯β πβ π₯β : Level
record signature (π π₯ : Level) : Type (suc (π β π₯)) where
field
symbol : Type π
arity : symbol β Type π₯
siglΛ‘ : {π π₯ : Level} β signature π π₯ β Level
siglΛ‘ {π}{π₯} _ = π
siglΚ³ : {π π₯ : Level} β signature π π₯ β Level
siglΚ³ {π}{π₯} _ = π₯
sigl : {π π₯ : Level} β signature π π₯ β Level
sigl {π}{π₯} _ = π β π₯
open signature public
record structure (πΉ : signature πβ π₯β)
(π
: signature πβ π₯β)
{Ξ± Ο : Level} : Type (πβ β π₯β β πβ β π₯β β (suc (Ξ± β Ο)))
where
field
carrier : Type Ξ±
op : β(f : symbol πΉ) β Op (arity πΉ f) carrier
rel : β(r : symbol π
) β Rel carrier (arity π
r) {Ο}
π : Type Ξ±
π = carrier
open structure public
module _ {πΉ : signature πβ π₯β}{π
: signature πβ π₯β} where
_Κ³_ : β{Ξ± Ο} β (r : symbol π
)(π : structure πΉ π
{Ξ±}{Ο})
β Rel (carrier π) ((arity π
) r) {Ο}
_Κ³_ = flip rel
_α΅_ : β{Ξ± Ο} β (f : symbol πΉ)(π : structure πΉ π
{Ξ±}{Ο})
β Op ((arity πΉ) f) (carrier π)
_α΅_ = flip op
compatible : β{Ξ± Ο β} β (π¨ : structure πΉ π
{Ξ±}{Ο})
β BinRel (carrier π¨) β β Type _
compatible π¨ r = β (f : symbol πΉ) β (f α΅ π¨) |: r
open Level
Lift-op : β{ΞΉ Ξ±} β {I : Type ΞΉ}{A : Type Ξ±}
β Op I A β {β : Level} β Op I (Lift β A)
Lift-op f = Ξ» z β lift (f (lower β z))
Lift-rel : β{ΞΉ Ξ± Ο} β {I : Type ΞΉ}{A : Type Ξ±}
β Rel A I {Ο} β {β : Level} β Rel (Lift β A) I{Ο}
Lift-rel r x = r (lower β x)
Lift-StrucΛ‘ : β{Ξ± Ο} β (β : Level)
β structure πΉ π
{Ξ±}{Ο} β structure πΉ π
{Ξ± β β}{Ο}
Lift-StrucΛ‘ β π¨ = record { carrier = Lift β (carrier π¨)
; op = Ξ» f β Lift-op (f α΅ π¨)
; rel = Ξ» R β Lift-rel (R Κ³ π¨)
}
Lift-StrucΚ³ : β{Ξ± Ο} β (β : Level)
β structure πΉ π
{Ξ±}{Ο} β structure πΉ π
{Ξ±}{Ο β β}
Lift-StrucΚ³ β π¨ = record { carrier = carrier π¨ ; op = op π¨ ; rel = lrel }
where
lrel : (r : symbol π
) β Rel (carrier π¨) ((arity π
) r)
lrel r = Lift β β r Κ³ π¨
Lift-Struc : β{Ξ± Ο} β (βΛ‘ βΚ³ : Level)
β structure πΉ π
{Ξ±}{Ο} β structure πΉ π
{Ξ± β βΛ‘}{Ο β βΚ³}
Lift-Struc βΛ‘ βΚ³ π¨ = Lift-StrucΚ³ βΚ³ (Lift-StrucΛ‘ βΛ‘ π¨)
```