name | natural-factorial |
version | 1.5 |
description | Definitions and theorems about natural number factorial |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
show | Data.Bool Number.Natural |
⊦ ∀n. 0 < factorial n
⊦ ∀n. ¬(factorial n = 0)
⊦ ∀n. 1 ≤ factorial n
⊦ ∀m n. m ≤ n ⇒ factorial m ≤ factorial n
⊦ factorial 0 = 1 ∧ ∀n. factorial (suc n) = suc n * factorial n
⊦ T
⊦ ∀n. 0 ≤ n
⊦ ∀n. n ≤ n
⊦ 1 = suc 0
⊦ ∀n. 0 < suc n
⊦ (∃) = λP. P ((select) P)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀n. 0 < n ⇔ ¬(n = 0)
⊦ ∀m n. suc m ≤ n ⇔ m < n
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀m n. suc m ≤ suc n ⇔ m ≤ n
⊦ ∀m n. m ≤ n ⇔ ∃d. n = m + d
⊦ ∀m n p. m ≤ n ∧ n ≤ p ⇒ m ≤ p
⊦ ∀m n. 0 < m * n ⇔ 0 < m ∧ 0 < n
⊦ ∀P. P 0 ∧ (∀n. P n ⇒ P (suc n)) ⇒ ∀n. P n
⊦ ∀e f. ∃fn. fn 0 = e ∧ ∀n. fn (suc n) = f (fn n) n
⊦ ∀m n p. m * p ≤ n * p ⇔ m ≤ n ∨ p = 0
⊦ ∀t. (T ∧ t ⇔ t) ∧ (t ∧ T ⇔ t) ∧ (F ∧ t ⇔ F) ∧ (t ∧ F ⇔ F) ∧ (t ∧ t ⇔ t)
⊦ ∀t. (T ∨ t ⇔ T) ∧ (t ∨ T ⇔ T) ∧ (F ∨ t ⇔ t) ∧ (t ∨ F ⇔ t) ∧ (t ∨ t ⇔ t)
⊦ (∀n. 0 + n = n) ∧ (∀m. m + 0 = m) ∧ (∀m n. suc m + n = suc (m + n)) ∧
∀m n. m + suc n = suc (m + n)
⊦ (∀n. 0 * n = 0) ∧ (∀m. m * 0 = 0) ∧ (∀n. 1 * n = n) ∧ (∀m. m * 1 = m) ∧
(∀m n. suc m * n = m * n + n) ∧ ∀m n. m * suc n = m + m * n