Skip to content

Instantly share code, notes, and snippets.

@artemohanjanyan
Created January 17, 2019 20:43
Show Gist options
  • Save artemohanjanyan/855fe9c8c5bc6450c5081d85d94ad038 to your computer and use it in GitHub Desktop.
Save artemohanjanyan/855fe9c8c5bc6450c5081d85d94ad038 to your computer and use it in GitHub Desktop.
module EvenOdd
import Data.Fin
%access public export
%default total
data Even : (n: Nat) -> Type where
ZEven : Even Z
SsEven : (n: Nat) -> Even n -> Even (S (S n))
data Odd : Nat -> Type where
OneOdd : Odd 1
SsOdd : Odd n -> Odd (2 + n)
oddNotZero : Odd 0 -> Void
oddNotZero OneOdd impossible
oddNotZero (SsOdd _) impossible
notOddSs : Not (Odd n) -> Not (Odd (2 + n))
notOddSs a b = case b of
(SsOdd x) => ?notOddSs_rhs_2
evenNotOdd : Even n -> Not (Odd n)
evenNotOdd ZEven = oddNotZero
evenNotOdd (SsEven n x) =
let rec = evenNotOdd x
in notOddSs rec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment