EncounterActivity 1 of 8
Encounter
A shopping list, a playlist, the digits of a number: lists are everywhere. In Lean a list is defined like the trees of the previous lesson, with two constructors:
[], the empty list;x :: xs, an elementxin front of a smaller listxs.
So [3, 1, 4] is really 3 :: 1 :: 4 :: []. A function on lists has one equation for each
constructor, and a proof about every list goes by induction on the list.