Package set-fold-thm: Properties of a fold operation on finite sets
Information
name | set-fold-thm |
version | 1.18 |
description | Properties of a fold operation on finite sets |
author | Joe Hurd <joe@gilith.com> |
license | HOLLight |
provenance | HOL Light theory extracted on 2011-11-27 |
requires | bool set-thm set-finite set-fold-def |
show | Data.Bool Set |
Files
- Package tarball set-fold-thm-1.18.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
- F
- T
- Bool
- Set
- ∅
- delete
- finite
- fold
- insert
- ∈
Assumptions
⊦ T
⊦ ¬F ⇔ T
⊦ ¬T ⇔ F
⊦ ∀t. t ⇒ t
⊦ F ⇔ ∀p. p
⊦ ∀t. t ∨ ¬t
⊦ (¬) = λp. p ⇒ F
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ ∀t. (T ⇔ t) ⇔ t
⊦ ∀t. T ∧ t ⇔ t
⊦ ∀t. t ∧ F ⇔ F
⊦ ∀t. F ⇒ t ⇔ T
⊦ ∀t. T ⇒ t ⇔ t
⊦ ∀t. t ⇒ T ⇔ T
⊦ ∀t. T ∨ t ⇔ T
⊦ ∀t. t ∨ T ⇔ T
⊦ ∀t. (F ⇔ t) ⇔ ¬t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ T) ∨ (t ⇔ F)
⊦ ∀t1 t2. (if F then t1 else t2) = t2
⊦ ∀t1 t2. (if T 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 T T
⊦ ∀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)