Package set-fold-thm: Properties of a fold operation on finite sets
Information
name | set-fold-thm |
version | 1.35 |
description | Properties of a fold operation on finite sets |
author | Joe Leslie-Hurd <joe@gilith.com> |
license | HOLLight |
provenance | HOL Light theory extracted on 2012-08-06 |
requires | bool set-finite set-fold-def set-thm |
show | Data.Bool Set |
Files
- Package tarball set-fold-thm-1.35.tgz
- Theory file set-fold-thm.thy (included in the package tarball)
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
- →
- bool
- Set
- set
Input Constants
- =
- Data
- Bool
- ∀
- ∧
- ⇒
- ∨
- ¬
- cond
- ⊥
- ⊤
- Bool
- Set
- ∅
- delete
- finite
- fold
- insert
- ∈
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)