csci8980-f23/hwk1.agda

29 lines
757 B
Agda
Raw Normal View History

2023-10-19 04:27:04 +00:00
module hwk1 where
open import Data.Nat
open import Relation.Binary.PropositionalEquality as Eq
open Eq.≡-Reasoning
natrec : {C : Set} (a : ) (d : C) (e : C C) C
natrec zero d e = d
natrec (suc b) d e = e b (natrec b d e)
:
x y = natrec x y (λ u v suc v)
problem2-lemma : (x : ) natrec x 0 (λ u v suc v) x
problem2-lemma zero = refl
problem2-lemma (suc x) = cong suc (problem2-lemma x)
-- (λ u v → suc v) x (natrec x 0 (λ u v → suc v))
-- suc (natrec x 0 (λ u v → suc v))
problem2 : (x : ) x 0 x
problem2 x = problem2-lemma x
-- begin
-- ⊕ x 0
-- ≡⟨⟩
-- natrec x 0 (λ u v → suc v)
-- ≡⟨ {! !} ⟩
-- x
-- ∎