Package list-replicate: The list replicate function

Information

namelist-replicate
version1.30
descriptionThe list replicate function
authorJoe Hurd <joe@gilith.com>
licenseMIT
requiresbool
natural
set
list-length
list-set
list-nth
showData.Bool
Data.List
Number.Natural
Set

Files

Defined Constant

Theorems

x. replicate 0 x = []

n x. length (replicate n x) = n

x n. replicate (suc n) x = x :: replicate n x

n x i. i < n nth i (replicate n x) = x

n x. toSet (replicate n x) = if n = 0 then else insert x

Input Type Operators

Input Constants

Assumptions

T

length [] = 0

toSet [] =

F p. p

(¬) = λp. p F

() = λp. p ((select) p)

t. (x. t) t

() = λp. p = λx. T

t. F t T

t. T t t

t. t T T

n. ¬(suc n = 0)

m. m < 0 F

() = λ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. nth 0 (h :: t) = h

h t. length (h :: t) = suc (length t)

m. m = 0 n. m = suc n

() = λ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 (insert x s) = insert x s

m n. suc m < suc n m < n

() = λp q. r. (p r) (q r) r

p. (x. y. p x y) y. x. p x (y x)

P. P 0 (n. P n P (suc n)) n. P n

(∃!) = λp. () p x y. p x p y x = y

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)