Skip to content
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

Add some facts about the parallel arrow category #461

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions src/Cat/Instances/Shape/Parallel.lagda.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<!--
```agda
open import 1Lab.Reflection.HLevel

open import Cat.Functor.Equivalence.Path
open import Cat.Functor.Equivalence
open import Cat.Functor.Constant
open import Cat.Prelude
open import Cat.Finite
Expand All @@ -14,6 +18,13 @@ import Cat.Reasoning
```agda
module Cat.Instances.Shape.Parallel where
```
<!--
```agda
open Functor
open is-precat-iso
open is-iso
Comment on lines +21 to +23
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
open Functor
open is-precat-iso
open is-iso
open is-precat-iso
open Functor
open is-iso

```
-->

# The "parallel arrows" category {defines="parallel-arrows"}

Expand Down Expand Up @@ -70,12 +81,49 @@ parallel arrows between them. It is the shape of [[equaliser]] and
```
-->

The parallel category is isomorphic to its opposite through the involution `not : Bool → Bool`.
4e554c4c marked this conversation as resolved.
Show resolved Hide resolved

```agda
·⇇· = ·⇉· ^op

·⇇·≡·⇉· : ·⇇· ≡ ·⇉·
·⇇·≡·⇉· = Precategory-path F F-is-iso where
F : Functor ·⇇· ·⇉·
F .F₀ x = not x
F .F₁ {true} {true} tt = tt
F .F₁ {true} {false} f = f
F .F₁ {false} {false} tt = tt
F .F-id {true} = refl
F .F-id {false} = refl
F .F-∘ {true} {true} {true} f g = refl
F .F-∘ {true} {true} {false} f g = refl
F .F-∘ {true} {false} {false} f g = refl
F .F-∘ {false} {false} {false} f g = refl

F-is-iso : is-precat-iso F
F-is-iso .has-is-ff {true} {true} .is-eqv _ = hlevel 0
F-is-iso .has-is-ff {true} {false} = id-equiv
F-is-iso .has-is-ff {false} {false} .is-eqv y = hlevel 0
F-is-iso .has-is-iso = not-is-equiv
```

<!--
```agda

module ·⇉· = Precategory ·⇉·
module ·⇇· = Precategory ·⇇·

module _ {o ℓ} {C : Precategory o ℓ} where
open Cat.Reasoning C
open Functor
open _=>_
```
-->

Paralell pairs of morphisms in a category $\cC$ are equivalent to functors from the
4e554c4c marked this conversation as resolved.
Show resolved Hide resolved
walking parallel arrow category to $\cC$.

```agda
Fork : ∀ {a b} (f g : Hom a b) → Functor ·⇉· C
Fork f g = funct where
funct : Functor _ _
Expand All @@ -91,6 +139,37 @@ module _ {o ℓ} {C : Precategory o ℓ} where
funct .F-∘ {false} {false} {true} f g = sym (idr _)
funct .F-∘ {false} {true} {true} tt _ = sym (idl _)
funct .F-∘ {true} {true} {true} tt tt = sym (idl _)
```

A natural transformation between two diagrams
$A \stackrel{\overset{f}{\longrightarrow}}{\underset{g}{\longrightarrow}} B$ and
$C \stackrel{\overset{f'}{\longrightarrow}}{\underset{g'}{\longrightarrow}} D$
4e554c4c marked this conversation as resolved.
Show resolved Hide resolved
is given by a pair of commutative squares

~~~{.quiver}
\begin{tikzcd}
A & B && A & B \\
C & D && C & D
\arrow["f", from=1-1, to=1-2]
\arrow["u"', from=1-1, to=2-1]
\arrow["v", from=1-2, to=2-2]
\arrow["g", from=1-4, to=1-5]
\arrow["u"', from=1-4, to=2-4]
\arrow["v", from=1-5, to=2-5]
\arrow["{f'}", from=2-1, to=2-2]
\arrow["{g'}", from=2-4, to=2-5]
\end{tikzcd}.
4e554c4c marked this conversation as resolved.
Show resolved Hide resolved
~~~

```agda
Fork-nt : ∀ {A B C D} {f g : Hom A B} {f' g' : Hom C D} {u : Hom A C} {v : Hom B D} →
(α : v ∘ f ≡ f' ∘ u) (β : v ∘ g ≡ g' ∘ u) → (Fork f g) => (Fork f' g')
Fork-nt {u = u} _ _ ._=>_.η false = u
Fork-nt {v = v} _ _ ._=>_.η true = v
Fork-nt _ _ .is-natural true true _ = id-comm
Fork-nt _ _ .is-natural false false _ = id-comm
Fork-nt _ β .is-natural false true true = β
Fork-nt α _ .is-natural false true false = α

forkl : (F : Functor ·⇉· C) → Hom (F .F₀ false) (F .F₀ true)
forkl F = F .F₁ {false} {true} false
Expand Down
Loading