Setoid.Varieties.Reducts¶
Reduct classes of varieties¶
This is the Setoid.Varieties.Reducts module of the Agda Universal Algebra Library.
Like its companion Setoid.Varieties.Invariance, this module lives in the Setoid/
foundation; reducts are in the domain of universal algebra.
Fix two signatures πβ, πβ and a signature morphism Ο : πβ β πβ. The reduct functor
reduct Ο : Alg πβ β Alg πβ (Setoid.Categories.Reduct) turns each πβ-algebra
into an πβ-algebra by remembering only the operations named by Ο.
Given a variety π± of πβ-algebras, this module studies the reduct class
reduct Ο π± = { π© : π© β
reduct Ο π¨ for some π¨ β π± },
a class of πβ-algebras, and asks, "under which of the operators S, H,
P is reduct Ο π± closed?"1
At first glance, we might anticipate that reduct Ο π± is closed under S and P
but not H, which would make it a prevariety.2
Working it through against the library's definitions shows that the truth is different, and sharper, so we record it formally here. (This is research-tracking, where discovering which assertion is the correct one is part of the process.)
Two layers must be distinguished.
-
Functorial preservation (true for
S,P, andH).reduct Οpreserves the subalgebra relation, products, and the homomorphic-image relation between individual algebras. A mono maps to a mono, a product to a product, an epi to an epi. This is what "reduct Οpreserves subobjects and limits" means, and it is exactly the morphism action of the functorreductFread off on the three kinds of homomorphism. All three hold, with one-line proofs, becausereduct Οkeeps the underlying setoid map of a homomorphism unchanged and only reindexes the operation it must respect. -
Class-level closure (true for
Ponly). Whether the classreduct Ο (π±)is closed under an operatorOis the question whether everyO-construction performed on reducts can be reconstructed upstairs β realized as the reduct of anO-construction insideπ±. For products this reconstruction always succeeds (reduct-β¨below): a product of reducts is the reduct of a product, because the dropped operations on a product are computed coordinate-by-coordinate and are therefore always available. For subalgebras and homomorphic images it can fail, because a sub- or quotient-algebra of a reduct generally cannot be re-equipped with the operationsΟforgot.
The upshot: reduct Ο (π±) is closed under P (and isomorphism) but
not, in general, under S or H. It is a product class (model theory calls
reducts of an elementary class pseudo-elementary), and is not a prevariety β
S-closure already fails. A concrete S-counterexample is recorded in the final
section; the failure of H is discussed there too, including the instructive fact
that for the variety of groups H-closure happens to hold, so neither the issue's
"S, P yes, H no" pattern nor its mirror is the general truth: the general truth
is "P always; S and H not in general."
There is a genuine grain of truth behind "prevariety", supplied by reduct-invariance of
satisfaction (β§-reduct): every reduct of a π±-algebra satisfies the Ο-pullback of
π±'s equational theory, so reduct Ο (π±) is contained in a variety of πβ-algebras even
though it need not equal one. That containment is reduct-β§ below.
Reduct preserves homomorphisms¶
Everything rests on one observation: a homomorphism is preserved by reduct Ο on the nose.
Concretely, if h : π¨ βΆ π© is an πβ-homomorphism, the very same underlying setoid map is an
πβ-homomorphism reduct Ο π¨ βΆ reduct Ο π©. The reason is definitional: reduct Ο
interprets an πβ-symbol o as the interpretation in π¨ of ΞΉ Ο o precomposed with the
ΞΊ Ο o-reindex, and h already respects every πβ-operation β in particular ΞΉ Ο o β so it
respects the reindexed one with no extra work. This is the morphism action Fβ of the functor
reductF (Setoid.Categories.Reduct); we restate it directly here because the closure
arguments need it between algebras at different universe levels (subalgebra, isomorphism and
homomorphic-image relations are all level-heterogeneous), whereas reductF is the
single-level packaging.
module _ {πβ πβ : Signature π π₯} (Ο : SigMorphism πβ πβ) where -- the signature's level bump, pinned to the module's `π`/`π₯` (no stray implicits). private ov : Level β Level ov β = π β π₯ β lsuc β reduct-hom : {π¨ : Algebra {π = πβ} Ξ± Ο}{π© : Algebra {π = πβ} Ξ² Οα΅} β hom π¨ π© β hom (reduct Ο π¨) (reduct Ο π©) reduct-hom (h , hhom) = h , mkIsHom (Ξ» {o}{a} β compatible hhom {f = ΞΉ-op Ο o} {a = a β ΞΊ-ar Ο o})
The single-level instance agrees with the functor's morphism map definitionally β they are the
same construction β which we record to make the dependence on reductF explicit.
reduct-homβ‘Fβ : {π¨ π© : Algebra {π = πβ} Ξ± Ο}(h : hom π¨ π©) β reduct-hom h β‘ Functor.Fβ (reductF Ο) h reduct-homβ‘Fβ _ = refl
Reduct preserves subalgebras, isomorphisms, and homomorphic images¶
Each of the three relation-preservations is now immediate. reduct-hom keeps the underlying
map identical, so injectivity, surjectivity and the isomorphism round-trip conditions β all of
which are statements about the underlying map and the (unchanged) codomain setoid β transfer
verbatim. These are the honest content of "reduct Ο preserves S, P and H": it carries
subobjects to subobjects, isomorphisms to isomorphisms, and epis to epis.
-- reduct preserves the subalgebra relation (S, functorially). reduct-β€ : {π¨ : Algebra {π = πβ} Ξ± Ο}{π© : Algebra {π = πβ} Ξ² Οα΅} β π¨ β€ π© β reduct Ο π¨ β€ reduct Ο π© reduct-β€ (h , hinj) = reduct-hom h , hinj -- reduct preserves isomorphism. reduct-β : {π¨ : Algebra {π = πβ} Ξ± Ο}{π© : Algebra {π = πβ} Ξ² Οα΅} β π¨ β π© β reduct Ο π¨ β reduct Ο π© reduct-β Aβ B = mkiso (reduct-hom (to Aβ B)) (reduct-hom (from Aβ B)) (toβΌfrom Aβ B) (fromβΌto Aβ B) -- reduct preserves the homomorphic-image relation (H, functorially). reduct-img : {π¨ : Algebra {π = πβ} Ξ± Ο}{π© : Algebra {π = πβ} Ξ² Οα΅} β π© IsHomImageOf π¨ β reduct Ο π© IsHomImageOf reduct Ο π¨ reduct-img (h , hsur) = reduct-hom h , hsur
Reduct preserves products¶
The product preservation is the one that lifts to a genuine class-level closure, so we state
it as an isomorphism. The reduct of a product and the product of the reducts have the same
carrier (reduct Ο never touches the domain) and interpret each πβ-symbol identically: in
both, the o-operation acts coordinatewise as ΞΉ Ο o of the factors, reindexed by ΞΊ Ο o β
and reindexing commutes with the coordinate projections. So the two algebras are equal on the
nose up to the identity map, and the isomorphism is built from it, with every law holding by the
product setoid's reflexivity.
module _ {I : Type ΞΉ}(π : I β Algebra {π = πβ} Ξ± Ο) where reduct-β¨ : reduct Ο (β¨ π) β β¨ (Ξ» i β reduct Ο (π i)) reduct-β¨ = mkiso ( idmap-to , mkIsHom (Ξ» {o}{a} β Setoid.refl π»[ β¨ R ]) ) ( idmap-from , mkIsHom (Ξ» {o}{a} β Setoid.refl π»[ Rβ¨ ]) ) (Ξ» b β Setoid.refl π»[ β¨ R ]) (Ξ» a β Setoid.refl π»[ Rβ¨ ]) where Rβ¨ : Algebra {π = πβ} (Ξ± β ΞΉ) (Ο β ΞΉ) Rβ¨ = reduct Ο (β¨ π) β¨ R : Algebra {π = πβ} (Ξ± β ΞΉ) (Ο β ΞΉ) β¨ R = β¨ (Ξ» i β reduct Ο (π i)) -- `Rβ¨ ` and `β¨ R` have definitionally equal domains, so the identity map is a -- homomorphism in both directions; its compatibility and the round-trips are refl. idmap-to : Func π»[ Rβ¨ ] π»[ β¨ R ] idmap-to = record { to = Ξ» x β x ; cong = Ξ» xβy β xβy } idmap-from : Func π»[ β¨ R ] π»[ Rβ¨ ] idmap-from = record { to = Ξ» x β x ; cong = Ξ» xβy β xβy }
The reduct image and closure under P¶
The reduct image Reduct[ π² ] of a class π² of πβ-algebras is the class of
πβ-algebras isomorphic to the reduct of some member of π². Closing under
isomorphism (rather than taking the bare set-image) is what makes it a class in the
sense the closure operators expect β S, H, P all produce iso-closed classes β
and it is the only honest notion under setoid semantics, where "the same algebra"
means "isomorphic".
Reduct[_] : Pred (Algebra {π = πβ} Ξ³ ΟαΆ) β β Pred (Algebra {π = πβ} Ξ² Οα΅) (ov (Ξ³ β ΟαΆ) β β β Ξ² β Οα΅) Reduct[ π² ] π© = Ξ£[ π¨ β Algebra _ _ ] (π¨ β π²) β§ (π© β reduct Ο π¨)
Reduct[_] is monotone: a bigger source class has a bigger reduct image.
Reduct-mono : {π² π²' : Pred (Algebra {π = πβ} Ξ³ ΟαΆ) β}{π© : Algebra {π = πβ} Ξ² Οα΅} β π² β π²' β π© β Reduct[ π² ] β π© β Reduct[ π²' ] Reduct-mono π²βπ²' (π¨ , π¨βπ² , π©β r) = π¨ , π²βπ²' π¨βπ² , π©β r
Now the class-level product result. The clean, hypothesis-free statement is that the reduct
image commutes past P: a product of reduct-images is a reduct-image of a product,
P Reduct[ π± ] β Reduct[ P π± ].
The proof assembles the witnessing π±-algebras π from the membership data of the factors,
takes their product β¨
π (a member of P π± by construction), and chains three isomorphisms:
the given π© β
β¨
π, the product of the per-factor isos β¨
π β
β¨
(reduct Ο β π) (β¨
β
), and
the product-preservation β¨
(reduct Ο β π) β
reduct Ο (β¨
π) (reduct-β¨
, reversed).
P-Reduct : {π± : Pred (Algebra {π = πβ} Ξ± Ο) (Ξ± β Ο β ov β)} β P {Ξ± = Ξ±}{Ο}{Ξ±}{Ο} (Ξ± β Ο β β) ΞΉ Reduct[ π± ] β Reduct[ P β ΞΉ π± ] P-Reduct {Ξ± = Ξ±} {Ο} {π± = π±} {π©} ( I , π , πβR , π©β β¨ π ) = β¨ π , (I , π , πβπ± , β -refl) , π©β redβ¨ π where π : I β Algebra {π = πβ} Ξ± Ο π i = projβ (πβR i) πβπ± : β i β π i β π± πβπ± i = projβ (projβ (πβR i)) πβ redπ : β i β π i β reduct Ο (π i) πβ redπ i = projβ (projβ (πβR i)) π©β redβ¨ π : π© β reduct Ο (β¨ π) π©β redβ¨ π = β -trans π©β β¨ π (β -trans (β¨ β πβ redπ) (β -sym (reduct-β¨ π)))
This is the substance of "reduct Ο (π±) is closed under products". The final step β
concluding P (Reduct[ π± ]) β Reduct[ π± ] itself when π± is a variety β combines
P-Reduct with Reduct-mono and the P-closure of π±: P π± β π±; the only
remaining gap is the universe-level bump that products introduce (β¨
π lands one
level up), which the library bridges with Lift-Alg and Level-closure
(Setoid.Varieties.Closure) exactly as it does for the HSP theorem.
We stop at P-Reduct, the level-clean heart of the matter, in keeping with the
bounded, research-tracking scope of this milestone.
Reducts satisfy the pulled-back theory¶
The genuine grain of truth behind "prevariety" is supplied by reduct-invariance of satisfaction
(β§-reduct, Setoid.Varieties.Invariance). For any family β° of πβ-equations, if an
πβ-algebra π¨ satisfies every Ο-translated equation Ο βΆ s β Ο βΆ t, then its reduct
satisfies the original family. In closure-operator terms this says
reduct Ο (Mod (Ο βΆ β°)) β Mod β°,
so the reduct image of a variety is contained in a variety of πβ-algebras (the model class
of the pulled-back theory). That is the precise, true residue of the prevariety intuition: the
reduct class is cut out from a variety by equations β it simply need not be all of that variety,
nor closed under S.
module _ {X : Type Ο}{I : Type ΞΉ} (β° : I β Term {π = πβ} X β§ Term {π = πβ} X) (π¨ : Algebra {π = πβ} Ξ± Ο) where open EqLogic {π = πβ} using () renaming ( _β§_β_ to _β§β_β_ ) open EqLogic {π = πβ} using () renaming ( _β§_β_ to _β§β_β_ ) reduct-β§ : (β i β π¨ β§β (Ο βΆ projβ (β° i)) β Ο βΆ projβ (β° i)) β β i β reduct Ο π¨ β§β projβ (β° i) β projβ (β° i) reduct-β§ Aβ§ i = β§-reduct Ο π¨ {s = projβ (β° i)} {t = projβ (β° i)} (Aβ§ i)
Why S and H fail at the class level¶
It remains to substantiate the claim that reduct Ο π± is not closed under S
(and, in general, not under H), so it is a product class rather than a prevariety.
The asymmetry with P is structural: the functorial preservations above all run
πβ β πβ (reduct of a subalgebra is a subalgebra, etc.), but class-level closure
needs the reverse, πβ β πβ, reconstruction β every
πβ-subalgebra/quotient/product of a reduct must arise as the reduct of an
πβ-subalgebra/quotient/product inside π±.
For products that reconstruction is automatic (reduct-β¨
): the dropped operations on
a product are computed coordinatewise from the factors, so they are always present.
For subalgebras and quotients it can fail, because a sub- or quotient-algebra of a
reduct generally cannot be re-equipped with the operations Ο forgot.
Categorically: reduct Ο is a right adjoint β F β£ reduct Ο β so it preserves
limits, which is why products are the well-behaved case.
Counterexamples¶
-
Let
πβbe the group signature with binaryΒ·, unaryβ»ΒΉ, and nullarye; letπβbe the monoid signature with binaryΒ·and nullarye; letΟ : πβ βͺ πβbe the natural inclusion; thenreduct Οforgetsβ»ΒΉkeepingΒ·ande. Takeπ±to be the variety of groups. Thenreduct Ο π±is the class of monoid reducts of π± β monoids(M , Β·, e)such that(M , Β·, β»ΒΉ, e)forms a group.- The monoid
(β€ , + , 0)is a reduct of the group(β€ , + , - , 0), so(β€ , + , 0) β reduct Ο π±. - As monoids,
(β , + , 0) β€ (β€ , + , 0)ββis closed under+and the inclusion is an injective monoid homomorphism β so(β , + , 0) β S (reduct Ο π±). - But
(β , + , 0)is not a monoid reduct of some group; there is no group whose carrier isβand whose binary operation is+, since any nonzero natural number has no additive inverse inβ, so(β , + , 0) β reduct Ο π±.
This proves that
S (reduct Ο π±) β reduct Ο π±, soreduct Ο π±is not closed underS, and therefore is not a prevariety.Stated against the operator, the false inclusion is
S Reduct[ π± ] β Reduct[ S π± ]; it would require a sub-monoid of a group to be the reduct of a subgroup, whichβ β β€refutes. - The monoid
-
Class-level
H-closure,H Reduct[ π± ] β Reduct[ H π± ], also fails in general, for the same reconstruction reason: the kernel of a surjectiveπβ-homomorphism out of a reduct is anπβ-congruence, but need not be anπβ-congruence, so the quotient need not carry the dropped operations. Notably, for the group example above it happens to hold β every monoid-congruence of a group is a group-congruence (froma ΞΈ bone derivesbβ»ΒΉ ΞΈ aβ»ΒΉby multiplying on both sides), so a monoid-quotient of a group is again a group-monoid.
In short, reduct Ο π± is a product-closed (pseudo-elementary) class, contained in a
variety by reduct-β§, but is not a prevariety.
-
The closure operators
H,S, andPare defined in the Setoid.Varieties.Closure module. ↩ -
This was indeed what GitHub Issue #345 proposed, prompting this exploration of the reduct functor in a submodule of the
Varietiesmodule. ↩