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

Information

namelist-nub
version1.13
description Definitions and theorems about the list nub function
authorJoe Hurd <joe@gilith.com>
licenseMIT
showData.Bool
Data.List

Files

Defined Constants

Theorems

l. nub (nub l) = nub l

l. nubReverse (nubReverse l) = nubReverse l

l. toSet (nub l) = toSet l

l. toSet (nubReverse l) = toSet l

l. Number.Natural.≤ (length (nub l)) (length l)

l. Number.Natural.≤ (length (nubReverse l)) (length l)

l. nub l = reverse (nubReverse (reverse l))

l x. member x (nub l) member x l

l x. member x (nubReverse l) member x l

nubReverse [] = []
  h t.
    nubReverse (h :: t) =
    if member h t then nubReverse t else h :: nubReverse t

Input Type Operators

Input Constants

Assumptions

T

n. Number.Natural.≤ n n

F p. p

t. t ¬t

(~) = λp. p F

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

t. (x. t) t

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

x. x = x T

l. reverse (reverse l) = l

l. length (reverse l) = length l

() = λp q. p q p

t. (t T) (t F)

(¬T F) (¬F T)

x l. member x l Set.∈ x (toSet l)

l x. member x (reverse l) member x l

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

m n.
    Number.Natural.≤ (Number.Natural.suc m) (Number.Natural.suc n)
    Number.Natural.≤ m n

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

s t. s = t x. Set.∈ x s Set.∈ x t

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

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

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)

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

(m. Number.Natural.≤ m 0 m = 0)
  m n.
    Number.Natural.≤ m (Number.Natural.suc n)
    m = Number.Natural.suc n Number.Natural.≤ m n

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

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