Files
agdaproofs/Numbers/Naturals/Subtraction.agda
2019-10-12 11:14:27 +01:00

28 lines
780 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 Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import WellFoundedInduction
open import Functions
open import Orders
open import Numbers.Naturals.Definition
open import Numbers.Naturals.Addition
open import Numbers.Naturals.Order
open import Numbers.Naturals.Multiplication
open import Numbers.Naturals.Exponentiation
open import Semirings.Definition
open import Monoids.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