mirror of
https://github.com/Smaug123/agdaproofs
synced 2025-10-12 15:18:40 +00:00
18 lines
420 B
Agda
18 lines
420 B
Agda
{-# 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
|