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