Repository navigation
Speculative Collections of an Object
Speculative. A proposal, not adopted.
Every collection the repository has takes integers: Permutations(n), Subsets(n), LabeledGraphsByEdges(n, m). The chains, antichains, order ideals and linear extensions of a given poset are collections whose parameter is a combinatorial value, P. Speculative-Posets left them as open question 4 with names and nothing else. This page works out what such a collection is here, how a value reaches a family that reads only numbers, and what the first slice is.
"Measured" means I read it in the tree at origin/main (path:line), read it in the files of #1354 (open, not on this checkout), counted it, or ran it in Python. "Assumed" means reasoned and not run. Nothing here was run through compute-engine or compiled, and no TypeScript was run. In paths, families/ is packages/symbols/combinatorics/combinatorics/collections/src/families/ and combinatorics/ is packages/symbols/combinatorics/combinatorics/. A poset is the value of #1354, a naturally labeled list of lower covers, 1-based (combinatorics/posets/src/carrier-data.ts:1-14 on that branch).
-
Each of the four is a restriction of a numeric collection, in the induced order, with
Pread by the predicate:Antichains(P),OrderIdeals(P)andChains(P)restrictSubsets(n), andLinearExtensions(P)restrictsSymmetricGroup(n), withn = Length(P). Members keep their carrier (Finset,Permutation). The order costs nothing, andRestricted(base, predicate)is the specification a test holds each one to (§1). -
The value reaches the family as two integers,
(n, code).codeis the poset's strict order read as a graph inLabeledGraphs(n), a number exact in a double through n = 10 (§3). The family is ordinary: integer params, Epsil definition, tables per params. The public head is a call form that reads thePosetoperand and calls it, asSubsets(list),Permutations(n)andIntegerPartitions(n, All, parts)already do (§3). Value parameters in the family contract (option A) cost eight sites and are not needed below n = 11. -
The graph analogue is the same family.
Antichains(P)lists the independent sets of the comparability graph andChains(P)its cliques.IndependentSets(g)andCliques(g)are the same families on a graph's own code (§5). -
First slice:
Antichains(P). It needs no rename, has a cross-check in #1354 (AntichainCount), and exercises everything new: the value parameter,nin the carrier, the induced order and the decline past n = 10.OrderIdeals(P)andChains(P)follow by a different predicate (Chainswith theChain(n)rename), thenLinearExtensions(P), the one that needs counting without listing (§4 and the plan). -
Names: answer 4's, as recommended. A prefix such as
PosetChainsrepeats the carrier name and is not needed (§6).
A family's parameters are always numbers.
-
FamilyShape.paramCountis0 | 1 | 2 | 3(families/types.ts:97).FastKerneltakesp: number[](families/epsil.ts:43-53).EpsilFamily.paramsis names only (epsil.ts:56-57), andoperationTypestypes every oneinteger(epsil.ts:145). The declared signature isinteger<0..>per param (families/declare.ts:48-51). - The engine reads a call's params with
intOf, so aPosetoperand isNaN,paramsanswersundefinedand the collection answers unknown (declare.ts:115-119). The fast path takes only non-negative safe integers (wellParamed,epsil.ts:500-504). - Caches are keyed by
p.join(","): the counts (epsil.ts:528), the exact and double tables (:442,:453) and the BigInt tables (:378);isLastcompares entries with!==(:521-525). Each distinct params has one table, 16 kept (TABLES_CACHE_SIZE,:253). For a poset that key flattens nesting. Measured over all 5,232 naturally labeled posets through n = 6 (joinkey.py): 4,352 keys, 660 shared, among them[[],[],[1,2]]and[[],[],[1],[2]], different sizes ([]and[[]]both give the empty string). - The sampler draws integers from
Declared.params(collections/scripts/sampleable.ts:41-51;combinatorics/scripts/family-checks.ts:69), and the oracle sweep takes only integer operands (packages/reference/scripts/oracle-plausible.ts:237). -
carrierParamspacks the firstkparams beside the element:Tuple(...p.slice(0, k), element), read back from the last operand (declare.ts:98-99,:110-111).Finsetistuple<integer, list<integer>>withcarrierParams: 1(combinatorics/set-partitions/src/carrier-data.ts:16-26), soSubsets(n)packsn = p[0](families/core.ts:20-26).carrierCodecis the escape for a carrier whose value is not the element's shape (types.ts:93-96). - The fiber limit is
FAST_LIMIT, 2^53 − 1 (epsil.ts:173-176); enumerative families also stop atENUMERATION_LIMIT = 2,000,000elements (declare.ts:29).
No family takes a list or another value. The nearest are call forms, which widen a declared head and re-read the operands on every access (polyCollection, families/call-forms.ts:86-129):
-
Subsets(list)andSetPartitions(list)list the family over positions 1..n and print each position as the list's element (call-forms.ts:334-342,:443-455,:551-575). The collection has count, at, iteration and membership, and no rank handler (:86-129); a declared family's successor is registered per head (declare.ts:263-273). -
IntegerPartitions(n, All, parts)is a collection parameterized by a list, with count, unrank and membership from a dynamic program closed over the list (call-forms.ts:188-200,partitions/src/families/partitions.ts:50). It is TypeScript, not Epsil. -
Permutations(n)isSymmetricGroup(n)by a rewrite; compute-engine's ownPermutations(list)is untouched (call-forms.ts:582-590). The reference record names the family and recordsPermutationsas its catalog name (combinatorics/reference/SymmetricGroup/index.md,names.catalog). -
Tuples(list, k)is a plain list, held past 100,000 tuples (call-forms.ts:323,:624-641).
Heads that are "the things of a given object" are list-valued functions, not collections. ConnectedComponents(g) declares evaluate returning a List (combinatorics/collections/src/graphs.ts:601-615); PosetElements(P) likewise, and only over Chain, BooleanLattice and DivisorLattice expressions (packages/symbols/algebras/incidence/src/declare.ts:114-124). Neither has rank, unrank or a lazy count.
Restrictions. Restricted(base, predicate) is Filter and stays lazy (packages/structures/src/restriction.ts:268-274). Named restrictions are rows of one-integer signatures, (integer) -> collection (restriction.ts:306); Speculative-Named-Restrictions designs rows with parameter holes (§3 there) and is not built. permutationRestriction builds a restriction of SymmetricGroup(n) from a completion count over the prefix, an optional prefix state and one tables list, all over the family's params (families/lex-restriction.ts:8-9, :17-46, :259-271).
Statistics do not call collections. The statistics core has no collection head, and a test holds every definition to it (combinatorics/tests/statistics-core.test.ts:33-90). #1354 defines ChainCount and AntichainCount as bitmask folds over masks = Range(0, 2^n − 1) with withPoset and withRelation (posets/src/statistics.ts:44-49, :66-75, :132, :447, :453 on that branch), counting the empty set. IndependentSetCount (FindStat St000300) is on main (combinatorics/reference/IndependentSetCount/index.md).
Names are free. git ls-files shows no record named Antichains, OrderIdeals, LinearExtensions, Chains, IndependentSets, Cliques, SpanningTrees or Matchings. Existing neighbours: Chain (incidence), PerfectMatchings, NonCrossingMatchings, NonNestingMatchings, and the statistics IndependentSetCount, CliqueNumber, MatchingNumber, SpanningTreeCount, LinearExtensionCount (a tree statistic). Wolfram's System context (packages/wolfram/src/system-names.ts) has none of the eight; it has Permutations (:5356), Subsets (:6729), TopologicalSort (:7121) and the single-answer FindClique (:2668), FindIndependentVertexSet (:2702) and FindSpanningTree (:2742).
All four are subsets of a numeric collection cut by a predicate that reads P:
| Collection | Base | Predicate on a member s
|
Carrier |
|---|---|---|---|
OrderIdeals(P) |
Subsets(n) |
every element below a member of s is in s
|
Finset |
Antichains(P) |
Subsets(n) |
no two members of s are comparable |
Finset |
Chains(P) |
Subsets(n) |
every two members of s are comparable |
Finset |
LinearExtensions(P) |
SymmetricGroup(n) |
a < b in P puts a before b in w
|
Permutation |
The empty set is a member of the first three, as in AntichainCount and ChainCount.
Restriction is the right definition.
- A restriction head means the base's induced order (Restrictions §1), so the order is fixed and needs no second statement. The alternative, a family with its own order, has to state an order and then hold it to this one.
- Members keep their carrier: every
FinsetandPermutationstatistic and map applies, andElement(x, Subsets(n))is true of a member. - The definition is a specification a test can hold the family to:
Restricted(Subsets(Length(P)), predicate)evaluated as a filter, element by element. This is the existing differential test (statistics-carrier-restriction.test.ts, Speculative-Named-Restrictions "What exists") fed a poset.
The two things a bare Restricted does not give:
- Speed.
Filterenumerates the base: 2^n for the subset families, n! for linear extensions (§3). - A way to say
P.Restrictedtakes a one-argument predicate, soPis a free variable of the lambda. That is fine as a specification. As a named row it is a parameter hole whose base size is derived,SymmetricGroup(Length(P)), which Speculative-Named-Restrictions §3 does not cover (its base parameters are the head's own names).
Two non-restrictions, to keep the set clear. OrderIdeals(P) and Antichains(P) are in bijection by maximal elements, but the bijection does not preserve the order (sizes differ), so they are two collections, not one collection twice. And the ideals ordered by inclusion are a lattice; the collection's order is size, then lex, and says nothing about inclusion.
The orders, from the code. Subsets(n) is graded by size and lex within a size (families/closed-forms.ts:210-268, subsets.ts:1-3; its restrictions say "the order of the subsets it restricts"). SymmetricGroup(n) is lex (families/kernels.ts:52-67, PermutationUnrank). A member is a Finset(Tuple(n, members)) with the members ascending, or a one-line permutation.
The V is [[],[1],[1]] (1 below 2 and 3) and the diamond [[],[1],[1],[2,3]] (1 below 2 and 3, both below 4). Computed in Python from the definitions above (members.py, listed against filtered Subsets(n) and SymmetricGroup(n)):
| V | diamond | |
|---|---|---|
OrderIdeals(P) |
{}, {1}, {1,2}, {1,3}, {1,2,3}
|
{}, {1}, {1,2}, {1,3}, {1,2,3}, {1,2,3,4}
|
Antichains(P) |
{}, {1}, {2}, {3}, {2,3}
|
{}, {1}, {2}, {3}, {4}, {2,3}
|
Chains(P) |
{}, {1}, {2}, {3}, {1,2}, {1,3}
|
{}, {1}, {2}, {3}, {4}, {1,2}, {1,3}, {1,4}, {2,4}, {3,4}, {1,2,4}, {1,3,4}
|
LinearExtensions(P) |
123, 132
|
1234, 1324
|
Counts 5, 5, 6, 2 and 6, 6, 12, 2. For the V, Subsets(3) is {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}; each list above is that sequence with the non-members removed, so {2,3} is last in Antichains(V) because it is the only member of size 2.
Checked over every naturally labeled poset through n = 6 (equivalences.py): the antichains equal the independent sets of the comparability graph and the chains its cliques, as sets; the ideals and antichains correspond by maximal elements and have equal counts. The counts agree with AntichainCount and ChainCount as defined: sets of pairwise incomparable or comparable elements, the empty set included.
An integer code. The strict order of a naturally labeled poset, as a graph in LabeledGraphs(n): the edges of K_n are numbered in lex order of their pairs, and edge k is present when bit k − 1 of the rank is set (combinatorics/graphs/src/families/epsil.ts:1-2, :126; Speculative-Posets §9 answer 2 and §11). A naturally labeled poset is determined by its comparability graph, so the code is injective. Measured on all 5,232 posets through n = 6: every code decodes back to its lower-cover list, and no two posets share one (equivalences.py). The code has C(n, 2) bits: 45 at n = 10 and 55 at n = 11, so it is exact in a double through n = 10 (the same bound that page gives for its canonical code).
The family has params (_n, _c), carrier: "Finset", carrierParams: 1 and kind: "ints" for the subset families. n is first, so the existing packing gives Finset(Tuple(n, members)) unchanged (declare.ts:98-99). Its definitions are over _n and _c and a tables list built once per (n, c) (epsil.ts:33-37, :441-450): for the subset families the ascending Subsets(n) ranks of the members, so count is its length, unrank is At then the Subsets unrank, and rank is IndexOf over the Subsets rank. Reading a bit of _c uses digit extraction (digitOf, closed-forms.ts:44) and the graph area's edgeIndex (graphs/src/families/epsil.ts:44). That is assumed, not tried.
- The family is total: for any
(n, c)it is the independent sets, cliques, sets closed under the lower relation, or topological orders of the graph of codec, a poset or not. A sampler can draw any(n, c)below 2^C(n,2) without a validity filter (assumed from the definitions; not run). - Members: at most 2^n ≤ 1,024 for the subset families through n = 10; for linear extensions at most n! = 3,628,800 at n = 10, past
ENUMERATION_LIMIT, so that family declares polynomial costs, not enumerative ones (§4).
The public head is a call form: Antichains(P) with signature (poset) -> indexed_collection<finset>, handlers that read ops[0], take the list of lower covers, compute (n, c) in TypeScript and delegate to kernelOn(ce, family) through resolvedFrom(kernel, [n, c], encode) (call-forms.ts:72, :404-409; the Subsets(list) code is the template). It holds the call past n = 10, as Tuples(list, k) holds past its cap (call-forms.ts:624-641): declined, never wrong. polyCollection is not exported (call-forms.ts:86), so the builder exports it or copies its shape. A Poset operand is read and a bare list is a type error, as for the statistics ("applying it to a bare list is a type error", reference/AntichainCount/index.md on #1354).
What Count(Antichains(P)) evaluates through: the handler's count, then resolve(ops) to (n, c), then the family's count([n, c]): the length of the cached table, the fast path only if one is added. AntichainCount(P) evaluates the bitmask fold in _x. The two routes share no code, so Count(Antichains(P)) = AntichainCount(P) is a real test, and a test for Chains against ChainCount.
Options.
| What it is | Costs | What it breaks or leaves out | |
|---|---|---|---|
| A. Value params in families |
params carry types; p becomes unknown[]; keys are JSON |
paramCount (types.ts:97); FastKernel signatures (epsil.ts:43-53); operationTypes (:145); the four cache keys (:378, :442, :453, :528) and isLast (:521); wellParamed (:500); declare.ts params, signatureOf, exactCount and the carrier packing (:48-51, :99, :115-119, :316); Declared.params, the sampler and oracle-plausible.ts
|
Every family's contract, for one use; a sampler that needs a poset generator; the generated-code hash is by name only and survives. Lifts n ≤ 10 |
| B. Restrictions only |
Restricted(Subsets(Length(P)), …) with a named alias that has a hole |
The alias rows of Speculative-Named-Restrictions, plus a derived base size; a predicate over a Finset's contents, the _raw wart (§3 there) |
Enumerative: 2^n and n! per call, no unrank. Fine as the specification, not as the collection |
| C. List-valued head |
Antichains(P) evaluates to a List, as ConnectedComponents(g)
|
One evaluate
|
No lazy count, rank, unrank or Element by index; a list of 3.6 million for LinearExtensions at n = 10 |
| D. Integer code + call form |
(n, c) params; the public head reads the value |
A TypeScript encoder; one exported helper in call-forms.ts; the pair numbering settled (open question 2) |
n ≤ 10, and a code that is a number, not a readable value (internal; the user writes P). Nothing in the family contract changes |
D keeps every property the repository already tests: Epsil is the meaning, fast is optional and held to it (tests/fast-kernels.test.ts, per epsil.ts:40-42), tables are per params, and counts are exact below 2^53. A is the principled end state, and its first real trigger is a collection that needs n > 10 or a value with no integer code. D is not a dead end for it: the family's Epsil would take _c as a list instead of a number.
Linear extensions. Lex unrank of a restriction of SymmetricGroup(n) needs only the completion count of a prefix (lex-restriction.ts:8-9, Restrictions §2). Here it is N(placed), the number of ways to finish from the set already placed, and 0 for a prefix that is not an order prefix. N depends only on the placed set, so it is a table over order ideals, built by dynamic programming (a maximal element of the ideal comes last). The prefix check is incremental: a value v may be placed when its lower elements are placed, which is what the builder's state is for (a state [placed mask, still valid], updated per value placed). So the interface fits shape-wise: completions over the params and a tables list, one state, the table [below masks…, N over masks] as one list (the builder takes one table). It does not fit by contract only where the params are typed integers (epsil.ts:145), which the code removes. Assumed in Epsil; measured in Python: lex unrank and rank by N equal the position in filtered SymmetricGroup(n) for every poset through n = 6, 4,824 at n = 6 (counting.py, linext_unrank, linext_rank). N has one entry per reachable placed set, which is the order ideals, at most 2^n.
Ideals, antichains, chains. The completion count of a lex prefix does not apply as is: Subsets is graded by size first, so a prefix is counted by size. Decide elements in label order, with A the undecided set and x its smallest element. Taking x removes it from A, and for antichains also the elements comparable to it, for chains those incomparable to it. Leaving x out removes it, and for ideals also its up-set (nothing above an excluded element can be a member). The count is a polynomial in size memoized on A, and in lex order among equal sizes the "in" branch comes first. The same recursion unranks and ranks (counting.py, class Family). Measured: count, unrank and rank equal the filtered Subsets(n) for every poset through n = 6 and all three families. The memo has no more states than members, always, and about half as many at n = 7:
| n | family | DP states, mean / max | members, mean / max | mean states ÷ members |
|---|---|---|---|---|
| 5 | ideals, antichains | 7.9 / 11 | 13.5 / 32 | 0.63 |
| 5 | chains | 6.9 / 10 | 11.7 / 32 | 0.64 |
| 6 | ideals, antichains | 10.3 / 15 | 20.0 / 64 | 0.56 |
| 6 | chains | 8.6 / 13 | 15.8 / 64 | 0.59 |
| 7 | ideals, antichains | 13.3 / 23 | 29.0 / 128 | 0.50 |
| 7 | chains | 10.4 / 17 | 20.6 / 128 | 0.55 |
(population: all naturally labeled posets, 357, 4,824 and 96,428 for n = 5, 6, 7; counting.py; the maximum ratio is 1.00 in every row.) The table is therefore no worse than listing members, and the DP is the route past n = 10 if option A is taken. Under D the subset families have at most 1,024 members, so the plain member table of §3 is enough and the DP is not needed. A dense table indexed by A would cost 2^n · (n + 1) entries whatever the poset (a chain has n + 1 ideals), which is assumed, not measured.
Sizes. Over all naturally labeled posets (sizes.py; a class appears once per natural labeling, so this weights classes by their labelings), and per isomorphism class where the page does not have it (canonical form by the least lower-cover list over all natural labelings; the class counts 1, 2, 5, 16, 63, 318 come out right):
| n | posets | ideals = antichains, mean / max | per class | chains, mean / max | per class | linear extensions, mean / max | per class |
|---|---|---|---|---|---|---|---|
| 3 | 7 | 5.7 / 8 | 5.6 | 5.6 / 8 | 5.8 | 2.9 / 6 | 2.8 |
| 4 | 40 | 8.9 / 16 | 8.4 | 8.3 / 16 | 9.1 | 6.5 / 24 | 6.0 |
| 5 | 357 | 13.5 / 32 | 12.2 | 11.7 / 32 | 13.8 | 17.1 / 120 | 14.2 |
| 6 | 4,824 | 20.0 / 64 | 17.1 | 15.8 / 64 | 19.9 | 51.0 / 720 | 37.0 |
| 7 | 96,428 | 29.0 / 128 | n/a | 20.6 / 128 | n/a | 169.6 / 5,040 | n/a |
The maxima are 2^n (the antichain for ideals and antichains, the chain for chains) and n! (the antichain for extensions). Speculative-Posets §1 and §3 have the per-class numbers at n = 7 and 8 (ideals 23.6 mean, 128 max at n = 7, and 32.4, 256 at n = 8; linear extensions 105 and 329 on average per class), which I do not recompute.
Antichains(P) is IndependentSets of the comparability graph and Chains(P) its Cliques (§2, checked as sets). The family over (n, c) is the same whether c comes from a poset or a graph: for a LabeledGraph the code is the rank of its edge set in LabeledGraphs(n), with the same numbering, so one TypeScript encoder per carrier and no new family. A graph arm costs the head and its cross-check, which already exists on main (IndependentSetCount, St000300). Heads for the other graph collections are named in §6; Matchings(g) and SpanningTrees(g) are subsets of the edge set, restrictions of Subsets(m) on the edge list; their member carrier is undecided and not needed here.
| Candidate | For | Against |
|---|---|---|
Antichains(P), OrderIdeals(P), LinearExtensions(P), Chains(P)
|
Answer 4. Match Sage (antichains, chains, linear_extensions), FindStat's wording ("antichains", "linear extensions") and no repeated carrier name. No Wolfram head in the way |
Chains reads as the collection of Chain(...), and Chain(n) builds a poset |
PosetChains(P), PosetAntichains(P), PosetOrderIdeals(P)
|
Extends incidence's Poset* heads |
Repeats the carrier in the name, which the naming ruling avoids; unneeded since the parameter's type says it |
Chain(n) → ChainPoset(n)
|
Sage's name; BooleanLattice(n) and DivisorLattice(n) say what they build |
A rename with no alias, measured at 14 files outside its own record by git grep at this checkout, not six: incidence/src/declare.ts and poset.ts, the incidence test, six incidence records, incidence-algebras.md, two quiver files, and one test each in frontend and reference
|
A plural head is a collection and its singular builds a member. A restriction has no singular of its own (Derangements has none), so Chain(…) is not claimed by Chains; the clash is about what a reader expects, and it blocks nothing mechanical. Do the rename when Chains lands, not before: Antichains, OrderIdeals and LinearExtensions do not meet Chain.
The pattern is one pattern: the plural names the subsets of a structure's ground set that satisfy its hereditary condition, and the parameter is the structure: Antichains(P), OrderIdeals(P), Chains(P), IndependentSets(g), Cliques(g), Matchings(g), SpanningTrees(g), LinearExtensions(P). Collisions: Matchings(g) is free, and PerfectMatchings(n) stays the matchings of 2n points; PerfectMatchings(g) would be a restriction of Matchings(g), and the integer form could later read PerfectMatchings(CompleteGraph(2n)). Wolfram's FindClique and siblings return one answer, so they do not collide.
First slice, one pull request after #1354 merges: Antichains(P).
-
combinatorics/posets/src/code.ts(new):codeOf(covers)(the closure, then the bits) andn = length; the held-past-n-10 rule. -
combinatorics/posets/src/families.ts(new): the Epsil family over(_n, _c)described in §3: kindints, carrierFinset,carrierParams: 1, tables of memberSubsetsranks,declaredwith an enumerativeworkof 2^n and the matching cost. -
combinatorics/posets/src/declare.ts: declareAntichainswith(poset) -> indexed_collection<finset>and handlers throughkernelOn; register its carrier asSubsetsdoes. -
families/call-forms.ts: export whatresolvedFromandpolyCollectionneed. -
combinatorics/reference/Antichains/index.md: the record, with anenumerate:example such asAntichains(Poset([[],[1],[1]])). -
combinatorics/posets/tests/antichains.test.ts: the test that proves it, fast and in the standard run:-
Antichains(P)equalsFilter(Subsets(Length(P)), reading)element by element, count, unrank and rank, for every poset through n = 4 (357 at n = 5 in a deep run), using #1354'sposetsOfSizeand an independent reading; -
Count(Antichains(P)) = AntichainCount(P)for the same posets; - at n = 11 the call holds unevaluated.
The gate (
vp check, the combinatorics tests,node tools/ci/dist-cache.ts build) runs on a build box; nothing here was run.
-
Then, each one change:
-
OrderIdeals(P): the same family with another predicate.Chains(P): the same with theChain(n)→ChainPoset(n)rename in the same change, againstChainCount. -
LinearExtensions(P)throughpermutationRestrictionwithstateandtables(§4); tests against filteredSymmetricGroup(n)and against aLinearExtensionCountfor posets (the name exists as a tree statistic; a poset overload by carrier). - The graph arm,
IndependentSets(g)andCliques(g), held toIndependentSetCount. If #1354 slips, this is the arm that can start on main, since the family and the test are the same. - Maximal chains and antichains (FindStat St000071, St000912) as restrictions of these in the induced order, once named-restriction rows exist.
- A restriction or a family? Recommended: defined as a restriction (§1), implemented as a family. The order is the base's, members keep their carrier, and the filter is the specification.
-
Which pair numbering does the code use? The first slice depends on it, and Speculative-Posets §9 answer 2 leaves it open (§1 of that page puts the first pair in the most significant bit; answer 2 recommends
LabeledGraphs' numbering). Recommended:LabeledGraphs' numbering (graphs/src/families/epsil.ts:126), so the code is a rank a test can hold; decide answer 2 first or together. - Integer code (D) or value parameters (A)? Recommended: D. It changes nothing in the family contract, which every family and several tools read; the cost is n ≤ 10. Revisit when a collection needs n > 10, or a value with no integer code appears.
-
What happens past n = 10? Recommended: the call holds, as
Tuples(list, k)does past its cap. Never an approximation. -
Names. As answer 4; do the
Chainrename withChains, not with the first slice (§6). If the rename is declined:PosetChains(P)for that one only. -
Isomorphic posets. The members are labels 1..n of the given natural labeling, so two isomorphic values give collections with equal counts and different members. Recommended: state it on the records.
Posets(n)is the collection that chooses a labeling. -
Should statistics call these collections? Recommended: no. The statistics core has no collection head (
statistics-core.test.ts:33-90), and compiled bitmask folds are what #1354 ships. The collections are cross-checked against the statistics instead. -
Where do the families live? In
combinatorics/posets/, next to the carrier, with the poset encoder;incidenceis untouched (posets answer 5). -
The graph arm's member carrier for
Matchings(g)andSpanningTrees(g):Finsetover edge positions inEdgeList(g)order, or the existingLabeledTree(an edge set)? Unneeded for the first slice; recommended: decide when the first of them is built.
Measured by reading the tree: that families take numbers only and where (types.ts:97, epsil.ts:43-57, :145, :500-504, declare.ts:48-51, :115-119, :316); the cache keys (:378, :442, :453, :528); carrierParams packing and carrierCodec; the call forms and what polyCollection offers; ConnectedComponents and PosetElements as list-valued; Restricted as Filter; permutationRestriction's interface; the statistics core test; that none of the eight names has a record or a Wolfram System name; the Chain references, 14 files.
Read from #1354 (open): the carrier record, withPoset, withRelation, ChainCount, AntichainCount, posetsOfSize (gh api, not on this checkout; the PR diff itself is cut off at about 1,640 lines).
Measured in Python: the member lists of §2; the sizes of §4; that the integer code is injective and decodes through n = 6; that antichains equal independent sets, chains equal cliques, and ideals and antichains correspond by maximal elements, through n = 6; that the memoized DP and the completion-count DP count, unrank and rank equal to the filtered base through n = 6; the DP states against members through n = 7; that p.join(",") shares 660 keys among 5,232 posets through n = 6.
Assumed or unverified: that Epsil can express the code decoding (digitOf, edgeIndex), the member table and the state/tables layout of linear extensions, and that they compile; that compute-engine types a Poset operand in the collection signature as written; that polyCollection can be exported without side effects; table sizes and times in Epsil; the dense table's size; that the family is total over all codes (from the definitions); the 2^53 bound of the code in the compiled path; whether a sampler can draw (n, c) without a validity filter; that Finset has the shape and the Subsets equality claimed for members of a restriction; Mathlib and Sage names beyond what Speculative-Posets §7 says.