mirror of
https://github.com/Smaug123/agdaproofs
synced 2025-10-06 04:18:40 +00:00
20 lines
635 B
Agda
20 lines
635 B
Agda
{-# OPTIONS --safe --warning=error --without-K #-}
|
||
|
||
open import LogicalFormulae
|
||
open import Numbers.Naturals.Semiring
|
||
open import Numbers.Integers.Definition
|
||
|
||
module Numbers.Integers.Multiplication where
|
||
|
||
infix 25 _*Z_
|
||
_*Z_ : ℤ → ℤ → ℤ
|
||
nonneg x *Z nonneg y = nonneg (x *N y)
|
||
nonneg zero *Z negSucc y = nonneg zero
|
||
nonneg (succ x) *Z negSucc y = negSucc ((succ x) *N y +N x)
|
||
negSucc x *Z nonneg zero = nonneg zero
|
||
negSucc x *Z nonneg (succ y) = negSucc ((succ y) *N x +N y)
|
||
negSucc x *Z negSucc y = nonneg ((succ x) *N (succ y))
|
||
|
||
*ZInherits : (a b : ℕ) → nonneg (a *N b) ≡ (nonneg a) *Z (nonneg b)
|
||
*ZInherits a b = refl
|