module Cat.Displayed.Morphism {o β o' β'} {β¬ : Precategory o β} (β° : Displayed β¬ o' β') where
open Displayed β° open Cat.Reasoning β¬ open Cat.Displayed.Reasoning β° private variable a b c d : Ob f : Hom a b a' b' c' : Ob[ a ]
Displayed morphismsπ
This module defines the displayed analogs of monomorphisms, epimorphisms, and isomorphisms.
Monosπ
Displayed monomorphisms have the the same left-cancellation properties as their non-displayed counterparts. However, they must be displayed over a monomorphism in the base.
is-monic[_] : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β is-monic f β Hom[ f ] a' b' β Type _ is-monic[_] {a = a} {a' = a'} {f = f} mono f' = β {c c'} {g h : Hom c a} β (g' : Hom[ g ] c' a') (h' : Hom[ h ] c' a') β (p : f β g β‘ f β h) β f' β' g' β‘[ p ] f' β' h' β g' β‘[ mono g h p ] h' is-monic[]-is-prop : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β (mono : is-monic f) β (f' : Hom[ f ] a' b') β is-prop (is-monic[ mono ] f') is-monic[]-is-prop {a' = a'} mono f' mono[] mono[]' i {c' = c'} g' h' p p' = is-setβsquarep (Ξ» i j β Hom[ mono _ _ p j ]-set c' a') refl (mono[] g' h' p p') (mono[]' g' h' p p') refl i record _βͺ[_]_ {a b} (a' : Ob[ a ]) (f : a βͺ b) (b' : Ob[ b ]) : Type (o β β β o' β β') where no-eta-equality field mor' : Hom[ f .mor ] a' b' monic' : is-monic[ f .monic ] mor' open _βͺ[_]_ public
Weak monosπ
When working in a displayed setting, we also have weaker versions of the morphism classes we are familiar with, wherein we can only left/right cancel morphisms that are displayed over the same morphism in the base. We denote these morphisms classes as βweakβ.
is-weak-monic : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β Hom[ f ] a' b' β Type _ is-weak-monic {a = a} {a' = a'} {f = f} f' = β {c c'} {g : Hom c a} β (g' g'' : Hom[ g ] c' a') β f' β' g' β‘ f' β' g'' β g' β‘ g'' is-weak-monic-is-prop : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β (f' : Hom[ f ] a' b') β is-prop (is-weak-monic f') is-weak-monic-is-prop f' mono mono' i g' g'' p = is-propβpathp (Ξ» i β Hom[ _ ]-set _ _ g' g'') (mono g' g'' p) (mono' g' g'' p) i record weak-mono-over {a b} (f : Hom a b) (a' : Ob[ a ]) (b' : Ob[ b ]) : Type (o β β β o' β β') where no-eta-equality field mor' : Hom[ f ] a' b' weak-monic : is-weak-monic mor' open weak-mono-over public
Episπ
Displayed epimorphisms are defined in a similar fashion.
is-epic[_] : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β is-epic f β Hom[ f ] a' b' β Type _ is-epic[_] {b = b} {b' = b'} {f = f} epi f' = β {c} {c'} {g h : Hom b c} β (g' : Hom[ g ] b' c') (h' : Hom[ h ] b' c') β (p : g β f β‘ h β f) β g' β' f' β‘[ p ] h' β' f' β g' β‘[ epi g h p ] h' is-epic[]-is-prop : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β (epi : is-epic f) β (f' : Hom[ f ] a' b') β is-prop (is-epic[ epi ] f') is-epic[]-is-prop {b' = b'} epi f' epi[] epi[]' i {c' = c'} g' h' p p' = is-setβsquarep (Ξ» i j β Hom[ epi _ _ p j ]-set b' c') refl (epi[] g' h' p p') (epi[]' g' h' p p') refl i record _β [_]_ {a b} (a' : Ob[ a ]) (f : a β b) (b' : Ob[ b ]) : Type (o β β β o' β β') where no-eta-equality field mor' : Hom[ f .mor ] a' b' epic' : is-epic[ f .epic ] mor' open _β [_]_ public
Weak episπ
We can define a weaker notion of epis that is dual to the definition of a weak mono.
is-weak-epic : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β Hom[ f ] a' b' β Type _ is-weak-epic {b = b} {b' = b'} {f = f} f' = β {c c'} {g : Hom b c} β (g' g'' : Hom[ g ] b' c') β g' β' f' β‘ g'' β' f' β g' β‘ g'' is-weak-epic-is-prop : β {a' : Ob[ a ]} {b' : Ob[ b ]} {f : Hom a b} β (f' : Hom[ f ] a' b') β is-prop (is-weak-monic f') is-weak-epic-is-prop f' epi epi' i g' g'' p = is-propβpathp (Ξ» i β Hom[ _ ]-set _ _ g' g'') (epi g' g'' p) (epi' g' g'' p) i record weak-epi-over {a b} (f : Hom a b) (a' : Ob[ a ]) (b' : Ob[ b ]) : Type (o β β β o' β β') where no-eta-equality field mor' : Hom[ f ] a' b' weak-epic : is-weak-epic mor' open weak-epi-over public
Sectionsπ
Following the same pattern as before, we define a notion of displayed sections.
_section-of[_]_ : β {x y} {s : Hom y x} {r : Hom x y} β β {x' y'} (s' : Hom[ s ] y' x') β s section-of r β (r' : Hom[ r ] x' y') β Type _ s' section-of[ p ] r' = r' β' s' β‘[ p ] id' record has-section[_] {x y x' y'} {r : Hom x y} (sect : has-section r) (r' : Hom[ r ] x' y') : Type β' where no-eta-equality field section' : Hom[ sect .section ] y' x' is-section' : section' section-of[ sect .is-section ] r' open has-section[_] public
We also distinguish the sections that are displayed over the identity morphism; these are known as βvertical sectionsβ.
_section-ofβ_ : β {x} {x' x'' : Ob[ x ]} (s' : Hom[ id ] x'' x') β (r : Hom[ id ] x' x'') β Type _ s' section-ofβ r' = s' section-of[ idl id ] r' has-sectionβ : β {x} {x' x'' : Ob[ x ]} (r' : Hom[ id ] x' x'') β Type _ has-sectionβ r' = has-section[ id-has-section ] r'
Retractsπ
We can do something similar for retracts.
_retract-of[_]_ : β {x y} {s : Hom y x} {r : Hom x y} β β {x' y'} (r' : Hom[ r ] x' y') β r retract-of s β (s' : Hom[ s ] y' x') β Type _ r' retract-of[ p ] s' = r' β' s' β‘[ p ] id' record has-retract[_] {x y x' y'} {s : Hom x y} (ret : has-retract s) (s' : Hom[ s ] x' y') : Type β' where no-eta-equality field retract' : Hom[ ret .retract ] y' x' is-retract' : retract' retract-of[ ret .is-retract ] s' open has-retract[_] public
We also define vertical retracts in a similar manner as before.
_retract-ofβ_ : β {x} {x' x'' : Ob[ x ]} (r' : Hom[ id ] x' x'') β (s : Hom[ id ] x'' x') β Type _ r' retract-ofβ s' = r' retract-of[ idl id ] s' has-retractβ : β {x} {x' x'' : Ob[ x ]} (s' : Hom[ id ] x'' x') β Type _ has-retractβ s' = has-retract[ id-has-retract ] s'
Isosπ
Displayed isomorphisms must also be defined over isomorphisms in the base.
record Inverses[_] {a b a' b'} {f : Hom a b} {g : Hom b a} (inv : Inverses f g) (f' : Hom[ f ] a' b') (g' : Hom[ g ] b' a') : Type β' where no-eta-equality field invl' : f' β' g' β‘[ Inverses.invl inv ] id' invr' : g' β' f' β‘[ Inverses.invr inv ] id' record is-invertible[_] {a b a' b'} {f : Hom a b} (f-inv : is-invertible f) (f' : Hom[ f ] a' b') : Type β' where no-eta-equality field inv' : Hom[ is-invertible.inv f-inv ] b' a' inverses' : Inverses[ is-invertible.inverses f-inv ] f' inv' open Inverses[_] inverses' public record _β [_]_ {a b} (a' : Ob[ a ]) (i : a β b) (b' : Ob[ b ]) : Type β' where no-eta-equality field to' : Hom[ i .to ] a' b' from' : Hom[ i .from ] b' a' inverses' : Inverses[ i .inverses ] to' from' open Inverses[_] inverses' public open _β [_]_ public
Since isomorphisms over the identity map will be of particular importance, we also define their own type: they are the vertical isomorphisms.
_β β_ : {x : Ob} (A B : Ob[ x ]) β Type β' _β β_ = _β [ id-iso ]_ is-invertibleβ : {x : Ob} {x' x'' : Ob[ x ]} β Hom[ id ] x' x'' β Type _ is-invertibleβ = is-invertible[ id-invertible ] make-invertibleβ : β {x} {x' x'' : Ob[ x ]} {f' : Hom[ id ] x' x''} β (g' : Hom[ id ] x'' x') β f' β' g' β‘[ idl _ ] id' β g' β' f' β‘[ idl _ ] id' β is-invertibleβ f' make-invertibleβ g' p q .is-invertible[_].inv' = g' make-invertibleβ g' p q .is-invertible[_].inverses' .Inverses[_].invl' = p make-invertibleβ g' p q .is-invertible[_].inverses' .Inverses[_].invr' = q
Like their non-displayed counterparts, existence of displayed inverses is a proposition.
Inverses[]-are-prop : β {a b a' b'} {f : Hom a b} {g : Hom b a} β (inv : Inverses f g) β (f' : Hom[ f ] a' b') (g' : Hom[ g ] b' a') β is-prop (Inverses[ inv ] f' g') Inverses[]-are-prop inv f' g' inv[] inv[]' i .Inverses[_].invl' = is-setβsquarep (Ξ» i j β Hom[ Inverses.invl inv j ]-set _ _) refl (Inverses[_].invl' inv[]) (Inverses[_].invl' inv[]') refl i Inverses[]-are-prop inv f' g' inv[] inv[]' i .Inverses[_].invr' = is-setβsquarep (Ξ» i j β Hom[ Inverses.invr inv j ]-set _ _) refl (Inverses[_].invr' inv[]) (Inverses[_].invr' inv[]') refl i is-invertible[]-is-prop : β {a b a' b'} {f : Hom a b} β (f-inv : is-invertible f) β (f' : Hom[ f ] a' b') β is-prop (is-invertible[ f-inv ] f') is-invertible[]-is-prop inv f' p q = path where module inv = is-invertible inv module p = is-invertible[_] p module q = is-invertible[_] q invβ‘inv' : p.inv' β‘ q.inv' invβ‘inv' = p.inv' β‘β¨ shiftr (insertr inv.invl) (insertr' _ q.invl') β©β‘ hom[] ((p.inv' β' f') β' q.inv') β‘β¨ weave _ (eliml inv.invr) refl (eliml' _ p.invr') β©β‘ hom[] q.inv' β‘β¨ liberate _ β©β‘ q.inv' β path : p β‘ q path i .is-invertible[_].inv' = invβ‘inv' i path i .is-invertible[_].inverses' = is-propβpathp (Ξ» i β Inverses[]-are-prop inv.inverses f' (invβ‘inv' i)) p.inverses' q.inverses' i
make-iso[_] : β {a b a' b'} β (iso : a β b) β (f' : Hom[ iso .to ] a' b') (g' : Hom[ iso .from ] b' a') β f' β' g' β‘[ iso .invl ] id' β g' β' f' β‘[ iso .invr ] id' β a' β [ iso ] b' make-iso[ inv ] f' g' p q .to' = f' make-iso[ inv ] f' g' p q .from' = g' make-iso[ inv ] f' g' p q .inverses' .Inverses[_].invl' = p make-iso[ inv ] f' g' p q .inverses' .Inverses[_].invr' = q make-vertical-iso : β {x} {x' x'' : Ob[ x ]} β (f' : Hom[ id ] x' x'') (g' : Hom[ id ] x'' x') β f' β' g' β‘[ idl _ ] id' β g' β' f' β‘[ idl _ ] id' β x' β β x'' make-vertical-iso = make-iso[ id-iso ] invertible[]βiso[] : β {a b a' b'} {f : Hom a b} {f' : Hom[ f ] a' b'} β {i : is-invertible f} β is-invertible[ i ] f' β a' β [ invertibleβiso f i ] b' invertible[]βiso[] {f' = f'} i = make-iso[ _ ] f' (is-invertible[_].inv' i) (is-invertible[_].invl' i) (is-invertible[_].invr' i) β []-path : {x y : Ob} {A : Ob[ x ]} {B : Ob[ y ]} {f : x β y} {p q : A β [ f ] B} β p .to' β‘ q .to' β p β‘ q β []-path {f = f} {p = p} {q = q} a = it where p' : PathP (Ξ» i β is-invertible[ isoβinvertible f ] (a i)) (record { inv' = p .from' ; inverses' = p .inverses' }) (record { inv' = q .from' ; inverses' = q .inverses' }) p' = is-propβpathp (Ξ» i β is-invertible[]-is-prop _ (a i)) _ _ it : p β‘ q it i .to' = a i it i .from' = p' i .is-invertible[_].inv' it i .inverses' = p' i .is-invertible[_].inverses' instance Extensional-β [] : β {βr} {x y : Ob} {x' : Ob[ x ]} {y' : Ob[ y ]} {f : x β y} β β¦ sa : Extensional (Hom[ f .to ] x' y') βr β¦ β Extensional (x' β [ f ] y') βr Extensional-β [] β¦ sa β¦ = injectionβextensional! β []-path sa
As in the non-displayed case, the identity isomorphism is always an iso. In fact, it is a vertical iso!
id-isoβ : β {x} {x' : Ob[ x ]} β x' β β x' id-isoβ = make-iso[ id-iso ] id' id' (idl' id') (idl' id')
Isomorphisms are also instances of sections and retracts.
inverses[]βto-has-section[] : β {f : Hom a b} {g : Hom b a} β β {a' b'} {f' : Hom[ f ] a' b'} {g' : Hom[ g ] b' a'} β {inv : Inverses f g} β Inverses[ inv ] f' g' β has-section[ inversesβto-has-section inv ] f' inverses[]βto-has-section[] {g' = g'} inv' .section' = g' inverses[]βto-has-section[] inv' .is-section' = Inverses[_].invl' inv' inverses[]βfrom-has-section[] : β {f : Hom a b} {g : Hom b a} β β {a' b'} {f' : Hom[ f ] a' b'} {g' : Hom[ g ] b' a'} β {inv : Inverses f g} β Inverses[ inv ] f' g' β has-section[ inversesβfrom-has-section inv ] g' inverses[]βfrom-has-section[] {f' = f'} inv' .section' = f' inverses[]βfrom-has-section[] inv' .is-section' = Inverses[_].invr' inv' inverses[]βto-has-retract[] : β {f : Hom a b} {g : Hom b a} β β {a' b'} {f' : Hom[ f ] a' b'} {g' : Hom[ g ] b' a'} β {inv : Inverses f g} β Inverses[ inv ] f' g' β has-retract[ inversesβto-has-retract inv ] f' inverses[]βto-has-retract[] {g' = g'} inv' .retract' = g' inverses[]βto-has-retract[] inv' .is-retract' = Inverses[_].invr' inv' inverses[]βfrom-has-retract[] : β {f : Hom a b} {g : Hom b a} β β {a' b'} {f' : Hom[ f ] a' b'} {g' : Hom[ g ] b' a'} β {inv : Inverses f g} β Inverses[ inv ] f' g' β has-retract[ inversesβfrom-has-retract inv ] g' inverses[]βfrom-has-retract[] {f' = f'} inv' .retract' = f' inverses[]βfrom-has-retract[] inv' .is-retract' = Inverses[_].invl' inv' iso[]βto-has-section[] : {f : a β b} β (f' : a' β [ f ] b') β has-section[ isoβto-has-section f ] (f' .to') iso[]βto-has-section[] f' .section' = f' .from' iso[]βto-has-section[] f' .is-section' = f' .invl' iso[]βfrom-has-section[] : {f : a β b} β (f' : a' β [ f ] b') β has-section[ isoβfrom-has-section f ] (f' .from') iso[]βfrom-has-section[] f' .section' = f' .to' iso[]βfrom-has-section[] f' .is-section' = f' .invr' iso[]βto-has-retract[] : {f : a β b} β (f' : a' β [ f ] b') β has-retract[ isoβto-has-retract f ] (f' .to') iso[]βto-has-retract[] f' .retract' = f' .from' iso[]βto-has-retract[] f' .is-retract' = f' .invr' iso[]βfrom-has-retract[] : {f : a β b} β (f' : a' β [ f ] b') β has-retract[ isoβfrom-has-retract f ] (f' .from') iso[]βfrom-has-retract[] f' .retract' = f' .to' iso[]βfrom-has-retract[] f' .is-retract' = f' .invl'