Package list-filter-thm: Properties of the list filter function
Information
name | list-filter-thm |
version | 1.36 |
description | Properties of the list filter function |
author | Joe Hurd <joe@gilith.com> |
license | HOLLight |
provenance | HOL Light theory extracted on 2012-04-05 |
requires | bool function list-append list-def list-filter-def list-length list-map list-set natural set |
show | Data.Bool Data.List Function Number.Natural Set |
Files
- Package tarball list-filter-thm-1.36.tgz
- Theory file list-filter-thm.thy (included in the package tarball)
Theorems
⊦ ∀p l. length (filter p l) ≤ length l
⊦ ∀p l x. member x (filter p l) ⇔ member x l ∧ p x
⊦ ∀p l1 l2. filter p (l1 @ l2) = filter p l1 @ filter p l2
⊦ ∀p f l. filter p (map f l) = map f (filter (p ∘ f) l)
⊦ ∀p q l. all p (filter q l) ⇔ all (λx. q x ⇒ p x) l
⊦ ∀p q l. exists p (filter q l) ⇔ exists (λx. q x ∧ p x) l
⊦ ∀p l. toSet (filter p l) = toSet l \ { x. x | ¬p x }
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- ⊥
- ⊤
- List
- ::
- @
- []
- all
- exists
- filter
- length
- map
- member
- toSet
- Bool
- Function
- ∘
- Number
- Natural
- ≤
- suc
- Natural
- Set
- ∅
- \
- fromPredicate
- insert
- ∈
Assumptions
⊦ ⊤
⊦ ¬⊥ ⇔ ⊤
⊦ ¬⊤ ⇔ ⊥
⊦ toSet [] = ∅
⊦ ∀n. n ≤ n
⊦ ⊥ ⇔ ∀p. p
⊦ ∀n. n ≤ suc n
⊦ (¬) = λp. p ⇒ ⊥
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. ⊤
⊦ ∀t. ¬¬t ⇔ t
⊦ ∀l. [] @ l = l
⊦ ∀s. ∅ \ s = ∅
⊦ ∀f. map f [] = []
⊦ ∀p. filter p [] = []
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t. (t ⇔ ⊤) ∨ (t ⇔ ⊥)
⊦ ∀t1 t2. (if ⊥ then t1 else t2) = t2
⊦ ∀t1 t2. (if ⊤ then t1 else t2) = t1
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ ∀l x. member x l ⇔ x ∈ toSet l
⊦ (∧) = λp q. (λf. f p q) = λf. f ⊤ ⊤
⊦ (∃) = λp. ∀q. (∀x. p x ⇒ q) ⇒ q
⊦ ∀h t. toSet (h :: t) = insert h (toSet t)
⊦ ∀m n. suc m ≤ suc n ⇔ m ≤ n
⊦ ∀f g x. (f ∘ g) x = f (g x)
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀p q r. p ⇒ q ⇒ r ⇔ p ∧ q ⇒ r
⊦ ∀t1 t2 t3. (t1 ∧ t2) ∧ t3 ⇔ t1 ∧ t2 ∧ t3
⊦ ∀m n p. m ≤ n ∧ n ≤ p ⇒ m ≤ p
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀p l. all p l ⇔ ∀x. x ∈ toSet l ⇒ p x
⊦ ∀p l. exists p l ⇔ ∃x. x ∈ toSet l ∧ p x
⊦ ∀f h t. map f (h :: t) = f h :: map f t
⊦ ∀p x. x ∈ { y. y | p y } ⇔ p x
⊦ ∀b f x y. f (if b then x else y) = if b then f x else f y
⊦ ∀s t x. x ∈ s \ t ⇔ x ∈ s ∧ ¬(x ∈ t)
⊦ ∀p. p [] ∧ (∀h t. p t ⇒ p (h :: t)) ⇒ ∀l. p l
⊦ ∀p h t. filter p (h :: t) = if p h then h :: filter p t else filter p t
⊦ ∀p c x y. p (if c then x else y) ⇔ (c ⇒ p x) ∧ (¬c ⇒ p y)
⊦ ∀s t x. insert x s \ t = if x ∈ t then s \ t else insert x (s \ t)