Package set-fold-thm: Properties of a fold operation on finite sets

Information

nameset-fold-thm
version1.25
descriptionProperties of a fold operation on finite sets
authorJoe Hurd <joe@gilith.com>
licenseHOLLight
provenanceHOL Light theory extracted on 2012-03-18
requiresbool
set-finite
set-fold-def
set-thm
showData.Bool
Set

Files

Theorems

f b.
    (x y s. ¬(x = y) f x (f y s) = f y (f x s))
    fold f b = b
    x s.
      finite s
      fold f b s =
      if x s then f x (fold f b (delete s x)) else fold f b (delete s x)

f g b s.
    finite s (x. x s f x = g x)
    (x y s. ¬(x = y) f x (f y s) = f y (f x s))
    (x y s. ¬(x = y) g x (g y s) = g y (g x s))
    fold f b s = fold g b s

Input Type Operators

Input Constants

Assumptions

¬

¬

t. t t

p. p

t. t ¬t

(¬) = λp. p

t. (x. t) t

() = λp. p = λx.

t. ( t) t

t. t t

t. t

t. t

t. t t

t. t

t. t

t. t

t. ( t) ¬t

() = λp q. p q p

t. (t ) (t )

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

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

x y. x = y y = x

s x. finite s finite (delete s x)

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

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

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

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

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

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

p q r. p q r p q r

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

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

p.
    p (x s. p s ¬(x s) finite s p (insert x s))
    s. finite s p s

f b.
    (x y s. ¬(x = y) f x (f y s) = f y (f x s))
    fold f b = b
    x s.
      finite s
      fold f b (insert x s) =
      if x s then fold f b s else f x (fold f b s)