# Biochemical readouts that preserve native function

Companion to manuscript 61, SHA-256 `bd27ad3fee701238aedb2442336de04b53187feb6e7b9cd23072c85c3491adbf`. Python 3.11+. All nominal rates and uncertainty intervals are synthetic design requirements, not fitted biochemical constants.

```sh
python -m venv .venv
# Activate the environment using your platform's command.
python -m pip install -r requirements.txt
python -m unittest -v
python example.py --output outputs
```

## Mechanism and main insight

The pool contains reduced cofactor X, oxidised cofactor Z and bound reporter complex B. The five channels are Z→X at pZ, X→Z+native product at kX, X+R→B at alpha*X*R, B→X+R at beta*B and B→Z+reporter product+R at cB. The conserved quantities are X+Z+B=C and R+B=Rt. Substrates driving regeneration and use are externally maintained; this is not an energetically closed cycle.

The reporter withholds bound cofactor from **both** native use and regeneration. Its effective turnover activity `u=alpha*Rt*c/(beta+c)` does not determine that storage cost. The code derives alpha from the calibrated primitives instead of varying it independently while claiming equal activity.

Let x0 be the reporter-free trajectory starting from exactly the same preparation, e=x0-x, w=e-b, I=integral(b), D=integral(k*(x0-x)), q=cI, a=p+k. The exact finite account is

`a*D = k*((p+c)*I + b-e)`.

After complete recovery, finite total association implies b,e→0, giving `D_infinity/q_infinity = k*(1+p/c)/(p+k)`. This factor is independent of the association schedule, beta, pool size and reporter stock at fixed final product. Dissociation shortens a binding episode but does not shorten integrated occupancy per successful product, which is 1/c. The instantaneous-turnover reduction omits the factor 1+p/c; at p=1,c=.2 that factor is six.

The numerical reactor independently integrates D from the native flux difference, as well as I, association mass and native product. It does not define D by the identity it is checking. An algebraic finite tail correction is compared with this integrated account. It never subtracts two divergent infinite cumulative product totals.

## Reusable architecture and inputs

* `reactor.py`: a small `RateLaw` protocol, `LinearRate` and `MichaelisMenten`, immutable `Reporter` and `AssociationSchedule`, and a `CofactorReactor` containing the literal equations and matched reference. Schedules support disjoint acquisition windows and ideal or exponentially fading shutoff. The integrator splits at every discontinuity.
* `certificates.py`: `DesignBox`, an `ObservationContract` carrying its own envelopes and threshold, `RecoveryCertificate`, exact exponential enclosures and nonlinear divided-slope bounds.
* `example.py`: editable nominal rates, pool, reporter, schedules, uncertainty box, records and dimensional scales; matched comparisons, fixed-product exposures, interior challenges, exact design/recovery calculations, continuous inference and figures.

To add a monotone kinetic law, implement its rate and divided-slope bounds and pass it to the reactor. Reusing the numerical interface does **not** make the linear design certificate valid for that new law. To change a reporter, construct its stock, release, dissociation and activity explicitly. To change a measurement contract, create a new box and contract instead of reusing a threshold from another set of envelopes.

```python
from reactor import LinearRate, Reporter, AssociationSchedule, CofactorReactor
source = CofactorReactor(LinearRate(1), LinearRate(1),
                        Reporter(total=1, release=20, dissociation=1, activity=.08))
schedule = AssociationSchedule(acquisition=8, windows=((0,2),(4,6)), fade_rate=1)
time, state, account = source.run(schedule, recovery=20)
```

The interval inputs use `Fraction` values. The numerical trajectories use floats and explicit solver tolerances. A schedule with fading enabled begins its residual exponential at acquisition end even if an earlier acquisition window ended sooner; this is part of the supplied schedule, not an inferred physical shutoff.

## Demonstrations

**Matched reporters.** Slow c=1, fast c=20 and a late fast pulse share u=.08, pool and reporter stock 1, p=k=beta=1 and deadline 8. Their nominal low-class signals are about .27040, .30549 and .15222. Peak suppressions are approximately 7.161%, 4.023% and 4.022%. Delaying the pulse reduces integrated exposure and output but barely changes the peak. These nominal comparisons are distinct from the uniform uncertainty certificate.

**Fixed final product and schedules.** A numerical exposure search adjusts four release rates to the same final product .1. The independent integral gives the chemistry-dependent cost coefficient for each. Constant, late, pulsed, fading and delayed-fading schedules give the same nominal coefficient .525 at c=20. Equal effective activity alone does not imply equal final product, so both comparisons are saved separately.

**Uniform preservation and discrimination.** The default box is p=.95–1.05 or 1.95–2.05, k=.98–1.02, C and Rt=.99–1.01, u=.079–.081, c=20–25, beta=1–2, gain=.98–1.02, relative preparation error .01 and additive detector error .01. The classifier concerns stationary native flux, while disturbance is compared with the actual matched transient reference.

The exact constants are B0=35721/772000 and suppression<=400869/8492000 = **4.72054875%**. The paper's rounded contract uses m=.94 and saturation allowance .005 only after checking that the unrounded bounds justify them. At T=8 it gives U=126420993/362500000, L=56426461/150750000 and residual margin `L-U-2E=1214759671/218587500000`, about .0055573. Rounded and unrounded contracts are both saved with their own thresholds. They are never mixed. The sufficient rounded certificate fails at T=6 and passes at T=7; this is not an impossibility or optimality statement.

Sixteen seeded interior trajectories exercise the full box, both preparation signs and both extreme gain/noise endpoints. They check implementation; continuum coverage comes from the source comparison inequalities, not from sampling corners or interiors. The preservation certificate requires c_min>=k_max, positive free-pool floor and an acquisition longer than the complex lag. Failed assumptions produce an error rather than an unsupported certificate.

**Recovery with a physical tail.** Ideal shutoff stops new association but retains bound cofactor. Its remainder uses the nonnegative account `(k/a)*(w+(p+c)*b/h)`. A fading switch adds the remaining association mass V to b in this expression. The numerical model bounds V by `alpha0*C*Rt*exp(-gamma*wait)/gamma`, and therefore returns intervals for complete product and remaining loss even at finite recovery times. It does not silently set V to zero after a finite wait.

The uniform recovery certificate combines two explicit convolution bounds. Outward rational exponential intervals verify each printed deadline and prove that the **same envelope** at the preceding .1 time step exceeds the target. These are minimum grid waits for the chosen bound/rates, not optimum physical recovery times. Default gamma=.5,1,2,5,10,21 give waits 22.7,11.2,6.8,5.2,4.9,4.9 for outstanding loss below 3e-6. At gamma>=21, a five-unit wait remains sufficient. A small outstanding remainder is not zero additional cost: fading creates further binding and a positive complete loss, bounded separately. Numerical comparisons integrate it independently.

**Inference without a class promise.** `ObservationContract.inverse` solves both monotone inequalities exactly, clips to the enclosing physical p interval, and converts it to a native-flux interval. It handles negative records, asymptotes, incompatible observations and boundary equality. The lower p endpoint uses k_min; the upper endpoint uses k_max. A nonempty outer set need not contain an actually attainable source, because the signal envelopes are sufficient bounds. Empty means incompatible with the declared contract. These deterministic sets are not confidence or posterior intervals.

For y=.30549, the outer p set is approximately [.95,1.2639]; for y=.41151 it is [1.4427,2.05]. The interval at the binary threshold meets neither promised class, so the binary interface returns incompatible with that promise instead of inventing a classification for a gap specimen. Without an explicit promise, the binary interface returns unresolved. The separate functional decision compares the entire flux interval with an editable functional threshold.

**Nonlinear extension.** For increasing regeneration g and native rate n, divided slopes G and K replace p,k. Provided c>=K_max and the matched/integrable source conditions hold, the complete cost ratio lies in

`[K_min*(G_max+c)/(c*(G_max+K_max)), K_max*(G_min+c)/(c*(G_min+K_min))]`.

For Michaelis–Menten V=K=10, pool 1 and c=20, this gives approximately [.4339,.6300]; a long finite trajectory yields .5236. Increasing affinities while keeping V/K fixed contracts the bounds toward the linear coefficient .525. The finite-horizon nonlinear ratio is labeled numerical; the code does not apply a linear recovery identity to it, and the linear operating window is not automatically inherited.

**Native/background alias.** Adding an unobserved linear background consumer makes the source depend on k+ell. The cases (p,k,ell)=(1,.5,1.5) and (1,1.5,.5) have identical x,b,q trajectories under the same schedule but native fluxes 1/6 and 1/2. The package demonstrates the identical observable records and different native outputs. Replicating that record cannot remove this structural ambiguity; native-specific calibration is a premise of the positive classifier.

## Evidence and units

The seven test groups check finite source and material accounts, independent loss integration, schedule behavior, exact decision constants, set-inversion containment, fading tails and deadlines, nonlinear slope bounds and the background alias. Saved outputs include full trajectory CSVs, exact fractions, numerical diagnostics, source/output SHA-256 hashes and figures. Exponential bounds use exact rational Taylor remainders, range reduction and outward rounding; that helper adapts the separately authored manuscript-60 example.

Conventional ODE existence, invariance and comparison theorems are imported from the manuscript, with hypotheses checked in the relevant interfaces. Lean is not rerun. The example does not claim numerical trajectories prove uniform bounds or biochemical calibration.

Illustrative scales are 1 micromolar, 60 seconds and 100 microlitres. They convert the eight-unit acquisition to 480 seconds and five-unit recovery to 300 seconds. The output recomputes conservative finite donor/native/reporter material caps for the selected horizon, rather than treating a printed cap or stock recipe as fixed. These caps do not guarantee that an actual supply maintains the declared rate laws. Removing bound reporter cargo, adding unmodeled cofactor stores, changing the detector envelope or allowing an unknown background consumer changes the contract.

## License

MIT is proposed for this example, pending the owner's decision. No new license grant is asserted by this package; manuscript and repository terms remain separate.
