Package base: The standard theory library

Information

namebase
version1.221
descriptionThe standard theory library
authorJoe Leslie-Hurd <joe@gilith.com>
licenseMIT
homepagehttp://opentheory.gilith.com/?pkg=base
haskell-nameopentheory
haskell-int-filehaskell.int
haskell-src-filehaskell.art
haskell-test-filehaskell-test.art
haskell-equality-type"Data.List.list"
haskell-equality-type"Data.Option.option"
haskell-equality-type"Data.Pair.*"
haskell-equality-type"Data.Sum.+"
haskell-equality-type"Number.Natural.natural"
haskell-arbitrary-type"Data.List.list"
haskell-arbitrary-type"Data.Option.option"
haskell-arbitrary-type"Data.Pair.*"
haskell-arbitrary-type"Data.Sum.+"
haskell-arbitrary-type"Number.Natural.natural"
checksumc99d46f5eb8b4efbb089cea1e94b690a3c7f2824
showData.Bool
Data.List
Data.Option
Data.Pair
Data.Sum
Data.Unit
Function
Number.Natural
Number.Real
Relation
Set

Files

Defined Type Operators

Defined Constants

Theorems

null []

isNone none

even 0

irreflexive empty

irreflexive isSuc

reflexive universe

transitive empty

transitive universe

transitive (<)

wellFounded empty

wellFounded (<)

wellFounded isSuc

finite

finite universe

infinite universe

¬isSome none

¬odd 0

subrelation isSuc (<)

id = λx. x

¬(universe = )

const = λx y. x

empty = fromSet

universe = fromSet universe

¬

¬

length [] = 0

bit0 0 = 0

size = 0

concat [] = []

nubReverse [] = []

reverse [] = []

toSet [] =

bigIntersect = universe

bigUnion =

bigUnion universe = universe

transitiveClosure isSuc = (<)

map id = id

map id = id

a. isSome (some a)

a. isLeft (left a)

x. x = x

x. x universe

b. isRight (right b)

t. t t

v. v = ()

n. 0 n

n. n n

x. x x

l. finite (toSet l)

s. disjoint s

s. disjoint s

s. s

s. s universe

s. s s

p. all p []

m. wellFounded (measure m)

r. transitive (transitiveClosure r)

r. subrelation r r

p. p

(minimal n. ) = 0

fromPredicate (λx. ) =

fromPredicate (λx. ) = universe

l. all (λx. ) l

hasSize universe 2

finite universe finite universe

infinite universe infinite universe

factorial 0 = 1

zip [] [] = []

cross universe universe = universe

a. ¬isNone (some a)

a. ¬isRight (left a)

x. ¬member x []

x. ¬(x )

a. finite (insert a )

x. id x = x

b. ¬isLeft (right b)

t. t ¬t

m. ¬(m < 0)

n. ¬(n < n)

n. 0 < factorial n

n. 0 < suc n

n. n < suc n

n. n suc n

s. ¬(universe s)

s. ¬(s )

s. ¬(s s)

p. ¬any p []

r. subrelation r (transitiveClosure r)

(¬) = λp. p

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

x y. universe x y

a. x. x = a

a. ∃!x. x = a

t. (x. t) t

t. (x. t) t

t. (λx. t x) = t

f g. f = g

(λp. p) = λp. p

() = λp. p = λx.

Combinator.w = λf x. f x x

unzip [] = ([], [])

a. ¬(some a = none)

a. destLeft (left a) = a

x. replicate x 0 = []

x. delete x =

x. insert x universe = universe

b. destRight (right b) = b

t. ¬¬t t

t. ( t) t

t. (t ) t

t. t

t. t t

t. t

t. t t

t. t t t

t. t

t. t t

t. t

t. t t

t. t

t. t t

t. t

t. t t t

n. ¬(factorial n = 0)

n. ¬(suc n = 0)

n. n n * n

n. even n odd n

n. 1 factorial n

n. pre (suc n) = n

n. 0 * n = 0

m. m * 0 = 0

n. 0 + n = n

m. m + 0 = m

m. m - 0 = m

n. n - n = 0

n. distance 0 n = n

n. distance n 0 = n

n. distance n n = 0

n. max 0 n = n

n. max n 0 = n

n. max n n = n

n. min 0 n = 0

n. min n 0 = 0

n. min n n = n

m. interval m 0 = []

n. id n = id

l. reverse (reverse l) = l

l. [] @ l = l

l. l @ [] = l

l. drop 0 l = l

l. take 0 l = []

s. \ s =

s. s \ = s

s. s \ universe =

s. s \ s =

s. image id s = s

s. s =

s. universe s = s

s. s =

s. s universe = s

s. s s = s

s. s = s

s. universe s = universe

s. s = s

s. s universe = universe

s. s s = s

s. cross s =

s. cross s =

f. f 0 = id

f. map f [] = []

f. map f none = none

f. image f =

x. Combinator.s const x = id

f. f id = f

f. id f = f

p. filter p [] = []

s. toSet (fromSet s) = s

r. wellFounded r irreflexive r

f. flip (flip f) = f

r. fromSet (toSet r) = r

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

flip = λf x y. f y x

x y. ¬empty x y

e. fn. fn () = e

e. ∃!fn. fn () = e

l. map (λx. x) l = l

s. image (λx. x) s = s

universe = insert (insert )

size = fold (λx n. suc n) 0

t1 t2. (let x t2 in t1) = t1

x. hasSize (insert x ) 1

x. last (x :: []) = x

t. ( t) ¬t

t. (t ) ¬t

t. t ¬t

n. ¬(even n odd n)

n. even (2 * n)

n. bit1 n = suc (bit0 n)

n. ¬even n odd n

n. ¬odd n even n

m. m 0 = 1

m. m * 1 = m

n. n 1 = n

n. n div 1 = n

n. n mod 1 = 0

m. 1 * m = m

x. 0 + x = x

l. null l l = []

l. length (reverse l) = length l

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. toSet (reverse l) = toSet l

l. length (nub l) length l

l. length (nubReverse l) length l

l. size (toSet l) length l

l. drop (length l) l = []

l. take (length l) l = l

l. case [] (::) l = l

l. foldr (::) [] l = l

x. case none some x = x

s. infinite s ¬finite s

s. bigIntersect (insert s ) = s

s. bigUnion (insert s ) = s

f. f 1 = f

x. case left right x = x

f. zipWith f [] [] = []

f. injective f ¬surjective f

Combinator.s = λf g x. f x (g x)

x y. const x y = x

h t. ¬null (h :: t)

x s. x insert x s

x s. delete s x s

x. (select y. y = x) = x

m n. m m + n

m n. m max m n

m n. n m + n

m n. n max m n

m n. min m n m

m n. min m n n

l. all (λx. ) l null l

s t. disjoint s (t \ s)

s t. s s t

s t. s t s

s t. disjoint (t \ s) s

s t. s \ t s

s t. s t s

s t. t s s

p. p () x. p x

p. (x. p x) p ()

p. (x. p x) p ()

() = λp q. p q p

finite universe finite universe finite universe

infinite universe infinite universe infinite universe

finite universe finite universe finite universe

x. size (insert x ) = 1

t. (t ) (t )

n. odd (suc (2 * n))

n. n < 2 n

m. suc m = m + 1

n. even (suc n) ¬even n

n. odd (suc n) ¬odd n

m. m 0 m = 0

n. 1 n = 1

n. suc n - 1 = n

x. x 0 = 1

x. ~x + x = 0

x. 1 * x = x

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

l. length l = 0 null l

l. toSet l = null l

s. finite s hasSize s (size s)

s. rest s = delete s (choice s)

s. infinite s ¬(s = )

s. disjoint s s s =

s. hasSize s 0 s =

s. universe s s = universe

s. s s =

s. universe \ (universe \ s) = s

l. null (concat l) all null l

x. (fst x, snd x) = x

s. bigUnion (delete s ) = bigUnion s

s. bigUnion (insert s) = bigUnion s

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

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

a b. ¬(left a = right b)

a b. fst (a, b) = a

a b. snd (a, b) = b

x n. length (replicate x n) = n

h t. ¬(h :: t = [])

h t. head (h :: t) = h

h t. tail (h :: t) = t

x s. ¬(insert x s = )

b f. case b f none = b

b f. case b f [] = b

b t. (if b then t else t) = t

m n. ¬(m + n < m)

m n. ¬(n + m < m)

m n. length (interval m n) = n

p x. p x p ((select) p)

r x. reflexive r r x x

r. reflexive r x. r x x

f b. foldr f b [] = b

f b. foldl f b [] = b

n. 0 < n ¬(n = 0)

n. bit0 (suc n) = suc (suc (bit0 n))

l. length l = 0 l = []

l. reverse l = [] l = []

l. toSet l = l = []

l. foldl (flip (::)) [] l = reverse l

s. finite s toSet (fromSet s) = s

f y. (let x y in f x) = f y

x. a b. x = (a, b)

s. bigIntersect s = fromSet (bigIntersect (image toSet s))

s. bigUnion s = fromSet (bigUnion (image toSet s))

x y. x = y y = x

x y. x = y y = x

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

x s. finite s finite (insert x s)

t1 t2. t1 t2 t2 t1

t1 t2. t1 t2 t2 t1

a b. (a b) a b

m n. m > n n < m

m n. m n n m

m n. m * n = n * m

m n. m + n = n + m

m n. distance m n = distance n m

m n. max m n = max n m

m n. min m n = min n m

m n. m = n m n

m n. m < n m n

m n. m < n n m

m n. m n n < m

m n. m n n m

m n. distance m n m + n

m n. distance m (m + n) = n

m n. m + n - m = n

m n. m + n - n = m

m n. distance (m + n) m = n

m n. n * (m div n) m

x y. x > y y < x

x y. x y y x

x y. x * y = y * x

x y. x + y = y + x

x y. x y y x

s x. finite s finite (delete s x)

s x. finite (delete s x) finite s

s x. finite (insert x s) finite s

s t. finite s finite (s \ t)

s t. disjoint s t disjoint t s

s t. s t = t s

s t. s t = t s

s t. s t s t

s. (x. x s) s = universe

s. finite s a. ¬(a s)

f l. null (map f l) null l

f l. length (map f l) = length l

f s. finite s finite (image f s)

p x. x fromPredicate p p x

p l. length (filter p l) length l

f x. Combinator.w f x = f x x

r x. irreflexive r ¬r x x

r x. wellFounded r ¬r x x

r. irreflexive r x. ¬r x x

= { x. x | }

universe = { x. x | }

n. factorial (suc n) = suc n * factorial n

n. n 2 = n * n

n. 2 * n = n + n

s. finite s length (fromSet s) = size s

s. ¬(s = ) choice s s

x n. null (replicate x n) n = 0

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

m n. ¬(m < n n < m)

m n. ¬(m < n n m)

m n. ¬(m n n < m)

m n. isSuc m n suc m = n

m n. m < n ¬(m = n)

m n. ¬(m < n) n m

m n. ¬(m n) n < m

m n. m < suc n m n

m n. suc m n m < n

m. m = 0 n. m = suc n

x y. x < y ¬(y x)

x y. x - y = x + ~y

l x. member x l x toSet l

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

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

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

l1 l2. foldr (::) l2 l1 = l1 @ l2

l1 l2. drop (length l1) (l1 @ l2) = l2

l1 l2. take (length l1) (l1 @ l2) = l1

l1 l2. zip l1 l2 = zipWith , l1 l2

x. x = none a. x = some a

s n. hasSize s n size s = n

s. singleton s x. s = insert x

s. s universe x. ¬(x s)

s. (x. x s) ¬(s = )

f a. map f (some a) = some (f a)

p. (b. p b) p p

p. (b. p b) p p

p. p p x. p x

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

n. even n n mod 2 = 0

n. ¬(n = 0) 0 div n = 0

n. ¬(n = 0) 0 mod n = 0

n. ¬(n = 0) n mod n = 0

f. surjective f y. x. y = f x

p. (x. ¬p x) ¬x. p x

p. (x. ¬p x) ¬x. p x

p. ¬(x. p x) x. ¬p x

p. ¬(x. p x) x. ¬p x

l. unzip l = (map fst l, map snd l)

r. subrelation isSuc r transitive r subrelation (<) r

() = λp. q. (x. p x q) q

x y. x insert y x = y

a b. some a = some b a = b

a b. left a = left b a = b

h t. toSet (h :: t) = insert h (toSet t)

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

x s. x s insert x s = s

x s. s \ insert x = delete s x

x s. insert x (insert x s) = insert x s

x s. delete (delete s x) x = delete s x

x s. insert x s = insert x s

a b. right a = right b a = b

p q. (q p) ¬p ¬q

t1 t2. ¬(t1 t2) t1 ¬t2

t1 t2. (¬t1 ¬t2) t1 t2

t1 t2. ¬t1 ¬t2 t2 t1

m n. m < n m div n = 0

m n. m < n m mod n = m

m n. m n factorial m factorial n

m n. m + suc n = suc (m + n)

m n. suc m + n = suc (m + n)

m n. m < m + n 0 < n

m n. n < m + n 0 < m

m n. suc m = suc n m = n

m n. fromNatural m = fromNatural n m = n

m n. suc m < suc n m < n

m n. suc m suc n m n

m n. fromNatural m fromNatural n m n

m n. m + n = m n = 0

m n. m + n = n m = 0

m n. distance m n = 0 m = n

m n. m + n m n = 0

m n. n + m m n = 0

m n. distance (suc m) (suc n) = distance m n

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

s x. insert x s x s

s t. disjoint s t s t =

s t. s t s t = s

s t. s t s t = t

s t. s \ t = s t

s t. s \ t = s disjoint s t

s t. t (s \ t) = t s

s t. s \ t \ t = s \ t

s t. s \ t t = s t

s t. finite t s t finite s

s t. infinite s s t infinite t

s u. bigIntersect (insert s u) = s bigIntersect u

s u. bigUnion (insert s u) = s bigUnion u

f l. reverse (map f l) = map f (reverse l)

f l. toSet (map f l) = image f (toSet l)

f l. map f l = [] l = []

f s. image f s = s =

s t. s t bigIntersect t bigIntersect s

f g. f g bigUnion f bigUnion g

r s. subrelation r s wellFounded s wellFounded r

r s. subrelation r s toSet r toSet s

r s. toSet r = toSet s r = s

{ m. m | m < 0 } =

b f a. case b f (some a) = f a

n. finite { m. m | m < n }

n. finite { m. m | m n }

n. odd n n mod 2 = 1

n. 0 n = if n = 0 then 1 else 0

n. ¬(n = 0) n div n = 1

k. 1 < k log k 1 = 0

x. abs x = if 0 x then x else ~x

l. ¬null l head l :: tail l = l

l. ¬(l = []) head (reverse l) = last l

l. ¬(l = []) last (reverse l) = head l

s. finite s (size s = 0 s = )

f g a. case f g (left a) = f a

f g b. case f g (right b) = g b

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

f x y. flip f x y = f y x

x n. replicate x (suc n) = x :: replicate x n

h t. take 1 (h :: t) = h :: []

x s. disjoint s (insert x ) ¬(x s)

x s. delete s x = s ¬(x s)

x s. disjoint (insert x ) s ¬(x s)

t1 t2. ¬(t1 t2) ¬t1 ¬t2

t1 t2. ¬(t1 t2) ¬t1 ¬t2

m n. max m n = if m n then n else m

m n. min m n = if m n then m else n

m n. even (m * n) even m even n

m n. even (m + n) even m even n

m n. odd (m * n) odd m odd n

m n. m * suc n = m + m * n

m n. m suc n = m * m n

m n. suc m * n = m * n + n

m n. ¬(n = 0) m mod n < n

m n. ¬(n = 0) m div n m

m n. ¬(n = 0) m mod n m

m n. max (suc m) (suc n) = suc (max m n)

m n. min (suc m) (suc n) = suc (min m n)

m n. fromNatural m * fromNatural n = fromNatural (m * n)

m n. fromNatural m + fromNatural n = fromNatural (m + n)

m n. map suc (interval m n) = interval (suc m) n

n. even n m. n = 2 * m

x n. x suc n = x * x n

m n. max m n = if m n then n else m

m n. min m n = if m n then m else n

l1 l2. null (l1 @ l2) null l1 null l2

l1 l2. length (l1 @ l2) = length l1 + length l2

l1 l2. reverse (l1 @ l2) = reverse l2 @ reverse l1

l1 l2. toSet (l1 @ l2) = toSet l1 toSet l2

l1 l2. foldl (flip (::)) l2 l1 = reverse l1 @ l2

s t. finite (s t) finite s finite t

s t. finite s finite t finite (s t)

s t. infinite s finite t infinite (s \ t)

s t. finite s finite t finite (s t)

s t. bigIntersect (insert s (insert t )) = s t

s t. bigUnion (insert s (insert t )) = s t

s t. finite s finite t finite (cross s t)

f n. f suc n = f f n

f n. f suc n = f n f

f x. image f (insert x ) = insert (f x)

f s. finite s size (image f s) size s

f s. image f (bigUnion s) = bigUnion (image (image f) s)

f s. image f (bigIntersect s) bigIntersect (image (image f) s)

f g. map f map g = map (f g)

f g. map f map g = map (f g)

s t. bigIntersect (s t) = bigIntersect s bigIntersect t

s t. bigUnion (s t) = bigUnion s bigUnion t

r s. intersect r s = fromSet (toSet r toSet s)

r s. union r s = fromSet (toSet r toSet s)

r m. wellFounded r wellFounded (λx y. r (m x) (m y))

p. (x. p x) a b. p (a, b)

p. (x. p x) a b. p (a, b)

p. (a b. p (a, b)) x. p x

a b. f. f = a f = b

m n. m n d. n = m + d

a b. (n. a * n b) a = 0

n. ¬(n = 0) pre n = n - 1

n. n mod 2 = if even n then 0 else 1

n. hasSize { m. m | m < n } n

l. l = [] h t. l = h :: t

s t x. s t s insert x t

s. { x. x | x s } = s

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

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

p a. (x. a = x p x) p a

p a. (x. x = a p x) p a

p a. (x. a = x p x) p a

p a. (x. x = a p x) p a

p l. ¬all p l any (λx. ¬p x) l

p l. ¬any p l all (λx. ¬p x) l

p l. ¬all (λx. ¬p x) l any p l

p l. ¬any (λx. ¬p x) l all p l

x. (a. x = left a) b. x = right b

p. p none (a. p (some a)) x. p x

f g x. Combinator.s f g x = f x (g x)

p. (f. p f) f. p (λa b. f (a, b))

p. (f. p f) f. p (λa b. f (a, b))

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

h t. last (h :: t) = if null t then h else last t

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

x s. x s insert x (delete s x) = s

m n. m n m < n m = n

m n. n m n + (m - n) = m

m n. n m m - n + n = m

m n. m < n n < m m = n

m n. odd (m + n) ¬(odd m odd n)

m n. odd (m n) odd m n = 0

m n. interval m (suc n) = m :: interval (suc m) n

m n. m n n m m = n

n l. n length l length (take n l) = n

n. odd n m. n = suc (2 * m)

x y. x y y x x = y

l k. foldl (λn x. suc n) k l = length l + k

l k. foldr (λx n. suc n) k l = length l + k

s n. hasSize s n finite s size s = n

s t. s t t s s = t

s t. s (t \ s) = t s t

s t. t \ s s = t s t

s t. s t t s s = t

s t. bijections s t = injections s t surjections s t

s. finite s x. member x (fromSet s) x s

r s.
    subrelation r s transitive s subrelation (transitiveClosure r) s

f. fn. a b. fn (a, b) = f a b

r s. subrelation r s subrelation s r r = s

finite universe finite universe
  size universe = size universe size universe

{ m. m | m 0 } = insert 0

{ s. s | s } = insert

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

p q. (x. p q) (x. p) x. q

p q. (x. p q) (x. p) x. q

p q. (x. p q) (x. p) x. q

p q. (x. p q) (x. p) x. q

p q. (x. p) (x. q) x. p q

p q. (x. p) (x. q) x. p q

m n. m < n d. n = m + suc d

k n. 1 < k m. n k m

n. size { m. m | m < n } = n

l. ¬null l length (tail l) = length l - 1

s. finite s a. x. x s x a

s. infinite s N. n. N n n s

f x n. map f (replicate x n) = replicate (f x) n

f s x. x s f x image f s

p l. (x. member x l p x) all p l

p l. (x. member x l p x) any p l

m x y. measure m x y m x < m y

s x y. fromSet s x y (x, y) s

r. wellFounded r ¬f. n. r (f (suc n)) (f n)

r x y. (x, y) toSet r r x y

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

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

x s. delete (insert x s) x = s ¬(x s)

p q. (x. p q x) p x. q x

p q. (x. p q x) p x. q x

p q. (x. p q x) p x. q x

p q. (x. p q x) p x. q x

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

p q. p (x. q x) x. p q x

m n. m < n m n ¬(m = n)

m n. even (m n) even m ¬(n = 0)

m n. m < suc n m = n m < n

m n. ¬(m = 0) m * n div m = n

m n. ¬(m = 0) m * n mod m = 0

k m. 1 < k log k (k m) = m

l1 l2. last (l1 @ l2) = if null l2 then last l1 else last l2

s t. s t s t ¬(s = t)

s t. s t s t ¬(t s)

a b. a b finite b size a < size b

a b. a b finite b size a size b

s t. image fst (cross s t) = if t = then else s

s t. image snd (cross s t) = if s = then else t

p q. (x. p x q) (x. p x) q

p q. (x. p x q) (x. p x) q

p q. (x. p x q) (x. p x) q

p q. (x. p x q) (x. p x) q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

p q. (x. p x) q x. p x q

p. (∃!x. p x) x. y. p y x = y

s. bigIntersect s = universe t. t s t = universe

s. bigUnion s = t. t s t =

p. (x y. p x y) z. p (fst z) (snd z)

p. (x y. p x y) z. p (fst z) (snd z)

x y z. x = y y = z x = z

x1 x2 l. last (x1 :: x2 :: l) = last (x2 :: l)

x y s. insert x (insert y s) = insert y (insert x s)

x y s. delete (delete s x) y = delete (delete s y) x

x n i. i < n nth (replicate x n) i = x

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

x s t. s insert x t delete s x t

x s t. insert x s t = insert x (s t)

a. { x. x | x = a } = insert a

p q r. p q r p q r

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

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

x y n. x y x n y n

m n p. distance m p distance m n + distance n p

m n p. m * (n * p) = n * (m * p)

m n p. m * (n * p) = m * n * p

m n p. m + (n + p) = m + n + p

m n p. m (n * p) = (m n) p

a b n. b < a * n b div a < n

m n p. m + n = m + p n = p

p m n. m + p = n + p m = n

m n p. m + n < m + p n < p

m n p. n + m < p + m n < p

m n p. m + n m + p n p

m n p. n + m p + m n p

m n p. distance (m + n) (m + p) = distance n p

p m n. distance (m + p) (n + p) = distance m n

m n p. (m * n + p) mod n = p mod n

m n p. m < n n < p m < p

m n p. m < n n p m < p

m n p. m n n < p m < p

m n p. m n n p m p

x y z. y z x + y x + z

x y z. x * (y * z) = x * y * z

x y z. x + (y + z) = x + y + z

x y z. x y y z x z

x. ¬(x = 0) inv x * x = 1

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

l1 l2 l3. l1 @ l2 @ l3 = (l1 @ l2) @ l3

l l1 l2. l @ l1 = l @ l2 l1 = l2

l l1 l2. l1 @ l = l2 @ l l1 = l2

l l1 l2. l @ l1 = l @ l2 l1 = l2

l l1 l2. l1 @ l = l2 @ l l1 = l2

l. ¬null l nth l (length l - 1) = last l

s c. image (λx. c) s = if s = then else insert c

s t x. disjoint (delete s x) t disjoint (delete t x) s

s t x. s \ insert x t = delete s x \ t

s t x. delete s x t = delete (s t) x

s t u. s t u s \ t u

s t u. s t u s \ u t

t u s. s \ t \ u = s \ (t u)

t u s. s \ t \ u = s \ u \ t

s t u. s t u = s (t u)

s t u. s t u = s (t u)

s t u. s t t u s u

s t u. s t t u s u

s t u. s t t u s u

s t u. s t t u s u

s t. s t x. x s x t

s t. (x. x s x t) s = t

s t. (x. x s x t) s = t

s. finite s finite { t. t | t s }

s. finite { t. t | t s } finite s

f n x. (f suc n) x = f ((f n) x)

f n x. (f suc n) x = (f n) (f x)

f m n. f (m * n) = (f m) n

f s t. s t image f s image f t

f g x. isLeft x case f g x = f (destLeft x)

f g x. isRight x case f g x = g (destRight x)

p x. (y. p y y = x) (select) p = x

p l. all p l x. x toSet l p x

p l. any p l x. x toSet l p x

f g l. map (f g) l = map f (map g l)

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

f g s. image (f g) s = image f (image g s)

p f l. all p (map f l) all (p f) l

p f l. any p (map f l) any (p f) l

f g h. f (g h) = f g h

f g h. f g h = f (g h)

r x y. wellFounded r ¬(r x y r y x)

f b l. foldr f b (reverse l) = foldl (flip f) b l

r s t. subrelation r s subrelation s t subrelation r t

r. (x. y. r x y) f. x. r x (f x)

p. (x. ∃!y. p x y) ∃!f. x. p x (f x)

f b l. foldl f b l = foldr (flip f) b (reverse l)

f b l. foldl f b (reverse l) = foldr (flip f) b l

p. (f. p f) g h. p (λa. (g a, h a))

p. (f. p f) g h. p (λa. (g a, h a))

x y. zip (x :: []) (y :: []) = (x, y) :: []

x y. cross (insert x ) (insert y ) = insert (x, y)

x n. toSet (replicate x n) = if n = 0 then else insert x

b f h t. case b f (h :: t) = f h t

b f g. (λx. if b then f x else g x) = if b then f else g

m n. n < m m - suc n = pre (m - n)

m n. n < m suc (m - suc n) = m - n

m n. n m suc (m - n) = suc m - n

m n. n m (m - n = 0 m = n)

m n. n m pre (suc m - n) = m - n

m n. n m suc m - suc n = m - n

m n. m suc n m = suc n m n

m n. 0 < m * n 0 < m 0 < n

m n. m * n = 0 m = 0 n = 0

m n. m + n = 0 m = 0 n = 0

m n. max m n = 0 m = 0 n = 0

m n. hasSize universe m hasSize universe n hasSize universe (n m)

m n. distance (distance m n) (distance m (n + 1)) = 1

l1 l2. l1 @ l2 = [] l1 = [] l2 = []

xs ys. length xs = length ys map fst (zip xs ys) = xs

xs ys. length xs = length ys map snd (zip xs ys) = ys

s t. s t = s = t =

s t. cross s t = s = t =

s. finite s (finite (bigUnion s) t. t s finite t)

s. finite (bigUnion s) finite s t. t s finite t

p. (a. p (left a)) (b. p (right b)) x. p x

n. hasSize { m. m | m n } (n + 1)

s t. disjoint s t ¬x. x s x t

s t. disjoint s (bigUnion t) x. x t disjoint s x

t u. t bigIntersect u s. s u t s

s. finite s toSet (fromSet s) = s length (fromSet s) = size s

s. bigUnion { x. insert x | x s } = s

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

f x s. image f (insert x s) = insert (f x) (image f s)

f. injective f x1 x2. f x1 = f x2 x1 = x2

p h t. all p (h :: t) p h all p t

p h t. any p (h :: t) p h any p t

p l x. member x (filter p l) member x l p x

p. p 0 (n. p n p (suc n)) n. p n

s x. x bigIntersect s t. t s x t

s x. x bigUnion s t. t s x t

f t. bigUnion f t s. s f s t

u s. (t. t u t s) bigIntersect u s

p l. (x. all (p x) l) all (λy. x. p x y) l

p l. (x. any (p x) l) any (λy. x. p x y) l

r s. subrelation r (bigIntersect s) t. t s subrelation r t

x s. x rest s x s ¬(x = choice s)

b f. fn. fn none = b a. fn (some a) = f a

m n. distance m n = if m n then n - m else m - n

m n. n m (even (m - n) even m even n)

n m. ¬(n = 0) m mod n mod n = m mod n

m n. ¬(n = 0) (m div n = 0 m < n)

m n. m = m * n m = 0 n = 1

m n. m = n * m m = 0 n = 1

n x. 0 < x n ¬(x = 0) n = 0

m n. m * n = m m = 0 n = 1

m n. n * m = m m = 0 n = 1

m n. m n = 0 m = 0 ¬(n = 0)

n l. n length l length (drop n l) = length l - n

n l. n length l n + length (drop n l) = length l

n l. n length l take n l @ drop n l = l

x y. ¬(y = 0) x / y = x * inv y

s. finite s size s 1 a. s insert a

p x. x { y. y | p y } p x

l xs. unzip l = (xs, []) l = [] xs = []

l ys. unzip l = ([], ys) l = [] ys = []

r p. wellFounded r wellFounded (λx y. p x p y r x y)

r s. subrelation r s x y. r x y s x y

r s. (x y. r x y s x y) r = s

p. (f g. p f g) h. p (fst h) (snd h)

p. (f g. p f g) h. p (fst h) (snd h)

x h t. member x (h :: t) x = h member x t

x y s. x insert y s x = y x s

x m n. replicate x (m + n) = replicate x m @ replicate x n

x s t. insert x s t x t s t

b t1 t2. (if b then t1 else t2) (¬b t1) (b t2)

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

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

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

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

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

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

m n x. m n take m (replicate x n) = replicate x m

m n i. i < n nth (interval m n) i = m + i

m n p. m < max n p m < n m < p

m n p. m < min n p m < n m < p

m n p. m max n p m n m p

m n p. m min n p m n m p

m n p. max n p < m n < m p < m

m n p. min n p < m n < m p < m

m n p. max n p m n m p m

m n p. min n p m n m p m

m n p. m * (n + p) = m * n + m * p

m n p. m * distance n p = distance (m * n) (m * p)

m n p. m (n + p) = m n * m p

m n p. (m + n) * p = m * p + n * p

p m n. distance m n * p = distance (m * p) (n * p)

p m n. (m * n) p = m p * n p

m n p. max (m + n) (m + p) = m + max n p

m n p. max (n + m) (p + m) = max n p + m

m n p. min (m + n) (m + p) = m + min n p

m n p. min (n + m) (p + m) = min n p + m

n. size { m. m | m n } = n + 1

x y z. x * (y + z) = x * y + x * z

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

s t x. x s t x s x t

s t x. x s t x s x t

s t u. s t \ u s t disjoint s u

s t u. s t u s t s u

s t u. disjoint (s t) u disjoint s u disjoint t u

s t u. s t u s u t u

s t u. s (t u) = s t s u

s t u. s t u = (s t) (s u)

s t u. (s t) u = s u t u

s t u. s t u = (s u) (t u)

s t. ¬(s = t) x. x t ¬(x s)

s t u. cross s (t \ u) = cross s t \ cross s u

s t u. cross s (t u) = cross s t cross s u

s t u. cross s (t u) = cross s t cross s u

s t u. cross (t \ u) s = cross t s \ cross u s

s t u. cross (t u) s = cross t s cross u s

s t u. cross (t u) s = cross t s cross u s

f m n. f (m + n) = f m f n

f l1 l2. map f (l1 @ l2) = map f l1 @ map f l2

f s t. image f (s t) = image f s image f t

f s t. image f (s t) image f s image f t

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

f. (ys. xs. map f xs = ys) y. x. f x = y

f. (t. s. image f s = t) y. x. f x = y

p l1 l2. all p (l1 @ l2) all p l1 all p l2

p l1 l2. any p (l1 @ l2) any p l1 any p l2

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

p l. all p l i. i < length l p (nth l i)

p l. any p l i. i < length l p (nth l i)

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

(∃!) = λp. () p x y. p x p y x = y

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

b f x y. f (if b then x else y) = if b then f x else f y

b f g x. (if b then f else g) x = if b then f x else g x

m n. n m (odd (m - n) ¬(odd m odd n))

x n. x n = 1 x = 1 n = 0

s x. s insert x s = s = insert x

s p. { x. x | x s p x } s

f s. { x. f x | x s } = image f s

p q l. all p (filter q l) all (λx. q x p x) l

p q l. any p (filter q l) any (λx. q x p x) l

p. (∃!x. p x) x. p x y. p y y = x

p. (n. (m. m < n p m) p n) n. p n

r. toSet r = { x y. (x, y) | r x y }

s x y. bigIntersect s x y r. r s r x y

s x y. bigUnion s x y r. r s r x y

x n y. member y (replicate x n) y = x ¬(n = 0)

x s t. s delete t x s t ¬(x s)

x s t. disjoint (insert x s) t ¬(x t) disjoint s t

x s. ¬(x s) t. s insert x t s t

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

l. toSet l = image (nth l) { i. i | i < length l }

s x y. x delete s y x s ¬(x = y)

s x. x s t. s = insert x t ¬(x t)

s t x. x s \ t x s ¬(x t)

s t. s t x. ¬(x s) insert x s t

s. s = x t. s = insert x t ¬(x t)

f s t. finite t s image f t size s size t

f g. (x. y. g y = f x) h. f = g h

p g h. f. x. f x = if p x then f (g x) else h x

p q. (x. p x q x) (x. p x) x. q x

p q. (x. p x q x) (x. p x) x. q x

p q. (x. p x q x) (x. p x) x. q x

p q. (x. p x q x) (x. p x) x. q x

p q. (x. p x) (x. q x) x. p x q x

p q. (x. p x) (x. q x) x. p x q x

r.
    transitiveClosure r =
    bigIntersect { s. s | subrelation r s transitive s }

f x y. zipWith f (x :: []) (y :: []) = f x y :: []

f. (λx. f x) = λ(a, b). f (a, b)

e f. ∃!fn. fn 0 = e n. fn (suc n) = f (fn n) n

a b c. (n. a * n b * n + c) a b

m n. ¬(n = 0) (m div n) * n + m mod n = m

m n. m * n = 1 m = 1 n = 1

x y. 0 x 0 y 0 x * y

s t. finite s finite t size (s t) size s + size t

s t. finite t s t (size s = size t s = t)

a b. finite b a b size a = size b a = b

a b. finite b a b size b size a a = b

s t. finite s finite t size (cross s t) = size s * size t

p. (n. p n) n. p n m. m < n ¬p m

p. p [] (h t. p t p (h :: t)) l. p l

r s. (x y. r x y s x y) wellFounded s wellFounded r

f b h t. foldr f b (h :: t) = f h (foldr f b t)

r s x y. intersect r s x y r x y s x y

r s x y. union r s x y r x y s x y

f b h t. foldl f b (h :: t) = foldl f (f b h) t

h t n. n < length t nth (h :: t) (suc n) = nth t n

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

m n x. m n drop m (replicate x n) = replicate x (n - m)

m n p. n m m + p - (n + p) = m - n

m n p. p n m + n - (m + p) = n - p

m n p. m * n = m * p m = 0 n = p

m n p. m * p = n * p m = n p = 0

x y n. x n = y n x = y n = 0

m n p. m * n m * p m = 0 n p

m n p. m * p n * p m n p = 0

x y n. x n y n x y n = 0

n s. finite s n size s t. t s hasSize t n

s n. finite s n size s t. t s hasSize t n

s n. (finite s n size s) t. t s hasSize t n

a. finite a a = x s. a = insert x s finite s

f l i. i < length l nth (map f l) i = f (nth l i)

p n. p n (m. m < n ¬p m) (minimal) p = n

p. (n. p n) p ((minimal) p) m. m < (minimal) p ¬p m

s. bigIntersect s = universe \ bigUnion { t. universe \ t | t s }

s. bigUnion s = universe \ bigIntersect { t. universe \ t | t s }

x s.
    finite s size (insert x s) = if x s then size s else suc (size s)

y s f. y image f s x. y = f x x s

m n. 0 < m m