{-# OPTIONS --allow-unsolved-metas #-}
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + b = b
succ a + b = succ (a + b)
_·_ : ℕ → ℕ → ℕ
zero · b = zero
succ a · b = b + (a · b)
data Even : ℕ → Set where
base-even : Even zero
step-even : {n : ℕ} → Even n → Even (succ (succ n))
data Odd : ℕ → Set where
base-odd : Odd (succ zero)
step-odd : {n : ℕ} → Odd n → Odd (succ (succ n))
lemma-sum-even : {a b : ℕ} → Even a → Even b → Even (a + b)
lemma-sum-even = {!!}
lemma-succ-even : {a : ℕ} → Even a → Odd (succ a)
lemma-succ-even = {!!}
lemma-succ-odd : {a : ℕ} → Odd a → Even (succ a)
lemma-succ-odd = {!!}
lemma-sum-odd : {a b : ℕ} → Odd a → Odd b → Even (a + b)
lemma-sum-odd = {!!}
lemma-sum-mixed : {a b : ℕ} → Odd a → Even b → Odd (a + b)
lemma-sum-mixed = {!!}
data _⊎_ (A B : Set) : Set where
left : A → A ⊎ B
right : B → A ⊎ B
lemma-even-odd : (a : ℕ) → Even a ⊎ Odd a
lemma-even-odd a = {!!}
data List (A : Set) : Set where
[] : List A
_∷_ : A → List A → List A
sum : List ℕ → ℕ
sum [] = {!!}
sum (x ∷ xs) = {!!}
map : {A B : Set} → (A → B) → List A → List B
map f xs = {!!}
data Vector (A : Set) : ℕ → Set where
[] : Vector A zero
_∷_ : {n : ℕ} → A → Vector A n → Vector A (succ n)
lengthV : {n : ℕ} {A : Set} → Vector A n → ℕ
lengthV [] = zero
lengthV (x ∷ xs) = succ (lengthV xs)
lengthV' : {n : ℕ} {A : Set} → Vector A n → ℕ
lengthV' {n} {A} xs = n
mapV : {n : ℕ} {A B : Set} → (A → B) → Vector A n → Vector B n
mapV f xs = {!!}
zipWithV : {A B C : Set} {n : ℕ} → (A → B → C) → Vector A n → Vector B n → Vector C n
zipWithV f [] [] = {!!}
zipWithV f (x ∷ xs) (y ∷ ys) = {!!}
dropV : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A n
dropV k xs = {!!}
takeV : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A k
takeV zero xs = []
takeV (succ k) (x ∷ xs) = x ∷ takeV k xs
_++_ : {A : Set} {n m : ℕ} → Vector A n → Vector A m → Vector A (n + m)
xs ++ ys = {!!}
snocV : {A : Set} {n : ℕ} → Vector A n → A → Vector A (succ n)
snocV xs y = {!!}
reverseV : {A : Set} {n : ℕ} → Vector A n → Vector A n
reverseV xs = {!!}
concatV : {A : Set} {n m : ℕ} → Vector (Vector A n) m → Vector A (m · n)
concatV [] = []
concatV (xs ∷ xss) = xs ++ concatV xss