Course-of-values stage tables #
A course-of-values table iterates a step function step : List α → α that computes the next value
from the list of all earlier values, producing [val 0, val 1, …, val (n - 1)].
Main definitions #
List.courseOfValues: the table of the firstnvalues generated bystep.List.courseOfValuesVal: then-th valuestep (List.courseOfValues step n).
Main results #
List.courseOfValues_eq_iterate:List.courseOfValues step nis(fun T => T ++ [step T])^[n] [].List.courseOfValues_eq:List.courseOfValues step n = (List.range n).map (List.courseOfValuesVal step).List.length_courseOfValues,List.getD_courseOfValues,List.mem_courseOfValues: length, indexed lookup and membership identities.List.take_courseOfValues,List.courseOfValues_congr: prefix preservation and extensionality.
The n-th value defined by course-of-values recursion from step.
The table entries match List.courseOfValuesVal over 0, …, n - 1.
Lookup at any index below n in courseOfValues step n gives courseOfValuesVal step m.
Defaulted lookup at an index below n recovers courseOfValuesVal step m.
Membership in courseOfValues step n witnesses an earlier index m < n.
Taking the first m ≤ n entries of a course-of-values table gives the m-stage table.
Shorter course-of-values tables are prefixes of longer ones.
Two step functions that agree on all generated prefixes below n produce the same table.