| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Properties of the pointwise lifting of a predicate to a binary tree |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 8 |
|
| 9 |
module Data.Tree.Binary.Relation.Unary.All.Properties where |
| 10 |
|
| 11 |
open import Level |
| 12 |
open import Data.Tree.Binary as Tree using (Tree; leaf; node) |
| 13 |
open import Data.Tree.Binary.Relation.Unary.All |
| 14 |
open import Relation.Unary |
| 15 |
open import Function.Base using (id) |
| 16 |
|
| 17 |
private |
| 18 |
variable |
| 19 |
n l n₁ l₁ p q : Level |
| 20 |
N : Set n |
| 21 |
L : Set l |
| 22 |
N₁ : Set n₁ |
| 23 |
L₁ : Set l₁ |
| 24 |
P : N₁ → Set p |
| 25 |
Q : L₁ → Set q |
| 26 |
|
| 27 |
map⁺ : (f : N → N₁) → (g : L → L₁) → All (f ⊢ P) (g ⊢ Q) ⊆ Tree.map f g ⊢ All P Q |
| 28 |
map⁺ f g (leaf x) = leaf x |
| 29 |
map⁺ f g (node l m r) = node (map⁺ f g l) m (map⁺ f g r) |
| 30 |
|
| 31 |
mapₙ⁺ : (f : N → N₁) → All (f ⊢ P) Q ⊆ Tree.mapₙ f ⊢ All P Q |
| 32 |
mapₙ⁺ f = map⁺ f id |
| 33 |
|
| 34 |
mapₗ⁺ : (g : L → L₁) → All P (g ⊢ Q) ⊆ Tree.mapₗ g ⊢ All P Q |
| 35 |
mapₗ⁺ g = map⁺ id g |