Package list-replicate: Definitions and theorems about the list replicate function
Information
name | list-replicate |
version | 1.12 |
description | Definitions and theorems about the list replicate function |
author | Joe Hurd <joe@gilith.com> |
license | MIT |
show | Data.Bool Data.List Number.Natural |
Files
- Package tarball list-replicate-1.12.tgz
- Theory file list-replicate.thy (included in the package tarball)
Defined Constant
- Data
- List
- replicate
- List
Theorems
⊦ ∀n x. length (replicate n x) = n
⊦ ∀n x i. i < n ⇒ nth i (replicate n x) = x
⊦ ∀n x. toSet (replicate n x) = if n = 0 then Set.∅ else Set.insert x Set.∅
⊦ (∀x. replicate 0 x = []) ∧ ∀x n. replicate (suc n) x = x :: replicate n x
Input Type Operators
- →
- bool
- Data
- List
- list
- List
- Number
- Natural
- natural
- Natural
- Set
- Set.set
Input Constants
- =
- select
- Data
- Bool
- ∀
- ∧
- ⇒
- ∃
- ∨
- ¬
- cond
- F
- T
- List
- ::
- []
- length
- nth
- toSet
- Bool
- Number
- Natural
- <
- suc
- zero
- Natural
- Set
- Set.∅
- Set.insert
Assumptions
⊦ T
⊦ F ⇔ ∀p. p
⊦ (¬) = λp. p ⇒ F
⊦ (∃) = λP. P ((select) P)
⊦ ∀t. (∀x. t) ⇔ t
⊦ (∀) = λp. p = λx. T
⊦ ∀x. x = x ⇔ T
⊦ ∀n. ¬(suc n = 0)
⊦ (⇒) = λp q. p ∧ q ⇔ p
⊦ ∀h t. nth 0 (h :: t) = h
⊦ ∀m. m = 0 ∨ ∃n. m = suc n
⊦ (∧) = λp q. (λf. f p q) = λf. f T T
⊦ (∃) = λP. ∀q. (∀x. P x ⇒ q) ⇒ q
⊦ ∀x s. Set.insert x (Set.insert x s) = Set.insert x s
⊦ ∀m n. suc m < suc n ⇔ m < n
⊦ (∨) = λp q. ∀r. (p ⇒ r) ⇒ (q ⇒ r) ⇒ r
⊦ ∀t1 t2. (if T then t1 else t2) = t1 ∧ (if F then t1 else t2) = t2
⊦ length [] = 0 ∧ ∀h t. length (h :: t) = suc (length t)
⊦ ∀P. P 0 ∧ (∀n. P n ⇒ P (suc n)) ⇒ ∀n. P n
⊦ toSet [] = Set.∅ ∧ ∀h t. toSet (h :: t) = Set.insert h (toSet t)
⊦ ∀e f. ∃fn. fn 0 = e ∧ ∀n. fn (suc n) = f (fn n) n
⊦ ∀h t n. n < length t ⇒ nth (suc n) (h :: t) = nth n t
⊦ ∀P c x y. P (if c then x else y) ⇔ (c ⇒ P x) ∧ (¬c ⇒ P y)
⊦ (∀m. m < 0 ⇔ F) ∧ ∀m n. m < suc n ⇔ m = n ∨ m < n
⊦ ∀t. (T ⇒ t ⇔ t) ∧ (t ⇒ T ⇔ T) ∧ (F ⇒ t ⇔ T) ∧ (t ⇒ t ⇔ T) ∧ (t ⇒ F ⇔ ¬t)