module Cat.Diagram.Equaliser whereEqualisers🔗
The equaliser of two maps when it exists, represents the largest subobject of where and agree. In this sense, the equaliser is the categorical generalisation of a solution set: The solution set of an equation in one variable is largest subset of the domain (i.e. what the variable ranges over) where the left- and right-hand-sides agree.
record is-equaliser {E} (f g : Hom A B) (equ : Hom E A) : Type (o ⊔ ℓ) where
field
equal : f ∘ equ ≡ g ∘ equ
universal : ∀ {F} {e' : Hom F A} (p : f ∘ e' ≡ g ∘ e') → Hom F E
factors : ∀ {F} {e' : Hom F A} {p : f ∘ e' ≡ g ∘ e'} → equ ∘ universal p ≡ e'
unique
: ∀ {F} {e' : Hom F A} {p : f ∘ e' ≡ g ∘ e'} {other : Hom F E}
→ equ ∘ other ≡ e'
→ other ≡ universal p
equal-∘ : f ∘ equ ∘ h ≡ g ∘ equ ∘ h
equal-∘ {h = h} =
f ∘ equ ∘ h ≡⟨ extendl equal ⟩
g ∘ equ ∘ h ∎
uniqueâ‚‚
: ∀ {F} {e' : Hom F A} {o1 o2 : Hom F E}
→ f ∘ e' ≡ g ∘ e'
→ equ ∘ o1 ≡ e'
→ equ ∘ o2 ≡ e'
→ o1 ≡ o2
unique₂ p q r = unique {p = p} q ∙ sym (unique r)We can visualise the situation using the commutative diagram below:
There is also a convenient bundling of an equalising arrow together with its domain:
record Equaliser (f g : Hom A B) : Type (o ⊔ ℓ) where
field
{apex} : Ob
equ : Hom apex A
has-is-eq : is-equaliser f g equ
open is-equaliser has-is-eq publicEqualisers are monic🔗
As a small initial application, we prove that equaliser arrows are always monic:
is-equaliser→is-monic
: ∀ {E} (equ : Hom E A)
→ is-equaliser C f g equ
→ is-monic equ
is-equaliser→is-monic equ equalises g h p =
uniqueâ‚‚ (extendl equal) p refl
where open is-equaliser equalisesUniqueness🔗
As universal constructions, equalisers are unique up to isomorphism. The proof follows the usual pattern: if both equalise then we can construct maps between and via the universal property of equalisers, and uniqueness ensures that these maps form an isomorphism.
is-equaliser→iso
: {E E' : Ob}
→ {e : Hom E A} {e' : Hom E' A}
→ is-equaliser C f g e
→ is-equaliser C f g e'
→ E ≅ E'
is-equaliser→iso {e = e} {e' = e'} eq eq' =
make-iso (eq' .universal (eq .equal)) (eq .universal (eq' .equal))
(unique₂ eq' (eq' .equal) (pulll (eq' .factors) ∙ eq .factors) (idr _))
(unique₂ eq (eq .equal) (pulll (eq .factors) ∙ eq' .factors) (idr _))
where open is-equaliserProperties of equalisers🔗
The equaliser of the pair always exists, and is given by the identity map
id-is-equaliser : is-equaliser C f f id
id-is-equaliser .is-equaliser.equal = refl
id-is-equaliser .is-equaliser.universal {e' = e'} _ = e'
id-is-equaliser .is-equaliser.factors = idl _
id-is-equaliser .is-equaliser.unique p = sym (idl _) ∙ pIf is an equaliser and an epimorphism, then is an iso.
equaliser+epi→invertible
: ∀ {E} {e : Hom E A}
→ is-equaliser C f g e
→ is-epic e
→ is-invertible eSuppose that equalises some pair By definition, this means that however, is an epi, so This in turn means that can be extended into a map via the universal property of and universality ensures that this extension is an isomorphism!
equaliser+epi→invertible {f = f} {g = g} {e = e} e-equaliser e-epi =
make-invertible
(universal {e' = id} (ap₂ _∘_ f≡g refl))
factors
(unique₂ (ap₂ _∘_ f≡g refl) (pulll factors) id-comm)
where
open is-equaliser e-equaliser
f≡g : f ≡ g
f≡g = e-epi f g equalCategories with all equalisers🔗
We also define a helper module for working with categories that have equalisers of all parallel pairs of morphisms.
record Equalisers {o ℓ} (C : Precategory o ℓ) : Type (o ⊔ ℓ) where
no-eta-equality
open Cat.Reasoning C
field
Equ : ∀ {X Y} → Hom X Y → Hom X Y → Ob
equ : ∀ {X Y} → (f g : Hom X Y) → Hom (Equ f g) X
equal : ∀ {X Y} {f g : Hom X Y} → f ∘ equ f g ≡ g ∘ equ f g
equalise
: ∀ {E X Y} {f g : Hom X Y}
→ (e : Hom E X)
→ f ∘ e ≡ g ∘ e
→ Hom E (Equ f g)
equ∘equalise
: ∀ {E X Y} {f g : Hom X Y}
→ {e : Hom E X} {p : f ∘ e ≡ g ∘ e}
→ equ f g ∘ equalise e p ≡ e
equalise-unique
: ∀ {E X Y} {f g : Hom X Y}
→ {e : Hom E X} {p : f ∘ e ≡ g ∘ e}
→ {other : Hom E (Equ f g)}
→ equ f g ∘ other ≡ e
→ other ≡ equalise e p