Wes Turner wrote:
Obviously, this is combinatorics and set theory (category theory (HOTT)); here in the itertools library for iterables.
Powerset is a small problem, and HoTT is a big solution. I know this because I've got the standard book sitting, largely unread, on my bookshelf for over a year.
HoTT is based on the Coq Proof Assistant: https://coq.inria.fr/. One of the applications of CoQ is certification of properties of programming languages.
And now we're a long way from the original post and topic.