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

Higher computational properties of computational identity types #1026

Merged
merged 16 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading