|
| 1 | +```agda |
| 2 | +open import Cat.Prelude |
| 3 | +
|
| 4 | +module Cat.Diagram.Coequaliser.Split {o ℓ} (C : Precategory o ℓ) where |
| 5 | +open import Cat.Diagram.Coequaliser C |
| 6 | +``` |
| 7 | + |
| 8 | +<!-- |
| 9 | +```agda |
| 10 | +open import Cat.Reasoning C |
| 11 | +private variable |
| 12 | + A B E : Ob |
| 13 | + f g h e s t : Hom A B |
| 14 | +``` |
| 15 | +--> |
| 16 | + |
| 17 | +# Split Coequalizers |
| 18 | + |
| 19 | +Split Coequalizers are one of those definitions that seem utterly opaque when first |
| 20 | +presented, but are actually quite natural when viewed through the correct lens. |
| 21 | +With this in mind, we are going to provide the motivation _first_, and then |
| 22 | +define the general construct. |
| 23 | + |
| 24 | +To start, let $R \subseteq B \times B$ be some equivalence relation. A natural thing |
| 25 | +to consider is the quotient $B/R$, which gives us the following diagram: |
| 26 | +~~~{.quiver} |
| 27 | +\[\begin{tikzcd} |
| 28 | + R & {B \times B} & B & {B/R} |
| 29 | + \arrow[hook, from=1-1, to=1-2] |
| 30 | + \arrow["{p_1}", shift left=2, from=1-2, to=1-3] |
| 31 | + \arrow["{p_2}"', shift right=2, from=1-2, to=1-3] |
| 32 | + \arrow["q", from=1-3, to=1-4] |
| 33 | +\end{tikzcd}\] |
| 34 | +~~~ |
| 35 | + |
| 36 | +Now, when one has a quotient, it's useful to have a means of picking representatives |
| 37 | +for each equivalence class. This is essentially what normalization algorithms do, |
| 38 | +which we can both agree are very useful indeed. This ends up defining a map |
| 39 | +$s : B/R \to B$ that is a section of $q$ (IE: $q \circ s = id$). |
| 40 | + |
| 41 | +This gives us the following diagram (We've omited the injection of $R$ into |
| 42 | +$B \times B$ for clarity). |
| 43 | +~~~{.quiver} |
| 44 | +\[\begin{tikzcd} |
| 45 | + R & B & {B/R} |
| 46 | + \arrow["q", shift left=2, from=1-2, to=1-3] |
| 47 | + \arrow["s", shift left=2, from=1-3, to=1-2] |
| 48 | + \arrow["{p_1}", shift left=2, from=1-1, to=1-2] |
| 49 | + \arrow["{p_2}"', shift right=2, from=1-1, to=1-2] |
| 50 | +\end{tikzcd}\] |
| 51 | +~~~ |
| 52 | + |
| 53 | +This lets us define yet another map $r : B \to R$, which will witness the fact that |
| 54 | +any $b : B$ is related to it's representative $s(q(b))$. We can define this map explicitly |
| 55 | +as so: |
| 56 | +$$ |
| 57 | + r(b) = (b, s(q(b))) |
| 58 | +$$ |
| 59 | + |
| 60 | +Now, how do we encode this diagramatically? To start, $p_1 \circ r = id$ by the |
| 61 | +$\beta$ law for products. Furthermore, $p_2 \circ r = s \circ q$, also by the |
| 62 | +$\beta$ law for products. This gives us a diagram that captures the essence of having |
| 63 | +a quotient by an equivalence relation, along with a means of picking representatives. |
| 64 | + |
| 65 | +~~~{.quiver} |
| 66 | +\[\begin{tikzcd} |
| 67 | + R & B & {B/R} |
| 68 | + \arrow["q", shift left=2, from=1-2, to=1-3] |
| 69 | + \arrow["s", shift left=2, from=1-3, to=1-2] |
| 70 | + \arrow["{p_1}", shift left=5, from=1-1, to=1-2] |
| 71 | + \arrow["{p_2}"', shift right=5, from=1-1, to=1-2] |
| 72 | + \arrow["r"', from=1-2, to=1-1] |
| 73 | +\end{tikzcd}\] |
| 74 | +~~~ |
| 75 | + |
| 76 | +Such a situation is called a *Split Coequaliser*. |
| 77 | + |
| 78 | +```agda |
| 79 | +record is-split-coequaliser (f g : Hom A B) (e : Hom B E) |
| 80 | + (s : Hom E B) (t : Hom B A) : Type (o ⊔ ℓ) where |
| 81 | + field |
| 82 | + coequal : e ∘ f ≡ e ∘ g |
| 83 | + rep-section : e ∘ s ≡ id |
| 84 | + witness-section : f ∘ t ≡ id |
| 85 | + commute : s ∘ e ≡ g ∘ t |
| 86 | +``` |
| 87 | + |
| 88 | +Now, let's show that this thing actually deserves the name Coequaliser. ```agda |
| 89 | +is-split-coequaliser→is-coequalizer : |
| 90 | + is-split-coequaliser f g e s t → is-coequaliser f g e |
| 91 | +is-split-coequaliser→is-coequalizer |
| 92 | + {f = f} {g = g} {e = e} {s = s} {t = t} split-coeq = |
| 93 | + coequalizes |
| 94 | + where |
| 95 | + open is-split-coequaliser split-coeq |
| 96 | +``` |
| 97 | +
|
| 98 | +The proof here is mostly a diagram shuffle. We construct the universal |
| 99 | +map by going back along $s$, and then following $e'$ to our destination, |
| 100 | +like so: |
| 101 | +
|
| 102 | +~~~{.quiver} |
| 103 | +\[\begin{tikzcd} |
| 104 | + A && B && E \\ |
| 105 | + \\ |
| 106 | + &&&& X |
| 107 | + \arrow["q", shift left=2, from=1-3, to=1-5] |
| 108 | + \arrow["s", shift left=2, from=1-5, to=1-3] |
| 109 | + \arrow["{p_1}", shift left=5, from=1-1, to=1-3] |
| 110 | + \arrow["{p_2}"', shift right=5, from=1-1, to=1-3] |
| 111 | + \arrow["r"', from=1-3, to=1-1] |
| 112 | + \arrow["{e'}", from=1-3, to=3-5] |
| 113 | + \arrow["{e' \circ s}", color={rgb,255:red,214;green,92;blue,92}, from=1-5, to=3-5] |
| 114 | +\end{tikzcd}\] |
| 115 | +~~~ |
| 116 | +
|
| 117 | +```agda |
| 118 | + coequalizes : is-coequaliser f g e |
| 119 | + coequalizes .is-coequaliser.coequal = coequal |
| 120 | + coequalizes .is-coequaliser.coequalise {e′ = e′} _ = e′ ∘ s |
| 121 | + coequalizes .is-coequaliser.universal {e′ = e′} {p = p} = |
| 122 | + (e′ ∘ s) ∘ e ≡⟨ extendr commute ⟩ |
| 123 | + (e′ ∘ g) ∘ t ≡˘⟨ p ⟩∘⟨refl ⟩ |
| 124 | + (e′ ∘ f) ∘ t ≡⟨ cancelr witness-section ⟩ |
| 125 | + e′ ∎ |
| 126 | + coequalizes .is-coequaliser.unique {e′ = e′} {p} {colim′} q = |
| 127 | + colim′ ≡⟨ intror rep-section ⟩ |
| 128 | + colim′ ∘ e ∘ s ≡⟨ pulll (sym q) ⟩ |
| 129 | + e′ ∘ s ∎ |
| 130 | +``` |
| 131 | + |
| 132 | +Intuitively, we can think of this as constructing a map out of the quotient $B/R$ |
| 133 | +from a map out of $B$ by picking a representative, and then applying the map out |
| 134 | +of $B$. Universality follows by the fact that the representative is related to |
| 135 | +the original element of $B$, and uniqueness by the fact that $s$ is a section. |
| 136 | + |
| 137 | +```agda |
| 138 | +record Split-coequaliser (f g : Hom A B) : Type (o ⊔ ℓ) where |
| 139 | + field |
| 140 | + {coapex} : Ob |
| 141 | + coeq : Hom B coapex |
| 142 | + rep : Hom coapex B |
| 143 | + witness : Hom B A |
| 144 | + has-is-split-coeq : is-split-coequaliser f g coeq rep witness |
| 145 | +
|
| 146 | + open is-split-coequaliser has-is-split-coeq public |
| 147 | +``` |
| 148 | + |
| 149 | +## Split coequalizers and split epimorphisms |
| 150 | + |
| 151 | +Much like the situation with coequalizers, the coequalizing map of a |
| 152 | +split coequalizer is a split epimorphism. This follows directly from the fact |
| 153 | +that $s$ is a section of $e$. |
| 154 | + |
| 155 | +```agda |
| 156 | +is-split-coequaliser→is-split-epic |
| 157 | + : is-split-coequaliser f g e s t → is-split-epic e |
| 158 | +is-split-coequaliser→is-split-epic {e = e} {s = s} split-coeq = |
| 159 | + split-epic |
| 160 | + where |
| 161 | + open is-split-epic |
| 162 | + open is-split-coequaliser split-coeq |
| 163 | +
|
| 164 | + split-epic : is-split-epic e |
| 165 | + split-epic .split = s |
| 166 | + split-epic .section = rep-section |
| 167 | +``` |
| 168 | + |
| 169 | +Also of note, if $e$ is a split epimorphism with splitting $s$, then |
| 170 | +the following diagram is a split coequalizer. |
| 171 | +~~~{.quiver} |
| 172 | +\[\begin{tikzcd} |
| 173 | + A & A & B |
| 174 | + \arrow["id", shift left=3, from=1-1, to=1-2] |
| 175 | + \arrow["{s \circ e}"', shift right=3, from=1-1, to=1-2] |
| 176 | + \arrow["id"{description}, from=1-2, to=1-1] |
| 177 | + \arrow["e", shift left=1, from=1-2, to=1-3] |
| 178 | + \arrow["s", shift left=2, from=1-3, to=1-2] |
| 179 | +\end{tikzcd}\] |
| 180 | +~~~ |
| 181 | + |
| 182 | +Using the intuition that split coequalizers are quotients of equivalence relations |
| 183 | +equipped with a choice of representatives, we can decode this diagram as constructing |
| 184 | +an equivalence relation on $A$ out of a section of $e$, where $a ~ b$ if and only |
| 185 | +if they get taken to the same cross section of $A$ via $s \circ e$. |
| 186 | + |
| 187 | +```agda |
| 188 | +is-split-epic→is-split-coequalizer |
| 189 | + : s is-section-of e → is-split-coequaliser id (s ∘ e) e s id |
| 190 | +is-split-epic→is-split-coequalizer {s = s} {e = e} section = split-coeq |
| 191 | + where |
| 192 | + open is-split-coequaliser |
| 193 | +
|
| 194 | + split-coeq : is-split-coequaliser id (s ∘ e) e s id |
| 195 | + split-coeq .coequal = |
| 196 | + e ∘ id ≡⟨ idr e ⟩ |
| 197 | + e ≡⟨ insertl section ⟩ |
| 198 | + e ∘ s ∘ e ∎ |
| 199 | + split-coeq .rep-section = section |
| 200 | + split-coeq .witness-section = id₂ |
| 201 | + split-coeq .commute = sym (idr (s ∘ e)) |
| 202 | +``` |
0 commit comments