# Two consecutive productive windows in a random polymer reactor

Companion to manuscript 59, SHA-256 `662a47f66e9145138f080525227f6d6da0e9af0e8a13ac22b0d27df83f296851`. Python 3.11+. The source is schematic binary-word chemistry; no molecular identity or fitted kinetic rate is supplied.

```sh
python -m venv .venv
# Activate .venv using your platform's command.
python -m pip install -r requirements.txt
python -m unittest -v
python example.py --output outputs
# Optional: one additional small-count path through both windows.
python example.py --full-path --output full_path_outputs
```

## What the example demonstrates

A catalytic organization, its first physical molecule, and a productive operating trajectory are different requirements. The example compares three matched environments in the **full** n=4 catalogue: a selected product catalyzes its own formation, a food molecule replaces that catalyst, or all catalysis is deleted. Both reversible directions change together; basal chemistry, feed, washout, marks and food-only preparation are retained.

The deterministic self-catalyzed reactor exports about **102.78 and 109.00** normalized nonfood monomer units in the two windows. Yet at count scale V=100 its probability of meeting the startup requirement is bounded above by about **0.00003227**. A tiny deterministic concentration is not a molecule. The mathematical sufficient reliability bound uses a vastly larger count scale, and the example exposes exactly which noise term causes it.

## Components and editable inputs

The top of `example.py` holds the maximum word length, Zipf exponent, count scale for the theorem evaluator, reliability target, tolerances, small-count diagnostic sizes and unit illustration. Do not substitute the theorem count scale into a simulation: the SSA interface explicitly limits its count and event budgets.

* `polymer.py`: ordered `Catalogue`, immutable marked `Environment`, literal `Channel` and full `PolymerReactor`. The channel/ledger layout adapts our separately authored manuscript-55 companion; this standalone version implements manuscript 59's mark law and supports self, food, deleted and arbitrary sampled environments.
* `source.py`: `CappedZipf` row probabilities, conditional row/environment sampling, analytic moment formulas, finite source bounds and screening arithmetic.
* `certificates.py`: conditional six-term reliability bounds, an outward-rounded sufficient-scale planner, the necessary startup scale and elementary scalar checks.
* `example.py`: matched ODEs, independently seeded startup diagnostics, a saved conditional environment, source-moment tables, figures and optional full-horizon SSA.

Replace or extend an environment without changing the generator, or import the source sampler independently of the reactor. Models at n>4 retain the same 224 short productive labels while adding all longer words and split identities. Explicit catalogue/channel budgets are separate from the analytic moment budget. The default ensemble demonstrations concern the fixed source law; arbitrary coefficient changes require new bounds.

## Source law and kinetic generator

There are `2^(n+1)-2` nonempty binary words and `(n-2)*2^(n+1)+4` ordered split identities. At n=4 these are 30 and 68. Split position and ordered inputs remain part of a channel's identity, even when another identity shares its net stoichiometry.

For each molecule independently, draw K>=1 with mass proportional to K^-a and set `D=min(K,R)-1`. Conditional on D, choose a uniform D-subset of the R identities without replacement. The **entire Zipf tail** is retained at degree R-1. Incidences in one row are correlated. `CappedZipf.moments` evaluates the exact first/second factorial-moment formulas using high-precision zeta functions; for huge endpoints an Euler–Maclaurin evaluation avoids impractical direct Hurwitz evaluation. These are numerical evaluations, not directed probability certificates. Tests compare the formula with explicit degree sums and overlap-region Hurwitz evaluation.

Requiring an incidence biases the degree law by D/E[D]. For k required and ell forbidden distinct coordinates the likelihood is `(D)_k*(R-D)_ell/(R)_(k+ell)`. The conditional sampler uses that law before choosing the remaining uniform subset; it does not plant an incidence into an unconditioned row. At n=4,a=1.5 the cap atom rises from about .09 to .56 after one requirement. The saved witness-class environment has six empty food rows, the required self-incidence, and every other nonfood row sampled without restrictions. Floating-point categorical sampling implements the declared analytic law numerically. It is distinct from the three deliberately sparse matched environments, which are not conditional-source draws.

Each split has independent marks S and B in {1,1.5,2}, and each active incidence an independent H mark. Basal coefficient is epsilon*S*B and catalytic coefficient is 4*S*H, with epsilon=2e-9. S is shared across the basal and catalytic coefficients of the split. Each reversible pair shares its coefficient. The simulator combines repeated substrate/catalyst roles before applying falling factorials, with no factorial divisor. Count subtraction occurs before normalization. Catalyst appearances do not consume the catalyst.

Each of the six foods arrives at rate V; every molecule washes out at its count. Initially each food has V copies and all nonfoods have zero copies. The initial monomer mass is 10V, not 6V. The ODE uses the concentration mass-action limit and a BDF solver; the SSA uses the full marked jump process. The displayed deterministic curves do not establish finite-count probabilities.

## One uninterrupted operating event

The mission checks stock at times **1,100,199**, export above V/10 in each of **(1,100] and (100,199]**, a whole-path mass corridor M<=11V, and at most 1195V food arrivals through 199. Stock means mass<=10.5V and at least one individual length-four species at concentration >=1/(3e18); it is not the sum of all tetramers. A general path may qualify through different species at the three observations.

`simulate` evolves one environment and one path without restarting at 100. It records holding states at observation times, both separate export windows, the whole-path maximum mass, first nonfood/selected-product births, first corridor exit and signed internal synthesis. If the event cap is reached, `completed=False` and `mission=None`; missing observations are not treated as successful or failed completed experiments. Startup-only diagnostics also have `mission=None` because they do not observe the full event.

All paths satisfy the exact integer ledger `nonfood inventory + cumulative nonfood export = signed internal synthesis`. Reverse channels contribute their actual sign. The mission therefore forces net internal synthesis >V/5 and recovery of more than **1/12000** of supplied monomer, counting the initial 10V and gross feed. This is aggregate nonfood effluent, not a purified sequence, energetic efficiency or functional product. Positive basal output remains after catalytic deletion.

The default startup diagnostics are fresh runs with 16 seeds per setting, not a replay of the paper's 200-run table. They produce 0/16 births in the two self settings and deleted baseline, and 16/16 in the food setting. The food row also has a corridor exit, which is retained. Binomial intervals are descriptive for these complete independent diagnostics and cannot resolve a probability near 3e-5. Shared seed labels across interventions do not constitute a monotone coupling. Change `STARTUP_REPLICATES` to run a larger diagnostic, keeping its limited scope explicit.

## Startup ceiling and sufficient reliability

Before the first nonfood birth in a food-silent environment, all catalytic propensities vanish. Food monomer/dimer concentrations x,y obey x+2y<=11 on the corridor. The basal first-birth intensity is at most `4*epsilon*V*(2xy+y²) <= (484/3)*epsilon*V`. The manuscript's stopped-chain argument then gives ceiling `1-exp[-(484/3)*epsilon*V*t]` for birth by t **before corridor exit**. This is a domination bound; the state-dependent births are not themselves a Poisson process. A mission needs a tetramer by time one, so its necessary ceiling uses t=1, not 199.

The exact integer necessary scale for 99% mission reliability is **14,272,222** in that food-silent class. It is not sufficient: the first nonfood need not be the selected product and can wash out. Food catalysis changes the premise and can act immediately from the initial state. The example brackets exponentials rationally and verifies the preceding integer cannot meet the target ceiling.

The sufficient theorem instead assumes the witness source: empty food rows, selected self-incidence, arbitrary other nonfood assignments, allowed marks and food-only preparation. `TwoWindowCertificate` checks all six jump-corrected tolerance conditions and sums the six exponential tail terms without an independence assumption. Invalid margins return “not certified.” The integer sufficient-scale planner uses outward logarithms and then rechecks the rational probability bound at the proposed scale.

At 99% of each allowed tolerance and target failure .01, the sufficient count scale is about **5.00016438e49**, dominated by the selected-product coordinate. It has absolute tolerance 1/(3e20); its square enters the tail exponent. The rounded example V=5.001e49 passes. The common-tolerance scale is about 8.966e50 at n=4, while the paper's broad envelope is 2.5e61. These are conditional witness reliability scales, not physical reactor designs or estimates of a minimal sufficient count.

The interval calculation is also replayed: a 99-unit window has certified normalized export lower bound .1595311015. Integer duration 79 passes the .1 target and 78 does not. The bound comes from one set of prefix-noise controls over the whole horizon; it is not a restart guarantee from an arbitrary stock state, nor an infinite-time persistence theorem.

### Corrections to the written scalar derivation

The example does not propagate three misleading equalities in the manuscript prose:

1. In Lemma 5.4, the mass compensator integrates the **actual** mass drift, so it is not identically 10. Variation of constants with prefix noise bounded by 1/4 gives mass<=10+2/4=**10.5**, sufficient for the stated endpoint and corridor limits.
2. In Lemma 5.5, the forcing `epsilon*(1/1358-2e-5)^2` is about **1.026e-15**. Its ratio to 1476 is about **6.95e-19**; that smaller number is the equilibrium scale, not a forcing to divide by 1476 again. The code propagates both coordinate-noise allowances and uses exp(-1476)<=1/1477 to obtain an exact time-one lower bound above the stock floor.
3. At the broad envelope V=10^60(n+1)^2, cV/n is much larger than 48. The inequality cV/n>=48 is useful, but the appendix's equality of the actual error to 24*exp(-48) is not used.

These are fresh elementary checks, not a replacement formal proof. The general drift-to-path and six-noise probability results remain imported manuscript theorems. The manuscript artifact and its verification receipts are unchanged; Lean is not rerun.

## Source rarity, dependence and selection

`productive_census.csv` enumerates exactly **224** labels: 32 food-to-nonfood ordered splits, each with six food catalysts and its own product. Of these, 192 are food-catalyzed and 32 are self-catalyzed. The union bound uses the common incidence marginal, not independent assignments.

The witness source mass is `P(empty row)^6 * incidence_probability`. The program integrates a valid conditional witness reliability bound against that mass. It also evaluates the finite converse residual: at n=4,a=1.5 the chance of at least two incidences in the enormous localization rectangle is essentially one (its complement is about 10^-11.446). Thus the finite success upper bound is **uninformative**, even after replacing the formal containing-rectangle coefficient 15480 by the sharpened census 224. The program says so rather than presenting a narrow-looking predictive interval.

The source tables show the exact-formula incidence and same-row pair probabilities for several exponents. Along a_n=2-2/n, 2^n*p_n tends to 9/(2*pi²). The theorem gives an operational rarity order, with asymptotic prefactors between (6/pi²)^6 and 224; it does not identify the actual success coefficient. Successful paths select a unique productive incidence asymptotically under the stated volume sequence, without establishing equal weights for the 224 labels.

For fixed 1<a<2 the same-row pair/incidence ratio tends to `2*(2-a)/(3-a)>0`; the current converse cannot establish singleton dominance there. This is a limitation of the argument, not proof that dominance fails dynamically. For a>=2 the ratio tends to zero. Numeric source curves are not empirical operation frequencies.

`screening_trials` uses independent **complete fresh experiments**, each resampling the environment and trajectory. Repeating runs in one fixed sampled environment instead gives `1-E[(1-q(environment))^N]`; replacing this by `1-(1-E[q])^N` is invalid. Conditional source sampling, conditioning on successful operation and selecting highly reliable environments are three different laws.

## Units, outputs and evidence

The illustrative conversion is V=Avogadro*volume*concentration. At one micromolar, the necessary startup count corresponds to about 23.7 pL, while the sufficient witness scale corresponds to roughly 8.3e31 L. A one-hour residence time turns the mission into 199 hours. These conversions expose the conservatism of the sufficient bound and do not calibrate any reaction. Forward and reverse molecularities differ, so equal dimensionless coefficients have different dimensional units.

The package includes full matched ODE tables, fresh startup path records, a complete sampled conditional environment, productive-label census, source moments, exact/directed bound results, figures and provenance hashes. Seven test groups compare explicit row enumeration with conditional formulas, literal propensities with vectorized rates, ODE and integer material ledgers, exact scalar inequalities and finite-scale hypotheses. Imported general probability, asymptotic and comparison theorems remain clearly separate from numerical illustrations. The output is a foundation for changing the specified model, not evidence that changed models inherit the theorem.

MIT is proposed for newly authored example code, pending owner confirmation. This note does not grant a license. Manuscript and cited material retain their own terms.
