Package list-reverse: The list reverse function
Information
name | list-reverse |
version | 1.50 |
description | The list reverse function |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | MIT |
checksum | cc941ee3d2f427d68c5dd191d8591b63ec30fc0b |
requires | bool list-append list-def list-length list-map list-set natural set |
show | Data.Bool Data.List Number.Natural Set |
Files
- Package tarball list-reverse-1.50.tgz
- Theory source file list-reverse.thy (included in the package tarball)
Defined Constant
- Data
- List
- reverse
- List
Theorems
⊦ reverse [] = []
⊦ ∀l. reverse (reverse l) = l
⊦ ∀l. length (reverse l) = length l
⊦ ∀l. toSet (reverse l) = toSet l
⊦ ∀l. reverse l = [] ⇔ l = []
⊦ ∀l x. member x (reverse l) ⇔ member x l
⊦ ∀f l. reverse (map f l) = map f (reverse l)
⊦ ∀l1 l2. reverse (l1 @ l2) = reverse l2 @ reverse l1
⊦ ∀h t. reverse (h :: t) = reverse t @ h :: []
External Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
External Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- ⊥
- ⊤
- List
- ::
- @
- []
- length
- map
- member
- toSet
- Bool
- Number
- Natural
- +
- suc
- zero
- Natural
- Set
- ∅
- insert
- ∈
- ∪
Assumptions
⊦ ⊤
⊦ ¬⊥ ⇔ ⊤
⊦ ¬⊤ ⇔ ⊥
⊦ length [] = 0
⊦ toSet [] = ∅
⊦ ⊥ ⇔ ∀p. p
⊦ ∀t. t ∨ ¬t
⊦ (¬) = λp. p ⇒ ⊥
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ ∀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 ∨ ⊥ ⇔ t
⊦ ∀t. t ∨ ⊤ ⇔ ⊤
⊦ ∀m. m + 0 = m
⊦ ∀l. [] @ l = l
⊦ ∀l. l @ [] = l
⊦ ∀f. map f [] = []
⊦ ∀t. (⊥ ⇔ t) ⇔ ¬t
⊦ ∀t. t ⇒ ⊥ ⇔ ¬t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ ⊤) ∨ (t ⇔ ⊥)
⊦ ∀t1 t2. t1 ∨ t2 ⇔ t2 ∨ t1
⊦ ∀s t. s ∪ t = t ∪ s
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀l x. member x l ⇔ x ∈ toSet l
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ ∀p. ¬(∀x. p x) ⇔ ∃x. ¬p x
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀h t. toSet (h :: t) = insert h (toSet t)
⊦ ∀x s. insert x ∅ ∪ s = insert x s
⊦ ∀m n. m + suc n = suc (m + n)
⊦ ∀l1 l2. length (l1 @ l2) = length l1 + length l2
⊦ ∀l1 l2. toSet (l1 @ l2) = toSet l1 ∪ toSet l2
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀t1 t2 t3. (t1 ∨ t2) ∨ t3 ⇔ t1 ∨ t2 ∨ t3
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀l1 l2 l3. l1 @ l2 @ l3 = (l1 @ l2) @ l3
⊦ ∀f h t. map f (h :: t) = f h :: map f t
⊦ ∀f l1 l2. map f (l1 @ l2) = map f l1 @ map f l2
⊦ ∀p. p [] ∧ (∀h t. p t ⇒ p (h :: t)) ⇒ ∀l. p l
⊦ ∀b f. ∃fn. fn [] = b ∧ ∀h t. fn (h :: t) = f h t (fn t)