
COMMENTS

A setsystem is a finite set of finite nonempty sets. Its elements are sometimes called edges. The dual of a setsystem has, for each vertex, one edge consisting of the indices (or positions) of the edges containing that vertex. For example, the dual of {{1,2},{2,3}} is {{1},{1,2},{2}}. A weak antichain is a multiset of sets, none of which is a proper subset of any other.


MATHEMATICA

dual[eds_]:=Table[First/@Position[eds, x], {x, Union@@eds}];
stableSets[u_, Q_]:=If[Length[u]==0, {{}}, With[{w=First[u]}, Join[stableSets[DeleteCases[u, w], Q], Prepend[#, w]&/@stableSets[DeleteCases[u, r_/; r==wQ[r, w]Q[w, r]], Q]]]];
stableQ[u_, Q_]:=!Apply[Or, Outer[#1=!=#2&&Q[#1, #2]&, u, u, 1], {0, 1}];
Table[Length[Select[stableSets[Subsets[Range[n], {1, n}], Intersection[#1, #2]=={}&], Union@@#==Range[n]&&stableQ[dual[#], SubsetQ]&]], {n, 0, 3}]
