This file contains a collection definitions and theorems about lists that are not part of Lean's standard library. At least when initially writing some of these, suitable variants did not exist or I simply did not find them.
Some cleanup is certainly needed here.
This function is essentially List.zipIdx but the indices are associated with a proof that they are indeed smaller than the length of the list, represented as Fin.
Equations
Instances For
The length of zipIdx_with_lt is the original length.
The first part of a pair at a given index in zipIdx_with_lt corresponds to the list element at the same index.
Membership in zipIdx_with_lt is equivalent to membership in List.zipIdx.
If two lists resulting from append calls are equal and the second components have the same length, then the first components also have the same length.
Mapping over list produces the same list if the mapping function maps each list member to itself. Note that this is very close to List.map_id''
but that List.map_id'' has a stronger assumption. Namely it requires the function to be the id not only on list elements but on every representant of the element type.
Erasing an element from a list without duplicates produces a list without duplicates.
A list that is longer than a list without duplicates but only contains the same elements must have a duplicate.
The index of an element that we get from given index is exactly this index. Note that this uses DecidableEq.