2014-09-14 19:01:14 +00:00
|
|
|
import data.nat
|
|
|
|
open nat
|
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constant list.{l} : Type.{l} → Type.{l}
|
|
|
|
constant vector.{l} : Type.{l} → nat → Type.{l}
|
|
|
|
constant matrix.{l} : Type.{l} → nat → nat → Type.{l}
|
|
|
|
constant length : Pi {A : Type}, list A → nat
|
2014-09-14 19:01:14 +00:00
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constant list_to_vec {A : Type} (l : list A) : vector A (length l)
|
|
|
|
constant to_row {A : Type} {n : nat} : vector A n → matrix A 1 n
|
|
|
|
constant to_col {A : Type} {n : nat} : vector A n → matrix A n 1
|
|
|
|
constant to_list {A : Type} {n : nat} : vector A n → list A
|
2014-09-14 19:01:14 +00:00
|
|
|
|
|
|
|
coercion to_row
|
|
|
|
coercion to_col
|
|
|
|
coercion list_to_vec
|
|
|
|
coercion to_list
|
|
|
|
|
2014-10-02 23:20:52 +00:00
|
|
|
constant f {A : Type} {n : nat} (M : matrix A n 1) : nat
|
|
|
|
constant g {A : Type} {n : nat} (M : matrix A 1 n) : nat
|
|
|
|
constant v : vector nat 10
|
|
|
|
constant l : list nat
|
2014-09-14 19:01:14 +00:00
|
|
|
|
|
|
|
check f v
|
|
|
|
check g v
|
|
|
|
check f l
|
|
|
|
check g l
|