-
Notifications
You must be signed in to change notification settings - Fork 3
/
common.lagda
63 lines (47 loc) · 1.37 KB
/
common.lagda
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
51
52
53
54
55
56
57
58
59
60
61
62
63
\section{Standard Data-Type Declarations} \label{sec:common}
\AgdaHide{
\begin{code}
module common where
\end{code}
}
\begin{code}
open import Agda.Primitive public
using (Level; _⊔_; lzero; lsuc)
infixl 1 _,_
infixr 2 _×_
infixl 1 _≡_
record ⊤ {ℓ} : Set ℓ where
constructor tt
data ⊥ {ℓ} : Set ℓ where
¬_ : ∀ {ℓ ℓ′} → Set ℓ → Set (ℓ ⊔ ℓ′)
¬_ {ℓ} {ℓ′} T = T → ⊥ {ℓ′}
record Σ {a p} (A : Set a) (P : A → Set p)
: Set (a ⊔ p)
where
constructor _,_
field
fst : A
snd : P fst
open Σ public
data Lifted {a b} (A : Set a) : Set (b ⊔ a) where
lift : A → Lifted A
lower : ∀ {a b A} → Lifted {a} {b} A → A
lower (lift x) = x
_×_ : ∀ {ℓ ℓ′} (A : Set ℓ) (B : Set ℓ′) → Set (ℓ ⊔ ℓ′)
A × B = Σ A (λ _ → B)
data _≡_ {ℓ} {A : Set ℓ} (x : A) : A → Set ℓ where
refl : x ≡ x
sym : {A : Set} → {x : A} → {y : A} → x ≡ y → y ≡ x
sym refl = refl
trans : {A : Set} → {x y z : A} → x ≡ y → y ≡ z → x ≡ z
trans refl refl = refl
transport : ∀ {A : Set} {x : A} {y : A} → (P : A → Set)
→ x ≡ y → P x → P y
transport P refl v = v
data List (A : Set) : Set where
ε : List A
_::_ : A → List A → List A
_++_ : ∀{A} → List A → List A → List A
ε ++ ys = ys
(x :: xs) ++ ys = x :: (xs ++ ys)
\end{code}