Setoid.Algebras.Reduct¶
Signature reducts along a signature morphism¶
This is the Setoid.Algebras.Reduct module of the Agda Universal Algebra Library.
A reduct of an πβ-algebra π¨ along a signature morphism Ο : πβ β πβ is the
πβ-algebra with the same carrier whose operations are those of π¨ named by Ο,
interpreted exactly as in π¨. Reduct is a construction of general universal algebra β
it acts on algebras over arbitrary signatures along an arbitrary signature morphism β so
its home is the Setoid/ foundation, relocated here from Classical/ by
ADR-006 (M4-16; see the Amendment).
Its principal consumers, however, are classical: it is the first non-projβ forgetful
projection in the structure hierarchy (per
ADR-002 v2 Β§5); monoidβsemigroup and
groupβmonoid are reducts (composed with an equation-reindex), whereas semigroupβmagma,
commutativeMonoidβmonoid, and abelianGroupβgroup are projβ.
We take the container-morphism form rather than an arity-equation form. A signature
inclusion is a SigMorphism (ΞΉ , ΞΊ): ΞΉ maps operation
symbols of πβ to symbols of πβ (covariantly), and ΞΊ maps the arity of ΞΉ o back to
the arity of o (contravariantly). This induces the polynomial-functor natural
transformation P_{πβ} βΉ P_{πβ}, and reduct Ο precomposes the πβ-structure map with
it. Two payoffs over an ArityOf πβ o β‘ ArityOf πβ (ΞΉ o) formulation:
1. the interpretation is plain function composition args β ΞΊ Ο o with no subst,
keeping proof terms transport-free (and the Cubical port mechanical);
2. for an arity-preserving inclusion ΞΊ Ο o is id, so the reduct preserves each
retained symbol's interpretation definitionally, which is what discharges the
downstream theory-reindex obligation cheaply.
The container morphism is packaged as follows: reduct consumes a SigMorphism,
with reductBy retaining the two-argument form as a thin wrapper. Packaging
makes reduct a (contravariant) functor β reduct-id and reduct-β below state
identity- and composition-preservation, both holding by refl.
The reduct of an algebra along a signature morphism¶
reduct Ο π¨ is the πβ-algebra obtained from the πβ-algebra π¨ by the signature
morphism Ο : SigMorphism πβ πβ. The domain is unchanged; the interpretation of a symbol
o of πβ is the interpretation of ΞΉ Ο o in π¨, with arguments reindexed through
ΞΊ Ο o. Both signatures are passed implicitly at the use site, recovered from the type of
Ο.
reduct : SigMorphism πβ πβ β Algebra {π = πβ} Ξ± Ο β Algebra {π = πβ} Ξ± Ο reduct Ο π¨ .Algebra.Domain = Algebra.Domain π¨ reduct Ο π¨ .Algebra.Interp β¨$β© (o , args) = (ΞΉ Ο o ^ π¨) (args β ΞΊ Ο o) reduct Ο π¨ .Algebra.Interp .cong {o , u} {.o , u'} (refl , uβv) = cong (Algebra.Interp π¨) (refl , Ξ» i β uβv (ΞΊ Ο o i))
The two-argument form is retained as a thin wrapper, so a call site that already holds ΞΉ
and ΞΊ separately need not assemble the record by hand.
reductBy : {πβ πβ : Signature π π₯} (ΞΉ : OperationSymbolsOf πβ β OperationSymbolsOf πβ) (ΞΊ : (o : OperationSymbolsOf πβ) β ArityOf πβ (ΞΉ o) β ArityOf πβ o) β Algebra {π = πβ} Ξ± Ο β Algebra {π = πβ} Ξ± Ο reductBy = reduct ββ mkSigMorphism
Functoriality¶
reduct is functorial in the signature morphism, contravariantly: it preserves the identity
and turns a composite into the reversed composite of reducts. Following the strict-first
discipline, each law is stated at the level of an operation's interpretation function
(o ^ reduct β¦ β‘ o ^ β¦, with no argument tuple applied) and holds by refl; the conventional
args-applied functoriality statement is the corollary directly below each (also refl β it
is the strict law specialized to an argument tuple). This is the strongest equality --safe
affords short of equating the algebras themselves, which would need funext for the
Interp.cong field.
reduct-id : {π¨ : Algebra {π = π} Ξ± Ο} {o : OperationSymbolsOf π} β o ^ reduct id-morphism π¨ β‘ o ^ π¨ reduct-id = refl reduct-id-ptw : {π¨ : Algebra {π = π} Ξ± Ο} {o : OperationSymbolsOf π} (args : ArityOf π o β π[ π¨ ]) β (o ^ reduct id-morphism π¨) args β‘ (o ^ π¨) args reduct-id-ptw _ = refl reduct-β : {πβ πβ πβ : Signature π π₯} {Ο : SigMorphism πβ πβ} {Ο : SigMorphism πβ πβ} {π¨ : Algebra {π = πβ} Ξ± Ο} {o : OperationSymbolsOf πβ} β o ^ reduct (Ο ββ Ο) π¨ β‘ o ^ reduct Ο (reduct Ο π¨) reduct-β = refl reduct-β-ptw : {πβ πβ πβ : Signature π π₯} {Ο : SigMorphism πβ πβ} {Ο : SigMorphism πβ πβ} {π¨ : Algebra {π = πβ} Ξ± Ο} {o : OperationSymbolsOf πβ} (args : ArityOf πβ o β π[ π¨ ]) β (o ^ reduct (Ο ββ Ο) π¨) args β‘ (o ^ reduct Ο (reduct Ο π¨)) args reduct-β-ptw _ = refl