---
layout: default
file: "src/Setoid/Categories/FullSubcategory.lagda.md"
title: "Setoid.Categories.FullSubcategory module"
date: "2026-06-10"
author: "the agda-algebras development team"
---
### Full subcategories on an object predicate
This is the [Setoid.Categories.FullSubcategory][] module of the [Agda Universal Algebra Library][].
`FullSubcategory π P` is the full subcategory of `π` whose objects are the inhabitants of
`Ξ£ (Obj π) P` β an object of `π` together with evidence that it satisfies `P` β and
whose morphisms, hom-equality, identity, composition, and laws are inherited from `π`
unchanged. This is exactly the shape of the theory-satisfying classical structures
(`Semigroup Ξ± Ο = Ξ£[ π¨ β Algebra Ξ± Ο ] π¨ β¨ Th-Semigroup`, and likewise `Monoid`,
`Group`, β¦); each is a full subcategory of the algebra category
[`Alg`][Setoid.Categories.Algebra] of its signature, because a homomorphism between
theory-satisfying algebras is just a homomorphism of the underlying algebras β
satisfaction is a *property* of the objects, not structure on the morphisms.
`FullSubcategoryF` restricts a functor along such predicates; given `F : π βΆ π` and a
`transfer` of evidence `P A β Q (Fβ A)`, the functor maps the full subcategory on `P`
to the one on `Q`, acting as `F` on morphisms. The functor laws are inherited
verbatim, since the hom-equalities are.
<!--
```agda
{-# OPTIONS --cubical-compatible --exact-split --safe #-}
module Setoid.Categories.FullSubcategory where
open import Agda.Primitive using ( _β_ ) renaming ( Set to Type )
open import Data.Product using ( Ξ£ ; _,_ ; projβ ; projβ )
open import Level using ( Level )
open import Setoid.Categories.Category using ( Category )
open import Setoid.Categories.Functor using ( Functor )
private variable o β e oβ² ββ² eβ² p q : Level
```
-->
#### The full subcategory
```agda
module _ (π : Category o β e) where
open Category π
FullSubcategory : (P : Obj β Type p) β Category (o β p) β e
FullSubcategory P = record
{ Obj = Ξ£ Obj P
; Hom = Ξ» (A B : Ξ£ Obj P) β Hom (projβ A) (projβ B)
; _β_ = _β_
; id = id
; _β_ = _β_
; β-equiv = β-equiv
; assoc = assoc
; identityΛ‘ = identityΛ‘
; identityΚ³ = identityΚ³
; β-resp-β = β-resp-β
}
```
#### Restricting a functor to a full subcategory
```agda
open Category using (Obj)
module _
{π : Category o β e} {π : Category oβ² ββ² eβ²}
{P : Obj π β Type p} {Q : Obj π β Type q}
(F : Functor π π)
where
open Functor F
FullSubcategoryF :
(transfer : {A : Obj π} β P A β Q (Fβ A))
β Functor (FullSubcategory π P) (FullSubcategory π Q)
FullSubcategoryF transfer =
record { Fβ = Ξ» A β ( Fβ (projβ A) , transfer (projβ A) )
; Fβ = Fβ
; F-resp-β = F-resp-β
; identity = identity
; homomorphism = homomorphism
}
```