-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNotes.agda
More file actions
50 lines (36 loc) · 1.29 KB
/
Notes.agda
File metadata and controls
50 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module Notes where
open import Data.Unit
open import Data.Product hiding (map)
open import Data.Nat
open import Data.List
open import Data.Vec using (Vec)
open import Relation.Binary.PropositionalEquality hiding ([_])
∃Vec : Set
∃Vec = ∃ (Vec ⊤)
indices : List ∃Vec → List ℕ
indices = map proj₁
--
Vec′ : ℕ → Set
Vec′ n = Σ[ xs ∈ List ⊤ ] (length xs ≡ n)
∃Vec′ : Set
∃Vec′ = ∃ Vec′
indices′ : List ∃Vec′ → List ℕ
indices′ = map proj₁
--
inds : ∀ {B : ℕ → Set} → List (Σ ℕ B) → List ℕ
inds = map proj₁
--
ams-filter∘map : ∀ {}
→ AMS $ filter (P? ∘ f) xs
→ AMS $ filter P? (map f xs)
ams-filter∘map′ : ∀ {}
→ AMS $ filter P? (map f xs)
→ AMS $ filter (P? ∘ f) xs
∀ {P : A → Set} {P? : Unary.Decidable P} {rv : R → A} {hv : H → A} {r→h : R → H} {xs : List H}
→ (rv≗ : rv ≗ (hv ∘ r→h))
→ AMS $ filter (P? ∘ rv) xs ≡⟨ ams-filter∘map ⟩
AMS $ filter P? (map rv xs) ≡⟨ rewrite | map-cong rv≗ xs ⟩
AMS $ filter P? (map (hv ∘ r→h) xs) ≡⟨ rewrite | map-compose {g = hv} {f = r→h} xs ⟩
AMS $ filter P? (map hv $ map r→h xs) ≡⟨ ams-filter∘map′ ⟩
→ AMS $ filter (P? ∘ hv) (map r→h xs)
am-ap′ = ?