Package modular-thm: Properties of modular arithmetic
Information
name | modular-thm |
version | 1.18 |
description | Properties of modular arithmetic |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
provenance | HOL Light theory extracted on 2012-01-29 |
requires | bool natural modular-def |
show | Data.Bool Number.Modular Number.Natural |
Files
- Package tarball modular-thm-1.18.tgz
- Theory file modular-thm.thy (included in the package tarball)
Theorems
⊦ fromNatural modulus = 0
⊦ ∀x. toNatural x < modulus
⊦ ~0 = 0
⊦ ∀x. ~~x = x
⊦ ∀x. x + 0 = x
⊦ ∀x. 0 + x = x
⊦ ∀x. toNatural x div modulus = 0
⊦ ∀x. x * 0 = 0
⊦ ∀x. x + ~x = 0
⊦ ∀x. 0 * x = 0
⊦ ∀x. ~x + x = 0
⊦ ∀x. toNatural x mod modulus = toNatural x
⊦ ∀x. x * 1 = x
⊦ ∀x. 1 * x = x
⊦ ∀x y. x * y = y * x
⊦ ∀x y. x + y = y + x
⊦ ∀x. fromNatural x = 0 ⇔ divides modulus x
⊦ ∀x. ~x = 0 ⇔ x = 0
⊦ ∀x y. x < y ⇔ toNatural x < toNatural y
⊦ ∀x y. x * ~y = ~(x * y)
⊦ ∀x y. ~x * y = ~(x * y)
⊦ ∀x y. ~x = ~y ⇒ x = y
⊦ ∀x y. toNatural x = toNatural y ⇒ x = y
⊦ ∀x y. x + y = x ⇔ y = 0
⊦ ∀x y. y + x = x ⇔ y = 0
⊦ ∀x y. ~x + ~y = ~(x + y)
⊦ ∀x y. toNatural (x * y) = toNatural x * toNatural y mod modulus
⊦ ∀x y. toNatural (x + y) = (toNatural x + toNatural y) mod modulus
⊦ ∀x y z. x * y * z = x * (y * z)
⊦ ∀x y z. x + y + z = x + (y + z)
⊦ ∀x y z. x + y = x + z ⇔ y = z
⊦ ∀x y z. y + x = z + x ⇔ y = z
⊦ ∀x y. fromNatural x = fromNatural y ⇔ x mod modulus = y mod modulus
⊦ ∀x y z. x * (y + z) = x * y + x * z
⊦ ∀x y z. (y + z) * x = y * x + z * x
Input Type Operators
- →
- bool
- Number
- Modular
- modular
- Natural
- natural
- Modular
Input Constants
- =
- Data
- Bool
- ∀
- ∧
- ⇒
- ¬
- T
- Bool
- Number
- Modular
- *
- +
- <
- ≤
- ~
- fromNatural
- modulus
- toNatural
- Natural
- *
- +
- -
- <
- ≤
- bit1
- div
- divides
- mod
- zero
- Modular
Assumptions
⊦ T
⊦ modulus mod modulus = 0
⊦ 0 mod modulus = 0
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ ∀x. fromNatural (toNatural x) = x
⊦ ∀n. 0 * n = 0
⊦ ∀n. 0 + n = n
⊦ ∀n. n mod modulus < modulus
⊦ ∀m. 1 * m = m
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀x. toNatural (fromNatural x) = x mod modulus
⊦ ∀x. ~x = fromNatural (modulus - toNatural x)
⊦ ∀m n. m * n = n * m
⊦ ∀m n. m + n = n + m
⊦ ∀m n. m < n ⇒ m ≤ n
⊦ ∀n. divides modulus n ⇔ n mod modulus = 0
⊦ ∀n. n mod modulus mod modulus = n mod modulus
⊦ ∀x y. x < y ⇔ ¬(y ≤ x)
⊦ ∀m n. ¬(m ≤ n) ⇔ n < m
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ ∀x y. x ≤ y ⇔ toNatural x ≤ toNatural y
⊦ ∀m n. m < n ⇒ m div n = 0
⊦ ∀m n. m < n ⇒ m mod n = m
⊦ ∀x1 y1. fromNatural (x1 * y1) = fromNatural x1 * fromNatural y1
⊦ ∀x1 y1. fromNatural (x1 + y1) = fromNatural x1 + fromNatural y1
⊦ ∀m n. n ≤ m ⇒ m - n + n = m
⊦ ∀m n p. m * (n * p) = m * n * p
⊦ ∀m n p. m + (n + p) = m + n + p
⊦ ∀m n p. m * (n + p) = m * n + m * p
⊦ ∀m n p. (m + n) * p = m * p + n * p
⊦ ∀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