Length and entries of List.modifyLast #
List.modifyLast f l applies f to the last entry of l and leaves the others alone. This file
records the two facts that index-wise arguments about it need: the length is unchanged, and the
entry at position i is f l[i] when i is the last position and l[i] otherwise. Both follow
from Mathlib's List.modifyLast_concat.
Main results #
List.length_modifyLast:(l.modifyLast f).length = l.length.List.getElem_modifyLast: the entry atiisf l[i]ifi + 1 = l.length, elsel[i].
@[simp]