Package list-reverse: The list reverse function
Information
name | list-reverse |
version | 1.28 |
description | The list reverse function |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool natural set list-def list-length list-set list-append list-map |
show | Data.Bool Data.List Number.Natural Set |
Files
- Package tarball list-reverse-1.28.tgz
- Theory 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
⊦ ∀f l. reverse (map f l) = map f (reverse l)
⊦ ∀l m. reverse (l @ m) = reverse m @ reverse l
⊦ ∀x l. reverse (x :: l) = reverse l @ x :: []
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ⊤
- List
- ::
- @
- []
- length
- map
- toSet
- Bool
- Number
- Natural
- +
- suc
- zero
- Natural
- Set
- ∅
- insert
- ∪
Assumptions
⊦ ⊤
⊦ length [] = 0
⊦ toSet [] = ∅
⊦ (∃) = λp. p ((select) p)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀m. m + 0 = m
⊦ ∀l. [] @ l = l
⊦ ∀l. l @ [] = l
⊦ ∀f. map f [] = []
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀s t. s ∪ t = t ∪ s
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ ∀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)
⊦ ∀l m. length (l @ m) = length l + length m
⊦ ∀l1 l2. toSet (l1 @ l2) = toSet l1 ∪ toSet l2
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀l m n. l @ m @ n = (l @ m) @ n
⊦ ∀p. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ ∀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 [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀NIL' CONS'.
∃fn. fn [] = NIL' ∧ ∀a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)