-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duskin's Monadicity Theorem #76
Draft
TOTBWF
wants to merge
14
commits into
main
Choose a base branch
from
duskins-monadicity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
bf86b57
defn: sections, retractions, split monos/epis
TOTBWF 9f8475d
defn: Add id₂ to Cat.Reasoning
TOTBWF 72ca5a3
defn: split coequalizers
TOTBWF b01a536
defn: absoluteness of split coequalisers
TOTBWF 4b774fb
fix: tweak public exports of Finitely-complete
TOTBWF 8b8e735
defn: Split coequalizers induce quotients
TOTBWF b010e02
format: formatting fixes for split coequalisers
TOTBWF bad2d4c
format: formatting fixes for split coequaliser properties
TOTBWF df55454
refactor: define product diagrams over the 2 object category
TOTBWF 3508d94
defn: split epis of kernel pairs are split coequalizers
TOTBWF 1a79e3d
defn: reflection of colimits, isomorphisms of colimit coapexes
TOTBWF 4f00251
defn: conservative functors preserve colimits
TOTBWF 782abd7
defn: coequalisers are colimits
TOTBWF 1633a24
fixup: avoid subst in conservative-reflects-limits
plt-amy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,203 @@ | ||
```agda | ||
open import Cat.Prelude | ||
|
||
module Cat.Diagram.Coequaliser.Split {o ℓ} (C : Precategory o ℓ) where | ||
open import Cat.Diagram.Coequaliser C | ||
``` | ||
|
||
<!-- | ||
```agda | ||
open import Cat.Reasoning C | ||
private variable | ||
A B E : Ob | ||
f g h e s t : Hom A B | ||
``` | ||
--> | ||
|
||
# Split Coequalizers | ||
|
||
Split Coequalizers are one of those definitions that seem utterly opaque when first | ||
presented, but are actually quite natural when viewed through the correct lens. | ||
With this in mind, we are going to provide the motivation _first_, and then | ||
define the general construct. | ||
|
||
To start, let $R \subseteq B \times B$ be some equivalence relation. A natural thing | ||
to consider is the quotient $B/R$, which gives us the following diagram: | ||
~~~{.quiver} | ||
\[\begin{tikzcd} | ||
R & {B \times B} & B & {B/R} | ||
\arrow[hook, from=1-1, to=1-2] | ||
\arrow["{p_1}", shift left=2, from=1-2, to=1-3] | ||
\arrow["{p_2}"', shift right=2, from=1-2, to=1-3] | ||
\arrow["q", from=1-3, to=1-4] | ||
\end{tikzcd}\] | ||
~~~ | ||
|
||
Now, when one has a quotient, it's useful to have a means of picking representatives | ||
for each equivalence class. This is essentially what normalization algorithms do, | ||
which we can both agree are very useful indeed. This ends up defining a map | ||
$s : B/R \to B$ that is a section of $q$ (i.e: $q \circ s = id$). | ||
|
||
This gives us the following diagram (We've omited the injection of $R$ into | ||
$B \times B$ for clarity). | ||
~~~{.quiver} | ||
\[\begin{tikzcd} | ||
R & B & {B/R} | ||
\arrow["q", shift left=2, from=1-2, to=1-3] | ||
\arrow["s", shift left=2, from=1-3, to=1-2] | ||
\arrow["{p_1}", shift left=2, from=1-1, to=1-2] | ||
\arrow["{p_2}"', shift right=2, from=1-1, to=1-2] | ||
\end{tikzcd}\] | ||
~~~ | ||
|
||
This lets us define yet another map $r : B \to R$, which will witness the fact that | ||
any $b : B$ is related to its representative $s(q(b))$. We can define this map explicitly | ||
as so: | ||
$$ | ||
r(b) = (b, s(q(b))) | ||
$$ | ||
|
||
Now, how do we encode this diagramatically? To start, $p_1 \circ r = id$ by the | ||
$\beta$ law for products. Furthermore, $p_2 \circ r = s \circ q$, also by the | ||
$\beta$ law for products. This gives us a diagram that captures the essence of having | ||
a quotient by an equivalence relation, along with a means of picking representatives. | ||
|
||
~~~{.quiver} | ||
\[\begin{tikzcd} | ||
R & B & {B/R} | ||
\arrow["q", shift left=2, from=1-2, to=1-3] | ||
\arrow["s", shift left=2, from=1-3, to=1-2] | ||
\arrow["{p_1}", shift left=5, from=1-1, to=1-2] | ||
\arrow["{p_2}"', shift right=5, from=1-1, to=1-2] | ||
\arrow["r"', from=1-2, to=1-1] | ||
\end{tikzcd}\] | ||
~~~ | ||
|
||
Such a situation is called a **split coequaliser**. | ||
|
||
```agda | ||
record is-split-coequaliser (f g : Hom A B) (e : Hom B E) | ||
(s : Hom E B) (t : Hom B A) : Type (o ⊔ ℓ) where | ||
field | ||
coequal : e ∘ f ≡ e ∘ g | ||
rep-section : e ∘ s ≡ id | ||
witness-section : f ∘ t ≡ id | ||
commute : s ∘ e ≡ g ∘ t | ||
``` | ||
|
||
Now, let's show that this thing actually deserves the name Coequaliser. | ||
```agda | ||
is-split-coequaliser→is-coequalizer : | ||
is-split-coequaliser f g e s t → is-coequaliser f g e | ||
is-split-coequaliser→is-coequalizer | ||
{f = f} {g = g} {e = e} {s = s} {t = t} split-coeq = | ||
coequalizes | ||
where | ||
open is-split-coequaliser split-coeq | ||
``` | ||
|
||
The proof here is mostly a diagram shuffle. We construct the universal | ||
map by going back along $s$, and then following $e'$ to our destination, | ||
like so: | ||
|
||
~~~{.quiver} | ||
\[\begin{tikzcd} | ||
A && B && E \\ | ||
\\ | ||
&&&& X | ||
\arrow["q", shift left=2, from=1-3, to=1-5] | ||
\arrow["s", shift left=2, from=1-5, to=1-3] | ||
\arrow["{p_1}", shift left=5, from=1-1, to=1-3] | ||
\arrow["{p_2}"', shift right=5, from=1-1, to=1-3] | ||
\arrow["r"', from=1-3, to=1-1] | ||
\arrow["{e'}", from=1-3, to=3-5] | ||
\arrow["{e' \circ s}", color={rgb,255:red,214;green,92;blue,92}, from=1-5, to=3-5] | ||
\end{tikzcd}\] | ||
~~~ | ||
|
||
```agda | ||
coequalizes : is-coequaliser f g e | ||
coequalizes .is-coequaliser.coequal = coequal | ||
coequalizes .is-coequaliser.coequalise {e′ = e′} _ = e′ ∘ s | ||
coequalizes .is-coequaliser.universal {e′ = e′} {p = p} = | ||
(e′ ∘ s) ∘ e ≡⟨ extendr commute ⟩ | ||
(e′ ∘ g) ∘ t ≡˘⟨ p ⟩∘⟨refl ⟩ | ||
(e′ ∘ f) ∘ t ≡⟨ cancelr witness-section ⟩ | ||
e′ ∎ | ||
coequalizes .is-coequaliser.unique {e′ = e′} {p} {colim′} q = | ||
colim′ ≡⟨ intror rep-section ⟩ | ||
colim′ ∘ e ∘ s ≡⟨ pulll (sym q) ⟩ | ||
e′ ∘ s ∎ | ||
``` | ||
|
||
Intuitively, we can think of this as constructing a map out of the quotient $B/R$ | ||
from a map out of $B$ by picking a representative, and then applying the map out | ||
of $B$. Universality follows by the fact that the representative is related to | ||
the original element of $B$, and uniqueness by the fact that $s$ is a section. | ||
|
||
```agda | ||
record Split-coequaliser (f g : Hom A B) : Type (o ⊔ ℓ) where | ||
field | ||
{coapex} : Ob | ||
coeq : Hom B coapex | ||
rep : Hom coapex B | ||
witness : Hom B A | ||
has-is-split-coeq : is-split-coequaliser f g coeq rep witness | ||
|
||
open is-split-coequaliser has-is-split-coeq public | ||
``` | ||
|
||
## Split coequalizers and split epimorphisms | ||
|
||
Much like the situation with coequalizers, the coequalizing map of a | ||
split coequalizer is a split epimorphism. This follows directly from the fact | ||
that $s$ is a section of $e$. | ||
|
||
```agda | ||
is-split-coequaliser→is-split-epic | ||
: is-split-coequaliser f g e s t → is-split-epic e | ||
is-split-coequaliser→is-split-epic {e = e} {s = s} split-coeq = | ||
split-epic | ||
where | ||
open is-split-epic | ||
open is-split-coequaliser split-coeq | ||
|
||
split-epic : is-split-epic e | ||
split-epic .split = s | ||
split-epic .section = rep-section | ||
``` | ||
|
||
Also of note, if $e$ is a split epimorphism with splitting $s$, then | ||
the following diagram is a split coequalizer. | ||
~~~{.quiver} | ||
\[\begin{tikzcd} | ||
A & A & B | ||
\arrow["id", shift left=3, from=1-1, to=1-2] | ||
\arrow["{s \circ e}"', shift right=3, from=1-1, to=1-2] | ||
\arrow["id"{description}, from=1-2, to=1-1] | ||
\arrow["e", shift left=1, from=1-2, to=1-3] | ||
\arrow["s", shift left=2, from=1-3, to=1-2] | ||
\end{tikzcd}\] | ||
~~~ | ||
|
||
Using the intuition that split coequalizers are quotients of equivalence relations | ||
equipped with a choice of representatives, we can decode this diagram as constructing | ||
an equivalence relation on $A$ out of a section of $e$, where $a ~ b$ if and only | ||
if they get taken to the same cross section of $A$ via $s \circ e$. | ||
|
||
```agda | ||
is-split-epic→is-split-coequalizer | ||
: s is-section-of e → is-split-coequaliser id (s ∘ e) e s id | ||
is-split-epic→is-split-coequalizer {s = s} {e = e} section = split-coeq | ||
where | ||
open is-split-coequaliser | ||
|
||
split-coeq : is-split-coequaliser id (s ∘ e) e s id | ||
split-coeq .coequal = | ||
e ∘ id ≡⟨ idr e ⟩ | ||
e ≡⟨ insertl section ⟩ | ||
e ∘ s ∘ e ∎ | ||
split-coeq .rep-section = section | ||
split-coeq .witness-section = id₂ | ||
split-coeq .commute = sym (idr (s ∘ e)) | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the risk of being a terrible person, do these two pages need a
description:
frontmatter field?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So true bestie