Package list-set: List to set conversions
Information
name | list-set |
version | 1.30 |
description | List to set conversions |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
requires | bool natural set list-def list-thm list-length |
show | Data.Bool Data.List Number.Natural Set |
Files
- Package tarball list-set-1.30.tgz
- Theory file list-set.thy (included in the package tarball)
Defined Constants
- Data
- List
- fromSet
- toSet
- List
Theorems
⊦ toSet [] = ∅
⊦ ∀l. finite (toSet l)
⊦ ∀l. size (toSet l) ≤ length l
⊦ ∀l. toSet l = ∅ ⇔ l = []
⊦ ∀s. finite s ⇒ toSet (fromSet s) = s
⊦ ∀s. finite s ⇒ length (fromSet s) = size s
⊦ ∀h t. toSet (h :: t) = insert h (toSet t)
⊦ ∀s. finite s ⇒ toSet (fromSet s) = s ∧ length (fromSet s) = size s
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ¬
- cond
- ⊥
- ⊤
- List
- ::
- []
- length
- Bool
- Number
- Natural
- ≤
- suc
- zero
- Natural
- Set
- ∅
- finite
- insert
- ∈
- size
Assumptions
⊦ ⊤
⊦ finite ∅
⊦ ¬⊥ ⇔ ⊤
⊦ length [] = 0
⊦ size ∅ = 0
⊦ ∀n. 0 ≤ n
⊦ ∀n. n ≤ n
⊦ ⊥ ⇔ ∀p. p
⊦ ∀n. n ≤ suc n
⊦ (¬) = λp. p ⇒ ⊥
⊦ (∃) = λp. p ((select) p)
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. (⊤ ⇔ t) ⇔ t
⊦ ∀t. ⊤ ∧ t ⇔ t
⊦ ∀t. t ∧ ⊤ ⇔ t
⊦ ∀t. ⊤ ⇒ t ⇔ t
⊦ ∀t. (⊥ ⇔ t) ⇔ ¬t
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t1 t2. (if ⊥ then t1 else t2) = t2
⊦ ∀h t. ¬(h :: t = [])
⊦ ∀x s. ¬(insert x s = ∅)
⊦ ∀s x. finite (insert x s) ⇔ finite s
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀m n. suc m ≤ suc n ⇔ m ≤ n
⊦ ∀m n p. m ≤ n ∧ n ≤ p ⇒ m ≤ p
⊦ ∀p. (∀x. ∃y. p x y) ⇔ ∃y. ∀x. p x (y x)
⊦ ∀P. P [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀x s.
finite s ⇒ size (insert x s) = if x ∈ s then size s else suc (size s)
⊦ ∀p c x y. p (if c then x else y) ⇔ (c ⇒ p x) ∧ (¬c ⇒ p y)
⊦ ∀NIL' CONS'.
∃fn. fn [] = NIL' ∧ ∀a0 a1. fn (a0 :: a1) = CONS' a0 a1 (fn a1)
⊦ ∀p.
p ∅ ∧ (∀x s. p s ∧ ¬(x ∈ s) ∧ finite s ⇒ p (insert x s)) ⇒
∀s. finite s ⇒ p s