Package modular-def: Definition of modular arithmetic

Information

namemodular-def
version1.25
descriptionDefinition of modular arithmetic
authorJoe Hurd <joe@gilith.com>
licenseMIT
provenanceHOL Light theory extracted on 2011-11-28
requiresbool
natural
natural-divides
modular-witness
showData.Bool
Number.Modular
Number.Natural

Files

Defined Type Operator

Defined Constants

Theorems

modulus mod modulus = 0

0 mod modulus = 0

x. fromNatural (toNatural x) = x

n. n mod modulus < modulus

x. toNatural (fromNatural x) = x mod modulus

x. ~x = fromNatural (modulus - toNatural x)

n. divides modulus n n mod modulus = 0

n. n < modulus n mod modulus = n

n. n mod modulus mod modulus = n mod modulus

x y. x < y ¬(y x)

x y. x - y = x + ~y

x y. x y toNatural x toNatural y

x1 y1. fromNatural (x1 * y1) = fromNatural x1 * fromNatural y1

x1 y1. fromNatural (x1 + y1) = fromNatural x1 + fromNatural y1

m n. m mod modulus * (n mod modulus) mod modulus = m * n mod modulus

m n. (m mod modulus + n mod modulus) mod modulus = (m + n) mod modulus

x y. x < modulus y < modulus fromNatural x = fromNatural y x = y

Input Type Operators

Input Constants

Assumptions

T

¬(modulus = 0)

¬F T

¬T F

t. t t

F p. p

t. t ¬t

(¬) = λp. p F

() = λP. P ((select) P)

t. (x. t) t

t. (λx. t x) = t

() = λp. p = λx. T

t. ¬¬t t

t. (T t) t

t. (t T) t

t. F t F

t. T t t

t. F t T

t. T t t

t. t T T

t. F t t

t. T t T

t. t F t

t. t T T

t. (F t) ¬t

t. t F ¬t

() = λp q. p q p

t. (t T) (t F)

n. 0 < n ¬(n = 0)

x y. x = y y = x

t1 t2. t1 t2 t2 t1

() = λp q. (λf. f p q) = λf. f T T

n. ¬(n = 0) n mod n = 0

P. ¬(x. P x) x. ¬P x

() = λP. q. (x. P x q) q

m n. m < n m mod n = m

m n. ¬(n = 0) m mod n < n

f g. (x. f x = g x) f = g

() = λp q. r. (p r) (q r) r

t1 t2 t3. (t1 t2) t3 t1 t2 t3

P. (x. y. P x y) y. x. P x (y x)

a b. ¬(a = 0) (divides a b b mod a = 0)

m n. ¬(n = 0) m mod n mod n = m mod n

m n. ¬(n = 0) m div n * n + m mod n = m

m n p. ¬(n = 0) m mod n * (p mod n) mod n = m * p mod n

a b n. ¬(n = 0) (a mod n + b mod n) mod n = (a + b) mod n