Skip to content

Commit

Permalink
Higher computational properties of computational identity types (#1026)
Browse files Browse the repository at this point in the history
- Refactors `ap-binary` to compute as one of the sides in the gray
interchange diagram.
- Adds whiskering and horizontal concatenation of Yoneda identifications
- Renames `inv-(yoneda|involutive|computational)-Id` to `inv(ʸ|ⁱ|ʲ)`
- Some touch-ups for the file on the Eckmann-Hilton argument
  • Loading branch information
fredrik-bakke authored Feb 19, 2024
1 parent ae3b787 commit efc5114
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 342 deletions.
35 changes: 26 additions & 9 deletions src/foundation/action-on-identifications-binary-functions.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ Given a binary operation `f : A → B → C` and
we call this the
{{#concept "binary action on identifications of binary functions" Agda=ap-binary}}.

There are a few different ways we can define `ap-binary`. We could define it by
pattern matching on both `p` and `q`, but this leads to restricted computational
behaviour. Instead, we define it as the upper concatenation in the Gray
interchanger diagram

```text
ap (r ↦ f x r) q
f x y -------------> f x y'
| |
| |
ap (r ↦ f r y) p | | ap (r ↦ f r y') p
| |
∨ ∨
f x' y ------------> f x' y'.
ap (r ↦ f x' r) q
```

## Definition

### The binary action on identifications of binary functions
Expand All @@ -39,7 +56,7 @@ module _

ap-binary :
{x x' : A} (p : x = x') {y y' : B} (q : y = y') f x y = f x' y'
ap-binary refl refl = refl
ap-binary {x} {x'} p {y} {y'} q = ap (λ r f r y) p ∙ ap (f x') q
```

## Properties
Expand All @@ -51,13 +68,13 @@ of the
[unary action on identifications of functions](foundation.action-on-identifications-functions.md):

```text
ap-binary f p q = ap (f (-) y) p ∙ ap (f x' (-)) q
ap-binary f p q = ap (r ↦ f r y) p ∙ ap (r ↦ f x' r) q
```

and

```text
ap-binary f p q = ap (f x (-)) q ∙ ap (f (-) y') p.
ap-binary f p q = ap (r ↦ f x r) q ∙ ap (r ↦ f r y') p.
```

```agda
Expand All @@ -67,12 +84,12 @@ module _

triangle-ap-binary :
{x x' : A} (p : x = x') {y y' : B} (q : y = y')
ap-binary f p q = ap (λ z f z y) p ∙ ap (f x') q
triangle-ap-binary refl refl = refl
ap-binary f p q = ap (λ r f r y) p ∙ ap (f x') q
triangle-ap-binary _ _ = refl

triangle-ap-binary' :
{x x' : A} (p : x = x') {y y' : B} (q : y = y')
ap-binary f p q = ap (f x) q ∙ ap (λ z f z y') p
ap-binary f p q = ap (f x) q ∙ ap (λ r f r y') p
triangle-ap-binary' refl refl = refl
```

Expand All @@ -89,10 +106,10 @@ module _

left-unit-ap-binary :
{x : A} {y y' : B} (q : y = y') ap-binary f refl q = ap (f x) q
left-unit-ap-binary refl = refl
left-unit-ap-binary _ = refl

right-unit-ap-binary :
{x x' : A} (p : x = x') {y : B} ap-binary f p refl = ap (λ z f z y) p
{x x' : A} (p : x = x') {y : B} ap-binary f p refl = ap (λ r f r y) p
right-unit-ap-binary refl = refl
```

Expand Down Expand Up @@ -120,7 +137,7 @@ module _
where

ap-binary-diagonal :
{x x' : A} (p : x = x') ap-binary f p p = ap (λ a f a a) p
{x x' : A} (p : x = x') ap-binary f p p = ap (λ r f r r) p
ap-binary-diagonal refl = refl
```

Expand Down
Loading

0 comments on commit efc5114

Please sign in to comment.