"""Generate power-set-inclusion-cube.png in cwd. Tested with Python 3.14.4, numpy 2.3.5, matplotlib 3.10.7. Every vertex is one subset; an upward edge adds exactly one element. """ from itertools import combinations from pathlib import Path import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt def main(): universe=('a','b','c') vertices=[frozenset(c) for k in range(4) for c in combinations(universe,k)] positions={frozenset():(0,0),frozenset('a'):(-2,1.4),frozenset('b'):(0,1.4),frozenset('c'):(2,1.4), frozenset('ab'):(-2,2.8),frozenset('ac'):(0,2.8),frozenset('bc'):(2,2.8),frozenset('abc'):(0,4.2)} edges=[(s,t) for s in vertices for t in vertices if s