-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In this PR I generalized the equivalence constructed in #1110, to something that I called "hereditary W-types". This PR is independent of #1110.
- Loading branch information
1 parent
2c0f6a6
commit 6fb97c0
Showing
4 changed files
with
488 additions
and
10 deletions.
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
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,65 @@ | ||
# Binary W-types | ||
|
||
```agda | ||
module trees.binary-w-types where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import foundation.universe-levels | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
Consider a type `A` and two type families `B` and `C` over `A`. Then we obtain | ||
the polynomial functor | ||
|
||
```text | ||
X Y ↦ Σ (a : A), (B a → X) × (C a → Y) | ||
``` | ||
|
||
in two variables `X` and `Y`. By diagonalising, we obtain the | ||
[polynomial endofunctor](trees.polynomial-endofunctors.md) | ||
|
||
```text | ||
X ↦ Σ (a : A), (B a → X) × (C a → X). | ||
``` | ||
|
||
which may be brought to the exact form of a polynomial endofunctor if one wishes | ||
to do so: | ||
|
||
```text | ||
X ↦ Σ (a : A), (B a + C a → X). | ||
``` | ||
|
||
The {{#concept "binary W-type" Agda=binary-𝕎}} is the W-type `binary-𝕎` | ||
associated to this polynomial endofunctor. In other words, it is the inductive | ||
type generated by | ||
|
||
```text | ||
make-binary-𝕎 : (a : A) → (B a → binary-𝕎) → (C a → binary-𝕎) → binary-𝕎. | ||
``` | ||
|
||
The binary W-type is equivalent to the | ||
[hereditary W-types](trees.hereditary-w-types.md) via an | ||
[equivalence](foundation.equivalences.md) that generalizes the equivalence of | ||
plane trees and full binary plane trees, which is a well known equivalence used | ||
in the study of the | ||
[Catalan numbers](elementary-number-theory.catalan-numbers.md). | ||
|
||
## Definitions | ||
|
||
### Binary W-types | ||
|
||
```agda | ||
module _ | ||
{l1 l2 l3 : Level} {A : UU l1} (B : A → UU l2) (C : A → UU l3) | ||
where | ||
|
||
data binary-𝕎 : UU (l1 ⊔ l2 ⊔ l3) where | ||
make-binary-𝕎 : | ||
(a : A) → (B a → binary-𝕎) → (C a → binary-𝕎) → binary-𝕎 | ||
``` |
Oops, something went wrong.