Files
agdaproofs/Numbers/Naturals/Subtraction.agda
2020-01-05 15:06:35 +00:00

18 lines
420 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 --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Definition
open import Maybe
module Numbers.Naturals.Subtraction where
_-N'_ : (a b : ) Maybe
zero -N' zero = yes 0
zero -N' succ b = no
succ a -N' zero = yes (succ a)
succ a -N' succ b = a -N' b
subtractZero : (a : ) a -N' 0 yes a
subtractZero zero = refl
subtractZero (succ a) = refl