Package natural-order-min-max: Natural number min and max functions
Information
name | natural-order-min-max |
version | 1.40 |
description | Natural number min and max functions |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
checksum | 900d1041c2d12844f707c8cb41578f5bd33fd72f |
requires | bool natural-order-def natural-order-thm |
show | Data.Bool Number.Natural |
Files
- Package tarball natural-order-min-max-1.40.tgz
- Theory source file natural-order-min-max.thy (included in the package tarball)
Defined Constants
- Number
- Natural
- max
- min
- minimal
- Natural
Theorems
⊦ (minimal n. ⊤) = 0
⊦ ∀n. max 0 n = n
⊦ ∀n. max n 0 = n
⊦ ∀n. max n n = n
⊦ ∀n. min 0 n = 0
⊦ ∀n. min n 0 = 0
⊦ ∀n. min n n = n
⊦ ∀m n. m ≤ max m n
⊦ ∀m n. n ≤ max m n
⊦ ∀m n. min m n ≤ m
⊦ ∀m n. min m n ≤ n
⊦ ∀m n. max m n = max n m
⊦ ∀m n. min m n = min n m
⊦ ∀m n. max m n = if m ≤ n then n else m
⊦ ∀m n. min m n = if m ≤ n then m else n
⊦ ∀m n. max (suc m) (suc n) = suc (max m n)
⊦ ∀m n. min (suc m) (suc n) = suc (min m n)
⊦ ∀m n. max m n = 0 ⇔ m = 0 ∧ n = 0
⊦ ∀m n p. m < max n p ⇔ m < n ∨ m < p
⊦ ∀m n p. m < min n p ⇔ m < n ∧ m < p
⊦ ∀m n p. m ≤ max n p ⇔ m ≤ n ∨ m ≤ p
⊦ ∀m n p. m ≤ min n p ⇔ m ≤ n ∧ m ≤ p
⊦ ∀m n p. max n p < m ⇔ n < m ∧ p < m
⊦ ∀m n p. min n p < m ⇔ n < m ∨ p < m
⊦ ∀m n p. max n p ≤ m ⇔ n ≤ m ∧ p ≤ m
⊦ ∀m n p. min n p ≤ m ⇔ n ≤ m ∨ p ≤ m
⊦ ∀p n. p n ∧ (∀m. m < n ⇒ ¬p m) ⇒ (minimal) p = n
⊦ ∀p. (∃n. p n) ⇔ p ((minimal) p) ∧ ∀m. m < (minimal) p ⇒ ¬p m
External Type Operators
- →
- bool
- Number
- Natural
- natural
- Natural
External Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- ⊥
- ⊤
- Bool
- Number
- Natural
- <
- ≤
- suc
- zero
- Natural
Assumptions
⊦ ⊤
⊦ ¬⊥ ⇔ ⊤
⊦ ¬⊤ ⇔ ⊥
⊦ ∀t. t ⇒ t
⊦ ∀n. 0 ≤ n
⊦ ∀n. n ≤ n
⊦ ⊥ ⇔ ∀p. p
⊦ ∀m. ¬(m < 0)
⊦ (¬) = λp. p ⇒ ⊥
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. ⊤ ∧ t ⇔ t
⊦ ∀t. t ∧ ⊤ ⇔ t
⊦ ∀t. ⊥ ⇒ t ⇔ ⊤
⊦ ∀t. ⊤ ⇒ t ⇔ t
⊦ ∀t. ⊥ ∨ t ⇔ t
⊦ ∀t. t ⇒ ⊥ ⇔ ¬t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀m. m ≤ 0 ⇔ m = 0
⊦ ∀t1 t2. (if ⊥ then t1 else t2) = t2
⊦ ∀t1 t2. (if ⊤ then t1 else t2) = t1
⊦ ∀m n. m < n ⇒ m ≤ n
⊦ ∀m n. m ≤ n ∨ n ≤ m
⊦ ∀m n. ¬(m < n) ⇔ n ≤ m
⊦ ∀m n. ¬(m ≤ n) ⇔ n < m
⊦ ∀m n. suc m ≤ n ⇔ m < n
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀m n. suc m ≤ suc n ⇔ m ≤ n
⊦ ∀t1 t2. ¬(t1 ∧ t2) ⇔ ¬t1 ∨ ¬t2
⊦ ∀m n. m ≤ n ∧ n ≤ m ⇔ m = n
⊦ ∀m n p. m ≤ n ∧ n ≤ p ⇒ m ≤ p
⊦ ∀m n. m ≤ suc n ⇔ m = suc n ∨ m ≤ n
⊦ ∀p. (∃n. p n) ⇔ ∃n. p n ∧ ∀m. m < n ⇒ ¬p m
⊦ ∀p c x y. p (if c then x else y) ⇔ (c ⇒ p x) ∧ (¬c ⇒ p y)