Package list-length: The list length function
Information
name | list-length |
version | 1.23 |
description | The list length function |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool natural list-def list-thm list-dest |
show | Data.Bool Data.List Number.Natural |
Files
- Package tarball list-length-1.23.tgz
- Theory file list-length.thy (included in the package tarball)
Defined Constant
- Data
- List
- length
- List
Theorems
⊦ length [] = 0
⊦ ∀l. length l = 0 ⇔ l = []
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀l. ¬(l = []) ⇒ length (tail l) = length l - 1
⊦ ∀l n. length l = suc n ⇔ ∃h t. l = h :: t ∧ length t = n
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- F
- T
- List
- ::
- []
- tail
- Bool
- Number
- Natural
- -
- bit1
- suc
- zero
- Natural
Assumptions
⊦ T
⊦ ¬F ⇔ T
⊦ ¬T ⇔ F
⊦ F ⇔ ∀p. p
⊦ (¬) = λp. p ⇒ F
⊦ (∃) = λP. P ((select) P)
⊦ ∀t. (∀x. t) ⇔ t
⊦ ∀t. (∃x. t) ⇔ t
⊦ ∀t. (λx. t x) = t
⊦ (∀) = λp. p = λx. 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. F ∨ t ⇔ t
⊦ ∀t. T ∨ t ⇔ T
⊦ ∀t. t ∨ F ⇔ t
⊦ ∀n. ¬(suc n = 0)
⊦ ∀t. (F ⇔ t) ⇔ ¬t
⊦ ∀t. t ⇒ F ⇔ ¬t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ T) ∨ (t ⇔ F)
⊦ ∀n. suc n - 1 = n
⊦ ∀h t. ¬(h :: t = [])
⊦ ∀h t. tail (h :: t) = t
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ ∀P. ¬(∃x. P x) ⇔ ∀x. ¬P x
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀m n. suc m = suc n ⇔ m = n
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀P Q. P ∧ (∃x. Q x) ⇔ ∃x. P ∧ Q x
⊦ ∀P Q. P ∨ (∃x. Q x) ⇔ ∃x. P ∨ Q x
⊦ ∀t1 t2 t3. (t1 ∨ t2) ∨ t3 ⇔ t1 ∨ t2 ∨ t3
⊦ ∀P. P [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀h1 h2 t1 t2. h1 :: t1 = h2 :: t2 ⇔ h1 = h2 ∧ t1 = t2
⊦ ∀NIL' CONS'.
∃fn. fn [] = NIL' ∧ ∀a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)