Package list-nth-thm: Properties of the list nth function
Information
name | list-nth-thm |
version | 1.34 |
description | Properties of the list nth function |
author | Joe Hurd <joe@gilith.com> |
license | HOLLight |
provenance | HOL Light theory extracted on 2012-01-28 |
requires | bool natural set list-def list-thm list-length list-set list-append list-map list-quant list-last list-nth-def |
show | Data.Bool Data.List Number.Natural Set |
Files
- Package tarball list-nth-thm-1.34.tgz
- Theory file list-nth-thm.thy (included in the package tarball)
Theorems
⊦ ∀l i. i < length l ⇒ nth i l ∈ toSet l
⊦ ∀l. ¬(l = []) ⇒ last l = nth (length l - 1) l
⊦ ∀P l. all P l ⇔ ∀i. i < length l ⇒ P (nth i l)
⊦ ∀P l. exists P l ⇔ ∃i. i < length l ∧ P (nth i l)
⊦ ∀x l. x ∈ toSet l ⇔ ∃i. i < length l ∧ x = nth i l
⊦ ∀f l i. i < length l ⇒ nth i (map f l) = f (nth i l)
⊦ ∀l m.
length l = length m ∧ (∀i. i < length l ⇒ nth i l = nth i m) ⇒ l = m
⊦ ∀k l m.
k < length l + length m ⇒
nth k (l @ m) = if k < length l then nth k l else nth (k - length l) m
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- F
- T
- List
- ::
- @
- []
- all
- exists
- last
- length
- map
- nth
- toSet
- Bool
- Number
- Natural
- +
- -
- <
- ≤
- bit0
- bit1
- suc
- zero
- Natural
- Set
- ∅
- insert
- ∈
Assumptions
⊦ T
⊦ ¬F ⇔ T
⊦ ¬T ⇔ F
⊦ length [] = 0
⊦ bit0 0 = 0
⊦ toSet [] = ∅
⊦ ∀t. t ⇒ t
⊦ F ⇔ ∀p. p
⊦ ∀x. ¬(x ∈ ∅)
⊦ ∀n. ¬(n < n)
⊦ ∀n. 0 < suc n
⊦ ∀n. n < suc n
⊦ (¬) = λp. p ⇒ F
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ ∀t. F ∧ t ⇔ F
⊦ ∀t. T ∧ t ⇔ t
⊦ ∀t. t ∧ T ⇔ t
⊦ ∀t. F ⇒ t ⇔ T
⊦ ∀t. T ⇒ t ⇔ t
⊦ ∀t. t ⇒ T ⇔ T
⊦ ∀t. T ∨ t ⇔ T
⊦ ∀n. ¬(suc n = 0)
⊦ ∀m. m < 0 ⇔ F
⊦ ∀m. m - 0 = m
⊦ ∀n. n - n = 0
⊦ ∀l. [] @ l = l
⊦ ∀n. bit1 n = suc (bit0 n)
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀n. suc n - 1 = n
⊦ ∀t1 t2. (if F then t1 else t2) = t2
⊦ ∀t1 t2. (if T then t1 else t2) = t1
⊦ ∀h t. ¬(h :: t = [])
⊦ ∀l. length l = 0 ⇔ l = []
⊦ ∀x y. x = y ⇒ y = x
⊦ ∀h t. nth 0 (h :: t) = h
⊦ ∀l f. length (map f l) = length l
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀m n. ¬(m < n) ⇔ n ≤ m
⊦ ∀m. m = 0 ∨ ∃n. m = suc n
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀h t. toSet (h :: t) = insert h (toSet t)
⊦ ∀m n. suc m + n = suc (m + n)
⊦ ∀m n. suc m = suc n ⇔ m = n
⊦ ∀m n. suc m < suc n ⇔ m < n
⊦ ∀l m. length (l @ m) = length l + length m
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀p. (∀x y. p x y) ⇔ ∀y x. p x y
⊦ ∀h t. last (h :: t) = if t = [] then h else last t
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀P l. all P l ⇔ ∀x. x ∈ toSet l ⇒ P x
⊦ ∀P l. exists P l ⇔ ∃x. x ∈ toSet l ∧ P x
⊦ ∀m n. n ≤ m ⇒ suc m - suc n = m - n
⊦ ∀f h t. map f (h :: t) = f h :: map f t
⊦ ∀P. P 0 ∧ (∀n. P n ⇒ P (suc n)) ⇒ ∀n. P n
⊦ ∀x y s. x ∈ insert y s ⇔ x = y ∨ x ∈ s
⊦ ∀P. P [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀h t n. n < length t ⇒ nth (suc n) (h :: t) = nth n t
⊦ ∀h1 h2 t1 t2. h1 :: t1 = h2 :: t2 ⇔ h1 = h2 ∧ t1 = t2
⊦ ∀p c x y. p (if c then x else y) ⇔ (c ⇒ p x) ∧ (¬c ⇒ p y)