Package list-filter: The list filter function

Information

namelist-filter
version1.28
descriptionThe list filter function
authorJoe Hurd <joe@gilith.com>
licenseMIT
requiresbool
function
natural
set
list-def
list-length
list-set
list-append
list-map
showData.Bool
Data.List
Function
Number.Natural
Set

Files

Defined Constant

Theorems

P. filter P [] = []

p l. length (filter p l) length l

p l. toSet (filter p l) toSet l

P l1 l2. filter P (l1 @ l2) = filter P l1 @ filter P l2

P f l. filter P (map f l) = map f (filter (P f) l)

P h t. filter P (h :: t) = if P h then h :: filter P t else filter P t

Input Type Operators

Input Constants

Assumptions

T

n. n n

s. s s

F p. p

n. n suc n

(¬) = λp. p F

() = λp. p ((select) p)

t. (x. t) t

() = λp. p = λx. T

t. T t t

l. [] @ l = l

f. map f [] = []

s t. s s t

s t. s t s

() = λp q. p q p

t1 t2. (if F then t1 else t2) = t2

t1 t2. (if T then t1 else t2) = t1

h t. length (h :: t) = suc (length t)

() = λ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)

x s. insert x s = insert x s

m n. suc m suc n m n

f g x. (f g) x = f (g x)

m n p. m n n p m p

l h t. (h :: t) @ l = h :: t @ l

s t u. s t t u s u

p. (x. y. p x y) y. x. p x (y x)

f h t. map f (h :: t) = f h :: map f t

s t u. s t u s u t u

P. P [] (a0 a1. P a1 P (a0 :: a1)) x. P x

p c x y. p (if c then x else y) (c p x) (¬c p y)

NIL' CONS'.
    fn. fn [] = NIL' a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)