module Cat.Morphism.Factorisation where

Orthogonal factorisation systemsπŸ”—

Suppose you have some category C\mathcal{C} and you, inspired by the wisdom of King Solomon, want to chop every morphism in half. A factorisation system (E,M)(E, M) on C\mathcal{C} will provide a tool for doing so, in a particularly coherent way. Here, EE and MM are predicates on the space of morphisms of CC. First, we package the data of an (E,M)(E, M)-factorisation of a morphism f:a→bf : a \to b.

Note that while the archetype for a factorisation system is the (epi, mono)-factorisation system on the category of sets1, so that it’s very hard not to refer to these things as images, it is not the case, in general, nothing is required about the interaction of epis and monos with the classes EE and MM. Generically, we call the EE-morphism in the factorisation mediate, and the MM-morphism forget.

  record Factorisation {a b} (f : C.Hom a b) : Type (o βŠ” β„“) where
      mediating : C.Ob
      mediate   : C.Hom a mediating
      forget    : C.Hom mediating b
      mediate∈E : mediate ∈ E
      forget∈M  : forget ∈ M
      factors   : f ≑ forget C.∘ mediate

In addition to mandating that every map f:aβ†’bf : a \to b factors as a map f:aβ†’er(f)β†’mf : a \xrightarrow{e} r(f) \xrightarrow{m} where e∈Ee \in E and m∈Mm \in M, the classes must satisfy the following properties:

  • Every isomorphism is in both EE and in MM.2

  • Both classes are stable under composition: if f∈Ef \in E and g∈Eg \in E, then (g∘f)∈E(g \circ f) \in E and the same for MM

  record is-factorisation-system : Type (o βŠ” β„“) where
      factor : βˆ€ {a b} (f : C.Hom a b) β†’ Factorisation f

      is-isoβ†’in-E : βˆ€ {a b} (f : C.Hom a b) β†’ f β†’ f ∈ E
        : βˆ€ {a b c} (g : C.Hom b c) (f : C.Hom a b) β†’ f ∈ E β†’ g ∈ E
        β†’ (g C.∘ f) ∈ E

      is-isoβ†’in-M : βˆ€ {a b} (f : C.Hom a b) β†’ f β†’ f ∈ M
        : βˆ€ {a b c} (g : C.Hom b c) (f : C.Hom a b) β†’ f ∈ M β†’ g ∈ M
        β†’ (g C.∘ f) ∈ M

Most importantly, the class EE is exactly the class of morphisms left-orthogonal to MM: A map satisfies f∈Ef \in E if, and only if, for every g∈Mg \in M, we have fβŠ₯gf \mathrel{\bot} g. Conversely, a map has g∈Mg \in M if, and only if, we have fβŠ₯gf \mathrel{\bot} g for every f∈Ef \in E.

      EβŠ₯M : βˆ€ {a b c d} (f : C.Hom a b) (g : C.Hom c d) β†’ f ∈ E β†’ g ∈ M
          β†’ mβŠ₯m C f g

The first thing we observe is that factorisations for a morphism are unique. Working in precategorical generality, we weaken this to essential uniqueness: Given two factorisations of ff we exhibit an isomorphism between their replacements r(f)r(f), rβ€²(f)r'(f) which commutes with both the mediate morphism and the forget morphism. We reproduce the proof from (Borceux 1994, vol. 1, sec. 5.5).

    : βˆ€ {a b} (f : C.Hom a b) (fa1 fa2 : Factorisation C E M f)
    β†’ Ξ£[ f ∈ fa1 .mediating C.β‰… fa2 .mediating ]
        ( (f C.∘ fa1 .mediate ≑ fa2 .mediate)
        Γ— (fa1 .forget C.∘ f .C.from ≑ fa2 .forget))
  factorisation-essentially-unique f fa1 fa2 =
    C.make-iso (upq .fst) (vp'q' .fst) vu=id uv=id , upq .snd .fst , vp'q' .snd .snd

Suppose that f=m∘ef = m \circ e and f=mβ€²βˆ˜eβ€²f = m' \circ e' are both (E,M)(E,M)-factorisations of ff. We use the fact that eβŠ₯mβ€²e \mathrel{\bot} m' and eβ€²βŠ₯me' \mathrel{\bot} m to get maps u,vu, v satisfying um=mβ€²um = m', mβ€²u=mm'u = m, ve=eβ€²ve = e', and eβ€²v=ee'v = e.

      module fa1 = Factorisation fa1
      module fa2 = Factorisation fa2

      upq = EβŠ₯M fa1.mediate fa2.forget fa1.mediate∈E fa2.forget∈M
        (sym fa1.factors βˆ™ fa2.factors) .centre

      vp'q' = EβŠ₯M fa2.mediate fa1.forget fa2.mediate∈E fa1.forget∈M
        (sym fa2.factors βˆ™ fa1.factors) .centre

To show that uu and vv are inverses, fit first ee and mm into a lifting diagram like the one below. Since eβŠ₯me \mathrel{\bot} m, we have that the space of diagonals r(f)β†’r(f)r(f) \to r(f) is contractible, hence a proposition, and since both vuvu and the identity are in that diagonal, uv=id⁑uv = \operatorname{id}_{}.

      vu=id : upq .fst C.∘ vp'q' .fst ≑
      vu=id = ap fst $ is-contr→is-prop
        (EβŠ₯M fa2.mediate fa2.forget fa2.mediate∈E fa2.forget∈M refl)
        ( upq .fst C.∘ vp'q' .fst
        , C.pullr (vp'q' .snd .fst) βˆ™ upq .snd .fst
        , C.pulll (upq .snd .snd) βˆ™ vp'q' .snd .snd
        ) ( , C.idl _ , C.idr _)

A dual argument works by making a lifting square with eβ€²e' and mβ€²m' as its faces. We omit it for brevity. By the characterisation of path spaces in categories, this implies that factorisations of a fixed morphism are a proposition.

    : βˆ€ {a b} (f : C.Hom a b) β†’ is-category C β†’ is-prop (Factorisation C E M f)
  factorisation-unique f c-cat x y = go where
    isop1p2 = factorisation-essentially-unique f x y

    p = Univalent.Hom-pathp-reflr-iso c-cat {q = isop1p2 .fst} (isop1p2 .snd .fst)
    q = Univalent.Hom-pathp-refll-iso c-cat {p = isop1p2 .fst} (isop1p2 .snd .snd)

    go : x ≑ y
    go i .mediating = c-cat .to-path (isop1p2 .fst) i
    go i .mediate = p i
    go i .forget = q i

As a passing observation, note that the intersection E∩ME \cap M is precisely the class of isomorphisms of ff. Every isomorphism is in both classes, by the definition, and if a morphism is in both classes, it is orthogonal to itself, hence an isomorphism.

    : βˆ€ {a b} (f : C.Hom a b) β†’ f ∈ E β†’ f ∈ M β†’ f
  in-intersectionβ†’is-iso f f∈E f∈M = self-orthogonalβ†’is-iso C f $ EβŠ₯M f f f∈E f∈M

    : βˆ€ {a b} (f : C.Hom a b) β†’ f ≃ ((f ∈ E) Γ— (f ∈ M))
  in-intersection≃is-iso f = prop-ext (hlevel 1) (Γ—-is-hlevel 1 hlevel! hlevel!)
    (λ fi → is-iso→in-E f fi , is-iso→in-M f fi)
    λ { (a , b) → in-intersection→is-iso f a b }

The final observation is that the class EE is precisely βŠ₯M^\bot M, the class of morphisms left-orthogonal to those in MM. One direction is by definition, and the other is rather technical. Let’s focus on the technical one.

    : βˆ€ {a b} (f : C.Hom a b)
    β†’ (f ∈ E) ≃ (βˆ€ {c d} (m : C.Hom c d) β†’ m ∈ M β†’ mβŠ₯m C f m)
  E-is-βŠ₯M f =
    prop-ext (E f .is-tr) (hlevel 1) (Ξ» m f∈E m∈M β†’ to f∈E m m∈M) from
      to : βˆ€ {c d} (m : C.Hom c d) β†’ f ∈ E β†’ m ∈ M β†’ mβŠ₯m C f m
      to m f∈E m∈M {u} {v} square = EβŠ₯M f m f∈E m∈M square

      from : (βˆ€ {c d} (m : C.Hom c d) β†’ m ∈ M β†’ mβŠ₯m C f m) β†’ f ∈ E
      from ortho = subst (_∈ E) (sym fa.factors) $ E-is-stable _ _ fa.mediate∈E m∈E

Suppose that ff is left-orthogonal to every m∈Mm \in M, and write out the (E,M)(E,M)-factorisation f=m∘ef = m \circ e. By a syntactic limitation in Agda, we start with the conclusion: We’ll show that mm is in EE, and since EE is closed under composition, so is ff. Since ff is orthogonal to mm, we can fit it into a lifting diagram

and make note of the diagonal filler g:Bβ†’r(f)g : B \to r(f), and that it satisfies gf=egf=e and mg=id⁑mg = \operatorname{id}_{}.

        fa = factor f
        module fa = Factorisation fa
        gpq = ortho fa.forget fa.forget∈M {v =} (C.idl _ βˆ™ fa.factors)

We’ll show gm=id⁑gm = \operatorname{id}_{} by fitting it into a lifting diagram. But since eβŠ₯me \mathrel{\bot} m, the factorisation is unique, and gm=id⁑gm = \operatorname{id}_{}, as needed.

        gm=id : gpq .centre .fst C.∘ fa.forget ≑
        gm=id = ap fst $ is-contr→is-prop
          (EβŠ₯M fa.mediate fa.forget fa.mediate∈E fa.forget∈M refl)
          ( _ , C.pullr (sym fa.factors) βˆ™ gpq .centre .snd .fst
          , C.cancell (gpq .centre .snd .snd)) ( , C.idl _ , C.idr _)

Think back to the conclusion we wanted to reach: mm is in EE, so since f=m∘ef = m \circ e and EE is stable, so is ff!

        m∈E : fa.forget ∈ E
        m∈E = is-isoβ†’in-E fa.forget $
          C.make-invertible (gpq .centre .fst) (gpq .centre .snd .snd) gm=id

  1. Or, more generally, in every topos.β†©οΈŽ

  2. We’ll see, in a bit, that the converse is true, too.β†©οΈŽ