Package list-member: Definitions and theorems about the list member function

Information

namelist-member
version1.0
description Definitions and theorems about the list member function
authorJoe Hurd <joe@gilith.com>
licenseMIT
show Data.Bool
Data.List
Number.Natural
Number.Numeral

Files

Defined Constant

Theorems

l n. n < length l member (nth n l) l

P l. (x. member x l P x) all P l

P l. (x. P x member x l) exists P l

P l x. member x (filter P l) P x member x l

x l1 l2. member x (l1 @ l2) member x l1 member x l2

l x. member x l i. i < length l x = nth i l

f y l. member y (map f l) x. member x l y = f x

P Q l. (x. member x l P x Q x) all P l all Q l

P Q l. (x. member x l P x Q x) exists P l exists Q l

(x. member x [] F) h x t. member x (h :: t) x = h member x t

Input Type Operators

Input Constants

Assumptions

T

x. Function.id x = x

n. 0 < suc n

() = λP. P ((select) P)

t. (x. t) t

t. (x. t) t

t. (λx. t x) = t

() = λP. P = λx. T

x. x = x T

() = λp q. p q p

t. (t T) (t F)

(¬T F) (¬F T)

m. m = 0 n. m = suc n

() = λp q. (λf. f p q) = λf. f T T

P. ¬(x. P x) x. ¬P x

P. ¬(x. P x) x. ¬P x

() = λP. q. (x. P x q) q

m n. suc m < suc n m < n

() = λp q. r. (p r) (q r) r

P Q. P (x. Q x) x. P Q x

P Q. P (x. Q x) x. P Q x

P Q. (x. P x) Q x. P x Q

P Q. (x. P x) Q x. P x Q

t1 t2 t3. t1 t2 t3 (t1 t2) t3

P. (x. y. P x y) y. x. P x (y x)

length [] = 0 h t. length (h :: t) = suc (length t)

P. P 0 (n. P n P (suc n)) n. P n

(t. ¬¬t t) (¬T F) (¬F T)

P Q. (x. P x) (x. Q x) x. P x Q x

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)

(m. m < 0 F) m n. m < suc n m = n m < n

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

(P. all P [] T) h P t. all P (h :: t) P h all P t

(P. exists P [] F) h P t. exists P (h :: t) P h exists P t

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

(h t. nth 0 (h :: t) = h) h t n. nth (suc n) (h :: t) = nth n t

t. ((T t) t) ((t T) t) ((F t) ¬t) ((t F) ¬t)

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

t. (T t t) (t T t) (F t F) (t F F) (t t t)

t. (T t T) (t T T) (F t t) (t F t) (t t t)

t. (T t t) (t T T) (F t T) (t t T) (t F ¬t)

p q r.
    (p q q p) ((p q) r p q r) (p q r q p r)
    (p p p) (p p q p q)