# Data.Nat.Parity

Even : Nat -> Type

  A nat is Even when it is twice some other nat.

Odd : Nat -> Type

  A nat is Odd when it is one more than twice some other nat.

add2Even : Even n -> Even (fromInteger 2 + n)

  Two more than an Even is Even.

add2Odd : Odd n -> Odd (fromInteger 2 + n)

  Two more than an Odd is Odd.

even : Nat -> Bool
evenDec : (n : Nat) -> Dec (Even n)

  Evenness is decidable.

evenEven : Even n -> even n = True

  Evens are even.

evenOrOdd : (n : Nat) -> Either (Even n) (Odd n)

  Every nat is either Even or Odd.

notEvenAndOdd : Even n -> Odd n -> Void

  No nat is both Even and Odd.

odd : Nat -> Bool
oddDec : (n : Nat) -> Dec (Odd n)

  Oddness is decidable.

oddOdd : Odd n -> odd n = True

  Odds are odd.

predEvenOdd : Even (S n) -> Odd n

  One less than an Even is Odd.

predOddEven : Odd (S n) -> Even n

  One less than an Odd is Even.

succDoublePredPred : (S n = k * fromInteger 2) -> n = S (pred k * fromInteger 2)

  A helper fact.

succEvenOdd : Even n -> Odd (S n)

  One more than an Even is Odd.

succOddEven : Odd n -> Even (S n)

  One more than an Odd is Even.