Package list-zip: The list zip function
Information
name | list-zip |
version | 1.5 |
description | The list zip function |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool list-def list-dest list-length list-nth natural |
show | Data.Bool Data.List Data.Pair Number.Natural |
Files
- Package tarball list-zip-1.5.tgz
- Theory file list-zip.thy (included in the package tarball)
Defined Constants
- Data
- List
- zip
- zipWith
- List
Theorems
⊦ ∀f. zipWith f [] [] = []
⊦ ∀l1 l2. zip l1 l2 = zipWith (,) l1 l2
⊦ ∀l1 l2 n. length l1 = n ∧ length l2 = n ⇒ length (zip l1 l2) = n
⊦ ∀f l1 l2 n. length l1 = n ∧ length l2 = n ⇒ length (zipWith f l1 l2) = n
⊦ ∀f h1 h2 t1 t2.
length t1 = length t2 ⇒
zipWith f (h1 :: t1) (h2 :: t2) = f h1 h2 :: zipWith f t1 t2
⊦ ∀l1 l2 n i.
length l1 = n ∧ length l2 = n ∧ i < n ⇒
nth (zip l1 l2) i = (nth l1 i, nth l2 i)
⊦ ∀f l1 l2 n i.
length l1 = n ∧ length l2 = n ∧ i < n ⇒
nth (zipWith f l1 l2) i = f (nth l1 i) (nth l2 i)
Input Type Operators
- →
- bool
- Data
- List
- list
- Pair
- ×
- List
- Number
- Natural
- natural
- Natural
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ¬
- ⊥
- ⊤
- List
- ::
- []
- head
- length
- nth
- tail
- Pair
- ,
- Bool
- Number
- Natural
- <
- suc
- zero
- Natural
Assumptions
⊦ ⊤
⊦ length [] = 0
⊦ ⊥ ⇔ ∀p. p
⊦ ∀n. 0 < suc n
⊦ (¬) = λ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 ⇒ ⊤ ⇔ ⊤
⊦ ∀n. ¬(suc n = 0)
⊦ ∀m. m < 0 ⇔ ⊥
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀h t. head (h :: t) = h
⊦ ∀h t. tail (h :: t) = t
⊦ ∀h t. nth (h :: t) 0 = h
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀m n. suc m = suc n ⇔ m = n
⊦ ∀m n. suc m < suc n ⇔ m < n
⊦ ∀p. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ ∀p. p 0 ∧ (∀n. p n ⇒ p (suc n)) ⇒ ∀n. p n
⊦ ∀p. p [] ∧ (∀h t. p t ⇒ p (h :: t)) ⇒ ∀l. p l
⊦ ∀h t n. n < length t ⇒ nth (h :: t) (suc n) = nth t n
⊦ ∀b f. ∃fn. fn [] = b ∧ ∀h t. fn (h :: t) = f h t (fn t)