Package list-zip-thm: Properties of the list zip functions
Information
name | list-zip-thm |
version | 1.26 |
description | Properties of the list zip functions |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
provenance | HOL Light theory extracted on 2015-04-22 |
checksum | f9bef6b88fe762fcea5b9b0c70db0460605a9546 |
requires | bool list-append list-def list-fold list-length list-nth list-thm list-zip-def natural pair |
show | Data.Bool Data.List Data.Pair Number.Natural |
Files
- Package tarball list-zip-thm-1.26.tgz
- Theory source file list-zip-thm.thy (included in the package tarball)
Theorems
⊦ zip [] [] = []
⊦ unzip [] = ([], [])
⊦ ∀x y. zip (x :: []) (y :: []) = (x, y) :: []
⊦ ∀l xs. unzip l = (xs, []) ⇔ l = [] ∧ xs = []
⊦ ∀l ys. unzip l = ([], ys) ⇔ l = [] ∧ ys = []
⊦ ∀f x y. zipWith f (x :: []) (y :: []) = f x y :: []
⊦ ∀l1 l2 n. length l1 = n ∧ length l2 = n ⇒ length (zip l1 l2) = n
⊦ ∀l xs ys. unzip l = (xs, ys) ⇔ length xs = length ys ∧ l = zip xs ys
⊦ ∀f l1 l2 n. length l1 = n ∧ length l2 = n ⇒ length (zipWith f l1 l2) = n
⊦ ∀x y xs ys.
length xs = length ys ⇒ zip (x :: xs) (y :: ys) = (x, y) :: zip xs ys
⊦ ∀x1 x2 y1 y2.
length x1 = length y1 ∧ length x2 = length y2 ⇒
zip (x1 @ x2) (y1 @ y2) = zip x1 y1 @ zip x2 y2
⊦ ∀l1 l2 n i.
length l1 = n ∧ length l2 = n ∧ i < n ⇒
nth (zip l1 l2) i = (nth l1 i, nth l2 i)
⊦ ∀h x y t xs ys.
unzip (h :: t) = (x :: xs, y :: ys) ⇔ h = (x, y) ∧ unzip t = (xs, ys)
⊦ ∀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)
⊦ ∀f x1 x2 y1 y2.
length x1 = length y1 ∧ length x2 = length y2 ⇒
zipWith f (x1 @ x2) (y1 @ y2) = zipWith f x1 y1 @ zipWith f x2 y2
External Type Operators
- →
- bool
- Data
- List
- list
- Pair
- ×
- List
- Number
- Natural
- natural
- Natural
External Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- ⊥
- ⊤
- List
- ::
- @
- []
- foldr
- length
- nth
- unzip
- zip
- zipWith
- Pair
- ,
- Bool
- Number
- Natural
- +
- <
- suc
- zero
- Natural
Assumptions
⊦ ⊤
⊦ ¬⊥ ⇔ ⊤
⊦ length [] = 0
⊦ ⊥ ⇔ ∀p. p
⊦ ∀t. t ∨ ¬t
⊦ ∀m. ¬(m < 0)
⊦ ∀n. 0 < suc n
⊦ (¬) = λp. p ⇒ ⊥
⊦ ∀t. (λx. t x) = t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. (⊤ ⇔ t) ⇔ t
⊦ ∀t. ⊥ ∧ t ⇔ ⊥
⊦ ∀t. ⊤ ∧ t ⇔ t
⊦ ∀t. t ∧ ⊥ ⇔ ⊥
⊦ ∀t. t ∧ ⊤ ⇔ t
⊦ ∀t. ⊥ ⇒ t ⇔ ⊤
⊦ ∀t. ⊤ ⇒ t ⇔ t
⊦ ∀t. t ⇒ ⊤ ⇔ ⊤
⊦ ∀n. ¬(suc n = 0)
⊦ ∀l. [] @ l = l
⊦ ∀t. (⊥ ⇔ t) ⇔ ¬t
⊦ ∀t. t ⇒ ⊥ ⇔ ¬t
⊦ ∀f. zipWith f [] [] = []
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ ⊤) ∨ (t ⇔ ⊥)
⊦ ∀h t. ¬(h :: t = [])
⊦ ∀p x. p x ⇒ p ((select) p)
⊦ ∀f b. foldr f b [] = b
⊦ ∀l. length l = 0 ⇔ l = []
⊦ ∀x. ∃a b. x = (a, b)
⊦ ∀x y. x = y ⇔ y = x
⊦ ∀h t. nth (h :: t) 0 = h
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀l1 l2. zip l1 l2 = zipWith , l1 l2
⊦ (∧) = λ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
⊦ ∀l1 l2. length (l1 @ l2) = length l1 + length l2
⊦ ∀l. l = [] ∨ ∃h t. l = h :: t
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀f. ∃fn. ∀a b. fn (a, b) = f a b
⊦ ∀t1 t2 t3. (t1 ∧ t2) ∧ t3 ⇔ t1 ∧ t2 ∧ t3
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀p. p 0 ∧ (∀n. p n ⇒ p (suc n)) ⇒ ∀n. p n
⊦ ∀p. p [] ∧ (∀h t. p t ⇒ p (h :: t)) ⇒ ∀l. p l
⊦ ∀f b h t. foldr f b (h :: t) = f h (foldr f b t)
⊦ ∀h t n. n < length t ⇒ nth (h :: t) (suc n) = nth t n
⊦ ∀h1 h2 t1 t2. h1 :: t1 = h2 :: t2 ⇔ h1 = h2 ∧ t1 = t2
⊦ ∀a b a' b'. (a, b) = (a', b') ⇔ a = a' ∧ b = b'
⊦ ∀l n. length l = suc n ⇔ ∃h t. l = h :: t ∧ length t = n
⊦ ∀f h1 h2 t1 t2.
length t1 = length t2 ⇒
zipWith f (h1 :: t1) (h2 :: t2) = f h1 h2 :: zipWith f t1 t2
⊦ unzip = foldr (λ(x, y) (xs, ys). (x :: xs, y :: ys)) ([], [])