Go backward to Example (Continued) Go up to Top Go forward to Summary |
Take arbitrary y in List(T). We have
length(append(cons(e, l), y)) = (definition append) length(cons(e, append(l, y))) = (definition length) 1 + length(append(l, y)) = (induction hypothesis) 1 + (length(l) + length(y)) = (1 + length(l)) + length(y) = (definition length) length(cons(e, l)) + length(y).