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

20 lines
635 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.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