I'm formalising some (set-theory based) mathematics considering the cartesian product of some sets and "partitions", i.e. products of only a few of these sets whose indices are in some set & those whose are not in , e.g. for $$J = {1,...,k}$
I have written these in isabelle as folds over 'a set list
. Now I'd like to not require that contain the first integers (i.e. allow more general partitions, which'd fit nicely with the partition
function on lists), but that makes it difficult to work with elements of these sets, and especially it makes it hard to talk about "merging" these partitions back into the original product, since it requires keeping track of all these indices. I've now written half a theory dealing purely with "indexed" sublists which can be seen as partitions & merged back into the original list, but that's very orthogonal to my original problem and I wonder if I'm either reinventing something or simply holding things wrong.
Isn't that your structure basically a Map (https://isabelle.in.tum.de/library/HOL/HOL/Map.html) nat ⇀ 'a set
with a finite domain?
Here is the finite version: https://isabelle.in.tum.de/library/HOL/HOL-Probability/HOL-Library.Finite_Map.html
yes! thanks a lot for the hint; don't know what possessed me to not notice I was shoving a (finite) Map into lists. Good to know there's a finite map though, I'd not seen it before
Last updated: Apr 18 2025 at 20:21 UTC