csci8980-f23/hwk1.agda

29 lines
757 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 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
-- ∎