This file contains a helper function that generates all possible lists over a given list of candidates such that each of the lists has a given length. Since the definition would hardly be useful in proofs, the accompanying theorem states the desired properties ensured by the definition.
Equations
- all_lists_of_length candidates Nat.zero = [[]]
- all_lists_of_length candidates n.succ = List.flatMap (fun (t : α) => List.map (fun (ts : List α) => t :: ts) (all_lists_of_length candidates n)) candidates