{-# OPTIONS --allow-unsolved-metas #-}
data Bool : Set where
false true : Bool
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
data ⊥ : Set where
data _⊎_ (A B : Set) : Set where
left : A → A ⊎ B
right : B → A ⊎ B
¬ : Set → Set
¬ X = X → ⊥
! : Bool → Bool
! false = true
! true = false
_+_ : ℕ → ℕ → ℕ
zero + b = b
succ a + b = succ (a + b)
_·_ : ℕ → ℕ → ℕ
zero · b = zero
succ a · b = b + (a · b)
pred : ℕ → ℕ
pred zero = zero
pred (succ a) = a
infix 5 _≡_
data _≡_ {X : Set} : X → X → Set where
refl : {a : X} → a ≡ a
{-# BUILTIN EQUALITY _≡_ #-}
dni : {A B : Set} → A → ¬ (¬ A)
dni p = {!!}
contraposition : {A B : Set} → (A → B) → (¬ B → ¬ A)
contraposition f p = {!!}
de-morgan₁ : {A B : Set} → ¬ (A ⊎ B) → ¬ A
de-morgan₁ = {!!}
de-morgan₂ : {A B : Set} → ¬ (A ⊎ B) → ¬ B
de-morgan₂ = {!!}
cong : {A B : Set} {x y : A} → (f : A → B) → x ≡ y → f x ≡ f y
cong f p = {!!}
symm : {A : Set} {x y : A} → x ≡ y → y ≡ x
symm p = {!!}
trans : {A : Set} {x y z : A} → x ≡ y → y ≡ z → x ≡ z
trans p q = {!!}
equal→pwequal : {A B : Set} {f g : A → B} {x : A} → f ≡ g → f x ≡ g x
equal→pwequal p = {!!}
transport : {A : Set} {x y : A} → (F : A → Set) → x ≡ y → F x → F y
transport F p s = {!!}
lemma-pred-succ : (a : ℕ) → pred (succ a) ≡ a
lemma-pred-succ a = {!!}
even? : ℕ → Bool
even? zero = true
even? (succ n) = ! (even? n)
even?' : ℕ → Bool
even?' zero = true
even?' (succ zero) = false
even?' (succ (succ n)) = even?' n
lemma-even?-even?' : (a : ℕ) → even? a ≡ even?' a
lemma-even?-even?' a = {!!}
lemma-succ-pred : ((a : ℕ) → succ (pred a) ≡ a) → ⊥
lemma-succ-pred f = {!!}
data Positive : ℕ → Set where
succs-are-positive : {n : ℕ} → Positive (succ n)
lemma-succ-pred' : (a : ℕ) → Positive a → succ (pred a) ≡ a
lemma-succ-pred' (succ b) p = refl
lemma-+-zero : (a : ℕ) → (a + zero) ≡ a
lemma-+-zero a = {!!}
lemma-+-succ : (a b : ℕ) → (a + succ b) ≡ succ (a + b)
lemma-+-succ a b = {!!}
lemma-+-commutative : (a b : ℕ) → (a + b) ≡ (b + a)
lemma-+-commutative a b = {!!}
lemma-+-associative : (a b c : ℕ) → (a + (b + c)) ≡ ((a + b) + c)
lemma-+-associative a b c = {!!}
lemma-distributive : (a b c : ℕ) → ((a + b) · c) ≡ ((a · c) + (b · c))
lemma-distributive a b c = {!!}
data Even : ℕ → Set where
base-even : Even zero
step-even : {n : ℕ} → Even n → Even (succ (succ n))
lemma-double-even : (a : ℕ) → Even (a + a)
lemma-double-even a = {!!}
data List (A : Set) : Set where
[] : List A
_∷_ : A → List A → List A
module _ {A : Set} where
_∷ʳ_ : List A → A → List A
[] ∷ʳ y = y ∷ []
(x ∷ xs) ∷ʳ y = x ∷ (xs ∷ʳ y)
reverse : List A → List A
reverse [] = []
reverse (x ∷ xs) = reverse xs ∷ʳ x
lemma-reverse-∷ʳ : (ys : List A) (x : A) → reverse (ys ∷ʳ x) ≡ (x ∷ reverse ys)
lemma-reverse-∷ʳ ys x = {!!}
lemma-reverse-reverse : (xs : List A) → reverse (reverse xs) ≡ xs
lemma-reverse-reverse xs = {!!}
_++_ : List A → List A → List A
[] ++ ys = ys
(x ∷ xs) ++ ys = x ∷ (xs ++ ys)
data _≈_ : List A → List A → Set where
both-empty : [] ≈ []
both-same-cons : {xs ys : List A} {x y : A} → x ≡ y → xs ≈ ys → (x ∷ xs) ≈ (y ∷ ys)
≡→≈ : {xs ys : List A} → xs ≡ ys → xs ≈ ys
≡→≈ p = {!!}
≈→≡ : {xs ys : List A} → xs ≈ ys → xs ≡ ys
≈→≡ p = {!!}
data Vector (A : Set) : ℕ → Set where
[] : Vector A zero
_∷_ : {n : ℕ} → A → Vector A n → Vector A (succ n)
drop : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A n
drop zero xs = xs
drop (succ k') (x ∷ xs') = drop k' xs'
take : {A : Set} {n : ℕ} (k : ℕ) → Vector A (k + n) → Vector A k
take zero xs = []
take (succ k') (x ∷ xs') = x ∷ take k' xs'
_++ᵥ_ : {A : Set} {n m : ℕ} → Vector A n → Vector A m → Vector A (n + m)
[] ++ᵥ ys = ys
(x ∷ xs') ++ᵥ ys = x ∷ (xs' ++ᵥ ys)
lemma-take-drop : {A : Set} {n : ℕ} → (k : ℕ) → (xs : Vector A (k + n)) → (take k xs ++ᵥ drop k xs) ≡ xs
lemma-take-drop = {!!}