Package list-filter-thm: Properties of the list filter function
Information
name | list-filter-thm |
version | 1.25 |
description | Properties of the list filter function |
author | Joe Hurd <joe@gilith.com> |
license | HOLLight |
provenance | HOL Light theory extracted on 2011-11-27 |
requires | bool function natural set list-def list-length list-set list-append list-map list-filter-def |
show | Data.Bool Data.List Function Number.Natural Set |
Files
- Package tarball list-filter-thm-1.25.tgz
- Theory file list-filter-thm.thy (included in the package tarball)
Theorems
⊦ ∀p l. length (filter p l) ≤ length l
⊦ ∀p l. toSet (filter p l) ⊆ toSet l
⊦ ∀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)
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- set
Input Constants
- =
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ¬
- cond
- F
- T
- List
- ::
- @
- []
- filter
- length
- map
- toSet
- Bool
- Function
- ∘
- Number
- Natural
- ≤
- suc
- Natural
- Set
- ∅
- insert
- ⊆
- ∪
Assumptions
⊦ T
⊦ ∀n. n ≤ n
⊦ ∀s. s ⊆ s
⊦ F ⇔ ∀p. p
⊦ ∀n. n ≤ suc n
⊦ (¬) = λp. p ⇒ F
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ ∀t. T ∧ t ⇔ t
⊦ ∀l. [] @ l = l
⊦ ∀f. map f [] = []
⊦ ∀P. filter P [] = []
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀t1 t2. (if F then t1 else t2) = t2
⊦ ∀t1 t2. (if T then t1 else t2) = t1
⊦ ∀h t. length (h :: t) = suc (length t)
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀h t. toSet (h :: t) = insert h (toSet t)
⊦ ∀x s. insert x ∅ ∪ s = insert x s
⊦ ∀m n. suc m ≤ suc n ⇔ m ≤ n
⊦ ∀f g x. (f ∘ g) x = f (g x)
⊦ ∀m n p. m ≤ n ∧ n ≤ p ⇒ m ≤ p
⊦ ∀l h t. (h :: t) @ l = h :: t @ l
⊦ ∀s t u. s ⊆ t ∧ t ⊆ u ⇒ s ⊆ u
⊦ ∀f h t. map f (h :: t) = f h :: map f t
⊦ (∀s t. s ⊆ s ∪ t) ∧ ∀s t. s ⊆ t ∪ s
⊦ ∀s t u. s ∪ t ⊆ u ⇔ s ⊆ u ∧ t ⊆ u
⊦ ∀P. P [] ∧ (∀a0 a1. P a1 ⇒ P (a0 :: a1)) ⇒ ∀x. P x
⊦ ∀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)