2014-08-01 09:37:23 -07:00
|
|
|
import data.nat
|
2014-09-03 16:00:38 -07:00
|
|
|
open nat
|
2014-07-29 17:32:55 -07:00
|
|
|
|
|
|
|
inductive list (T : Type) : Type :=
|
2015-02-25 17:00:10 -08:00
|
|
|
| nil {} : list T
|
|
|
|
| cons : T → list T → list T
|
2014-07-29 17:32:55 -07:00
|
|
|
|
2014-09-04 15:03:59 -07:00
|
|
|
definition length {T : Type} : list T → nat := list.rec 0 (fun x l m, succ m)
|
2014-09-04 16:36:06 -07:00
|
|
|
theorem length_nil {T : Type} : length (@list.nil T) = 0
|
|
|
|
:= eq.refl _
|