Nat.agda 644 B

12345678910111213141516171819202122232425262728293031323334
  1. module Nat where
  2. open import Base
  3. data Nat : Set where
  4. zero : Nat
  5. suc : Nat -> Nat
  6. _=N_ : Nat -> Nat -> Set
  7. zero =N zero = True
  8. zero =N suc _ = False
  9. suc _ =N zero = False
  10. suc n =N suc m = n =N m
  11. refN : Refl _=N_
  12. refN {zero} = T
  13. refN {suc n} = refN {n}
  14. symN : Sym _=N_
  15. symN {zero}{zero} p = p
  16. symN {suc n}{suc m} p = symN {n}{m} p
  17. symN {zero}{suc _} ()
  18. symN {suc _}{zero} ()
  19. transN : Trans _=N_
  20. transN {zero }{zero }{zero } p _ = p
  21. transN {suc n}{suc m}{suc l} p q = transN {n}{m}{l} p q
  22. transN {zero }{zero }{suc _} _ ()
  23. transN {zero }{suc _}{_ } () _
  24. transN {suc _}{zero }{_ } () _
  25. transN {suc _}{suc _}{zero } _ ()