Skip to content

Setoid.Varieties.Invariants

Algebraic invariants for setoid algebras

This is the Setoid.Varieties.Invariants module of the Agda Universal Algebra Library.

A property P of (setoid) algebras is called an algebraic invariant when it is stable under isomorphism: whenever ๐‘จ โ‰… ๐‘ฉ, the proposition P ๐‘จ implies P ๐‘ฉ. Equivalently, an algebraic invariant is a predicate that factors through the isomorphism-type of ๐‘จ โ€” a property of the algebra qua structure, independent of its concrete carrier. The notion is the foundational guard rail of universal algebra: the structurally meaningful properties of an algebra (satisfying an identity, being subdirectly irreducible, generating a given variety, being free over a set of generators, and so on) are all algebraic invariants, and a property that fails to be invariant is, almost by definition, not a property of the algebra but of one particular presentation of it.

The canonical example available in this library is the modelling relation ๐‘จ โŠง (p โ‰ˆฬ‡ q). Its algebraic invariance is the content of Setoid.Varieties.Properties.โŠง-I-invar, which states precisely that ฮป ๐‘จ โ†’ ๐‘จ โŠง (p โ‰ˆฬ‡ q) satisfies the AlgebraicInvariant predicate defined below. More generally, each closure operator H, S, P, V of the variety theory is built from operations that respect _โ‰…_, so class membership _โˆˆ H ๐’ฆ, _โˆˆ S ๐’ฆ, _โˆˆ P ๐’ฆ, and _โˆˆ V ๐’ฆ is itself an algebraic invariant.

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

open import Overture using ( ๐“ž ; ๐“ฅ ; Signature )

module Setoid.Varieties.Invariants {๐‘† : Signature ๐“ž ๐“ฅ} where

-- Imports from Agda and the Agda Standard Library --------------------------------
open import Agda.Primitive  using () renaming ( Set to Type )
open import Level           using ( Level )
open import Relation.Unary  using ( Pred )

-- Imports from the Agda Universal Algebra Library -------------------------------
open import Setoid.Algebras       {๐‘† = ๐‘†}  using ( Algebra )
open import Setoid.Homomorphisms  {๐‘† = ๐‘†}  using ( _โ‰…_ )

private variable ฮฑ ฯแตƒ โ„“ : Level

A predicate P : Pred (Algebra ฮฑ ฯแตƒ) โ„“ is an algebraic invariant when, given any two algebras ๐‘จ and ๐‘ฉ at the same universe levels and an isomorphism ๐‘จ โ‰… ๐‘ฉ, the property P ๐‘จ entails P ๐‘ฉ. The same-level restriction is forced by Agda's Pred type and matches the legacy Base.Varieties.Invariants definition; a level-heterogeneous variant could be obtained by parametrizing over a level-indexed family of predicates, but no current consumer requires it.

AlgebraicInvariant : Pred (Algebra ฮฑ ฯแตƒ) โ„“ โ†’ Type _
AlgebraicInvariant P = โˆ€ ๐‘จ ๐‘ฉ โ†’ P ๐‘จ โ†’ ๐‘จ โ‰… ๐‘ฉ โ†’ P ๐‘ฉ