I'm trying to generate a list of all possible unions of some sets to generate a topological space from a given basic sets. For ex: Given
{1}, {2}, {4}, {1,3}
I should get
{{}, {1}, {2}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {1, 2, 3, 4}}
I found the following interesting post
But it includes intersection of sets as well.
topoCover
function from this answer in the post you've linked, For example:topoCover[{{1}, {2}, {4}, {1,3}}]
returns{{}, {1}, {2}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {1, 2, 3, 4}}
. $\endgroup$ – creidhne Jan 14 at 9:34