# Reliable finite-time output from stochastic autocatalytic reactors

Companion to manuscript 55, SHA-256 `7d8ef88769b6d9fb3bb24d015352f39a001e752b76ceaade289523efc24a9601`. Python 3.11+. The binary words label a schematic chemistry; the inputs are illustrative, not measured rate constants.

```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 literal small-count trajectory; save separately from the default replay:
python example.py --simulate --output stochastic_outputs
```

## The insight and the model

A structural RAF supplies no startup time, stock guarantee or collected output quota. This paper adds a fed, diluted, finite-count reactor and a single uninterrupted mission. Catalysts in the surrounding network can destroy the selected tetramer 0011. But those catalysts are themselves nonfood material, which is collected when washed out. The proof turns that disturbance into an output account: either the selected species grows, or sufficiently much nonfood material is already present to generate effluent.

`polymer.py` implements the literal ordered-split catalogue. At n=4 it has 30 words and 68 reversible identities, including distinct ordered identities when their stoichiometry agrees. Every split has a basal pair, selected self-catalysis adds 00+11+0011 <-> 0011+0011, and arbitrary background incidences can be supplied. Both directions share a coefficient. Food consists of the six length-one and length-two words; each enters at rate V and every molecule washes out at unit rate. Preparation has V copies of each food and no nonfood. Initial total monomer mass is 10V.

`Channel` combines repeated input roles before evaluating falling factorials, with no combinatorial divisor. For example, a split g+g -> gg catalysed by g uses (N_g)_3, consumes two net copies of g, and returns its catalyst. Stoichiometry alone cannot supply the propensity. The catalogue supports n=4..10 for explicit computation; the analytic certificate handles arbitrary integer n>=4 without enumerating an exponential catalogue.

## Reuse the components

Edit the inputs at the top of `example.py`, or import the classes:

* `CatalyticAssignment` stores the paired basal and selected coefficients, explicit background `(catalyst, split, coefficient)` tuples, and an optional full set of weak food incidences. It validates membership in the paper's uncertainty class. Nonfood coefficients are absent or in [4,16], basal coefficients in [2,8]*10^-9, and food coefficients no larger than the supplied eta. Duplicate incidences are rejected.
* `PolymerReactor` builds the channels, density ODE, falling-factorial density flux, direct marked SSA and material ledgers. All channels remain active. Change the background tuple to explore a designed chemistry; this does not change the uniform certificate's assumptions.
* `RetainedReward` keeps the logarithmic increment of every selected-count loss and the designated self-catalytic birth. It discards the logarithmic part of other favorable births but retains the food-deficit potential increment on **every** mark. Integer deficit differences avoid losing tiny jumps at macroscopic V.
* `Bernstein` and `ServiceContract` expose the abstract drift-to-output calculation. Its general generator inequalities and stopping conventions must be justified for any different model; plugging in plausible constants is not a proof.
* `ReactorCertificate` computes the paper-specific count floor, drift, quadratic rate, jump bound, finite-window quotas and separated error budget using exact rational arithmetic.

The default designed model includes every food incidence at strength 10^-5 and no extra nonfood incidences beyond the witness. Its density ODE exports about 106.94 and 109.38 normalized monomer units over the two windows. These values describe this designed deterministic model and are far above the conservative uniform floor; they are neither stochastic reliability estimates nor improvements to that floor. The material identity `nonfood mass + collected output = signed internal synthesis` is checked independently.

## Mission and probability certificate

The mission requires stocks and total mass at times 1, 100 and 199; output greater than V/10 in each of (1,100] and (100,199]; total mass never above 11V; and at most 1195V food arrivals. The trajectory and chemistry are never reset at time 100. Output is the sum of the lengths of **all nonfood molecules** washed out. It is not purified tetramer or functional yield.

At V=2*10^22, eta=10^-5 and reward allowance 48, the computed cutoff is h=6667, the normalized quota is greater than 0.10103399 per window, and the total failure upper bound is below 2.87*10^-11. The six paper operating points use the largest n allowed by V>=10^8*n, so their scalar budgets also cover smaller n. The two all-window rows use V>=10^9*n. The user-configured certificate uses the actual supplied n. All-window bounds apply simultaneously to every sub-window of (1,199], and pay twice the two martingale endpoint allowances; negative quota values provide no positive output guarantee.

Every budget keeps the mass guard, food guard, establishment floor, retained reward, output clock and feed clock terms separate. Exponentials are upper-enclosed by reciprocals of positive rational Taylor lower bounds. Exponents are conservatively capped at 130 and the floor-bound integer at 10000 to bound arithmetic cost; any eventual reporting plateau is a numerical enclosure choice, not a failure floor in the paper's theorem. The zero-quadratic-rate Bernstein case returns zero error. Volumes below 10^22 return unavailable rather than importing an unproved stronger establishment estimate. A valid scalar calculation with insufficient quota is labelled `QUOTA_NOT_CERTIFIED`.

The inverse planning CSV uses ordinary floating-point logarithms and square roots and allocates **only reward-tail error**. Guard, floor, export and feed errors remain additional. It is a numerical planning aid, not a rounded-outward guarantee. A new floor larger than the proved h is not assumed.

## Generator diagnostics and finite counts

The generator panel independently sums every literal mark at four states of an n=4 dense background: every nonfood row has degree 67 and every food row is full at weak strength. The retained variance is small even when a symmetric full-potential variance is enormous. The panel verifies local drift, variance, jump, mass and output identities at those states. It does not prove the uniform generator inequalities, which are supplied by the manuscript. The tests separately verify the completed-square identity, scalar provenance, repeated roles and product-Poisson detailed balance for internal reversible pairs. Feed and washout drive the open system and do not inherit internal detailed balance.

The optional SSA is a direct finite-count simulation at V=20 by default, with every reaction available. Its seed 55092026 completes 47,541 events over 199 residence times, collects 0 and 10 monomer equivalents in the two windows, and fails the mission. Its material ledger balances exactly. A simulation stopped by the event budget returns incomplete and no mission verdict. The generator is frozen at each pre-jump state for the usual exponential waiting time and categorical mark draw; event timestamps are used for the original mission windows and stock observations. Small-count trajectories, and deterministic traces that seed arbitrarily small densities, cannot establish theorem-scale food-only startup reliability.

## Chemistry acquisition, units and readout

`source_mass_alpha2_n4` uses a fresh exact Machin enclosure of pi to bound the capped-Zipf witness mass, about 0.0018736515. The degree is min(J,68)-1, including the entire capped tail. Six food rows must be empty and the selected row must contain the selected identity. The conditional reliability multiplies this mass. The exact screening check proves that 1600 independent redraws of chemistry, coefficients and trajectory give a lower bound above 95%. Repeating trajectories in one sampled chemistry is a different experiment. Weak-food robustness is pointwise in a modified coefficient family; it does **not** remove the food-silence factor from this source average. No matching converse or selection result is transferred to the new scale.

With reference concentration 1 mM and residence time one hour, V=2*10^22 corresponds to about 33.2 litres and the mission lasts 199 hours. The code converts selected forward and reverse coefficients using their different reaction orders. Shrinking the volume by increasing reference concentration changes the required physical rates. The sufficient count scale remains roughly fifteen orders above the necessary food-silent first-birth scale; it is not a small-reactor design claim.

`readout_floor` requires nonnegative calibrated response for every nonfood species. With response at least 0.95 times monomer length and negative error at most 0.002V, a quota of 0.135V implies signal above 0.12625V. A selective assay omitting any nonfood species has minimum response factor zero and no informative aggregate-output adapter. No functional-product interpretation follows.

## Outputs, evidence and license

The package exports complete density trajectories, exact operating rows and error groups, inverse planning values, generator diagnostics and two PNG/SVG figures. Seven test groups check the scientific seams rather than image bytes. The manuscript proves the new stochastic results conventionally and reports compiled algebraic/scalar components; the earlier food-silent theorem has a separate end-to-end formal status. This example freshly checks the stated scalar and finite algebraic identities, does not re-prove the stochastic theorem, and does not rerun Lean. There are no measured chemical or assay inputs.

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