TheHoTTGame/0Trinitarianism/Quest2Solutions.agda
2021-08-16 20:07:25 +01:00

29 lines
582 B
Agda
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module 0Trinitarianism.Quest2Solutions where
open import 0Trinitarianism.Preambles.P2
isEven : Type
isEven zero =
isEven (suc zero) =
isEven (suc (suc n)) = isEven n
existsEven : Σ isEven
existsEven = 4 , tt
_×_ : Type Type Type
A × C = Σ A (λ a C)
div2 : Σ isEven
div2 (0 , tt) = 0
div2 (suc (suc n) , hn) = suc (div2 (n , hn))
private
postulate
A B C : Type
uncurry : (A B C) (A × B C)
uncurry f (fst₁ , snd₁) = f fst₁ snd₁
curry : (A × B C) (A B C)
curry f a b = f (a , b)