lean2/tests/lean/run/coe9.lean
Leonardo de Moura 4f2e0c6d7f refactor(frontends/lean): add 'attribute' command
The new command provides a uniform way to set declaration attributes.
It replaces the commands: class, instance, coercion, multiple_instances,
reducible, irreducible
2015-01-24 20:23:21 -08:00

27 lines
816 B
Text

import data.nat
open nat
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
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
attribute to_row [coercion]
attribute to_col [coercion]
attribute list_to_vec [coercion]
attribute to_list [coercion]
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
check f v
check g v
check f l
check g l