2014-08-01 16:37:23 +00:00
|
|
|
import data.nat
|
2014-09-03 23:00:38 +00:00
|
|
|
open nat
|
2014-07-30 00:32:55 +00:00
|
|
|
|
|
|
|
inductive list (T : Type) : Type :=
|
2014-08-22 22:46:10 +00:00
|
|
|
nil {} : list T,
|
|
|
|
cons : T → list T → list T
|
2014-07-30 00:32:55 +00:00
|
|
|
|
2014-09-04 22:03:59 +00:00
|
|
|
definition length {T : Type} : list T → nat := list.rec 0 (fun x l m, succ m)
|
2014-07-30 00:32:55 +00:00
|
|
|
theorem length_nil {T : Type} : length (@nil T) = 0
|
|
|
|
:= refl _
|