Files
agdaproofs/Numbers/Integers/Definition.agda
2019-08-22 08:37:41 +01:00

36 lines
914 B
Agda
Raw 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.

{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Definition
module Numbers.Integers.Definition where
data : Set where
nonneg :
negSucc :
data Simple : Set where
negativeSucc : (a : ) Simple
positiveSucc : (a : ) Simple
zZero : Simple
convertZ : Simple
convertZ (nonneg zero) = zZero
convertZ (nonneg (succ x)) = positiveSucc x
convertZ (negSucc x) = negativeSucc x
convertZ' : Simple
convertZ' (negativeSucc a) = negSucc a
convertZ' (positiveSucc a) = nonneg (succ a)
convertZ' zZero = nonneg 0
zIsZ : (a : ) convertZ' (convertZ a) a
zIsZ (nonneg zero) = refl
zIsZ (nonneg (succ x)) = refl
zIsZ (negSucc x) = refl
zIsZ' : (a : Simple) convertZ (convertZ' a) a
zIsZ' (negativeSucc a) = refl
zIsZ' (positiveSucc a) = refl
zIsZ' zZero = refl