# Exposure and amplitude limits for inherited-state populations

Companion to manuscript 65, SHA-256 `1be8ca10a66dcac8fbc1175361298ce9ac2b729529221e7c6a94a8e28687b77c`. Python 3.11+. The source and certificate algebra use exact `Fraction` arithmetic; numerical experiments and plots use the pinned dependencies.

```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
```

## Source, population and endpoints

A cell has N abstract sites, with a activating marks, r repressive marks and N-a-r unmarked sites. Basal and recruited writing add either mark; intrinsic and opposing-mark-recruited erasure remove them. These are molecular reaction rates, not externally fitted phenotype-switching rates. States with a>r receive the protected death rate. Division removes the mother and assigns each old mark to exactly one of two daughters, which refill with unmarked sites. No extra dilution or recovery interval is inserted.

The full ordered daughter-pair law is retained in the nonlinear probability generating function. The two daughters are correlated even though each has a binomial marginal. The first-moment matrix needs only expected offspring counts; extinction probabilities need the joint law. Replacing the pair law with independent draws changes the source.

`InheritedPopulation` constructs the finite state list, conservative chemical generator, pair law, exact generating-function field, mean matrix and Taylor coefficients. `MolecularRates`, `Action` and `Phase` separate background biology, additional intervention rates and chronological duration. A numerical backward solver composes deterministic phases in **reverse chronological order** from the declared terminal extinction vector.

Terminal zero means extinction by the fixed deadline. A terminal extinction vector for a specified off-source instead means eventual extinction after withdrawal. The default early policy withdraws additional erasure at time 40 but retains background killing to time 100 and afterwards. Full withdrawal stipulates a different source, with all-state division .1 and death .01, whose extinction vector is .1. Outgrowth above a detection threshold, clinical recurrence, a census with missed cells and any immigration process are different endpoints.

## Editable and reusable models

The first block in `example.py` exposes site count, reaction rates, protected/unprotected demographics, founders, preparation, risk target, common exposure budget, amplitude, horizon, second-actuator amplitude and optional feedback simulation. Initial mark counts must fit the edited site count. Rates are synthetic and default time units are unspecified. The exposure is additional first-order rate times time, not cell-weighted exposure, drug mass or concentration.

```python
from fractions import Fraction as F
from population import MolecularRates, InheritedPopulation, Action, Phase

source = InheritedPopulation(MolecularRates(sites=6))
phases = [Phase(40, Action(eraser=F(29,100))), Phase(60, Action())]
extinction = source.schedule(phases)  # numerical finite-time probabilities
print(1 - extinction[source.index[(6,0)]])

# Add an explicit second mechanism, priced separately.
repaired = [Phase(100, Action(eraser=F(29,100), protected_death=F(1,40)))]
print(source.schedule(repaired))
```

`ExposureCertificate`, `AmplitudeCertificate` and `WeightedDrift` are separate contracts. Their `verify` methods reconstruct the source inequalities and reject unsuitable witnesses. A witness for two sites, one demographic map or one continuation cannot silently be transferred to another. `example.py` keeps fixed manuscript replays distinct from custom schedule exploration. The configured second-actuator result is checked anew using a unit weight; failure of that sufficient test is reported as unresolved, not impossibility.

`FeedbackSimulator` is optional. A callback observes the history and chooses a common eraser level held constant until the next event or budget boundary. The simulator includes type changes, death and correlated replacement by two daughters; it stops exactly at common rate-time budget exhaustion before switching to baseline. Population/event caps return **unresolved_resource_cap**, never extinction. One path is an illustration, not a risk estimate or proof of optimality. Time-dependent changes between callback events require an extended event calendar or thinning scheme; do not use this callback as an undocumented continuous controller.

## The three barriers

The exposure certificate verifies `Phi_base(q)<=0` and `R*q<=c*(1-q)`, with 0<q<=1. The continuation must also obey the supersolution inequality. For initial count vector z and pathwise budget B, the theorem gives survival at least

`1 - product_i (1 - exp(-c*B)*(1-q_i))**z_i`.

This is a population barrier derived from its conditional generator. It does **not** factor founder probabilities under feedback. The code checks the exact generator identity directly at a mixed configuration and checks the supersolution-segment identity. Shared control can couple family histories; the conventional theorem is what extends the source inequalities to all admitted predictable policies.

For the two-site reference, q=(.94,.982,.987,.27,.735,.235) and c=67/73 have exact baseline slack at least 1/5000 and nonnegative actuator slack, with equality at AU. That identifies a limiting constraint of this certificate, not an optimal biological target. Stable `log1p`/`expm1` formulas display the necessary exposure for many founders. Floating logarithms are numerical evaluations of exact formulas, not rounded accept/reject thresholds. A random preparation must be averaged over its actual configuration law; substituting its mean composition is generally invalid.

The amplitude certificate instead checks the **same q at both admitted action endpoints**. Affineness then covers every intermediate action. Its floor `1-product(q_i**z_i)` is exact and independent of exposure or duration, including cell-specific predictable policies. This is stronger than showing that one constant action fails to contract. The N=6, amplitude=.29 witness yields survival at least .45962721 from one fully activating founder; N=5,7,8 yield .17008641, .61348974 and .70130311. These are population non-extinction bounds for the source, not detection or clinical predictions.

The finite-time floor uses a bound on every effective death rate. For binary division with no immigration it gives `1-(1-exp(-dmax*T))**n`. It constrains a deadline, not eventual survival after an arbitrary continuation. The time and exposure restrictions are simultaneous necessary conditions; their probabilities are not multiplied. Any zero-offspring replacement would have to be counted as death.

## Constructive policies and finite-time validation

At intrinsic erasure .3, the exact weight (1419,1105,1000,8423,4305,10765) gives `A*w<=-.105*w`. Markov's inequality then gives risk at most `10.765*n*exp(-.105*t)`. The sufficient exposure is `(58/21)*log(10.765*n/risk)`, contingent on amplitude at least .29 and the required duration. Extinction is absorbing, so achieving finite-time extinction risk also controls later survival under any continuation without immigration.

The sharper fixed two-site policy uses intrinsic erasure .3 for 40 time units, then baseline .01 for 60. `validated_pgf.py` and `exact_source_checks.py` are **unmodified attributed manuscript kernels**, with hashes in `provenance.json`. This example executes their outward-rounded 110-bit dyadic Taylor calculation afresh. The invariant probability cube bounds the order-12 derivative; the degree-11 local expansion and rational one-sided Lipschitz propagation enclose every phase-composition error. No numerical ODE tolerance is a certificate premise.

The one-AA-founder finite-time survival upper bound is below .009818264214475 at exposure 11.6. The one-founder result cannot be reused unchanged for ten or one hundred founders; the saved exact upper bounds are `1-(1-epsilon)**n` for the predetermined schedule. The necessary and sufficient exposure curves leave an unclassified gap and do not identify the optimal controller. The schedule curves for early, late and spread exposure are numerical diagnostics.

## Memory size, source discrepancies and second actuator

The supplied `site_certificates.json` and `source_certificates.json` are candidate witnesses, not trusted verdicts. Every q, weight and residual is recomputed using the independently constructed source. For N=2..8, exact M-matrix tests and positive-weight Collatz bounds check the signs at the published erasure endpoints. The original six-decimal endpoint weights generally produce intervals spanning zero for N>=3; they do **not** independently confirm those signs. The example preserves those coarse intervals in its output, proposes finer positive rational weights and accepts them only when exact arithmetic proves the sign. Thus it supplies the missing independent endpoint check rather than copying a successful label.

Endpoint sign tests bracket a crossing; they alone do not prove a unique global first crossing in erasure. In addition, the all-policy amplitude threshold and the constant-action mean-growth threshold are different mathematical objects. The paper's detailed Section 4.1 explicitly leaves their exact equality unproved despite stronger shorthand elsewhere. This example retains that boundary and reports the actual all-policy supersolutions separately. For added death the mean matrix decreases componentwise, so its threshold bracket has a monotone interpretation.

The mean operator uses `D Phi(1)=A`. The minus sign in the prose of Section 2.3 is inconsistent with the displayed definition; the source and a central exact derivative test use the algebraically correct sign.

A protected-state death actuator gives uniform unit-weight decay as soon as added death exceeds .09, at rate `min(kappa-.09,.2)`. This is an **N-independent sufficient threshold**, not an exact critical threshold equal to .09. At kappa=.29 all types have net growth -.2 and sufficient exposure is `1.45*log(n/risk)`. The saved N=6 repair adds death .025 while keeping eraser amplitude .29; a freshly checked rational weight proves negative drift. This shows a defined second mechanism can repair the first actuator's failure; it does not establish drug synergy under an unspecified cost or response law.

The source is not monotone in erasure for every preparation. Exact Taylor coefficients give an RR extinction difference between high and baseline erasure of `-49619/600000000*t**4 + O(t**5)`, with lower-order coefficients equal. That proves stronger erasure can reduce short-time extinction from this preparation. The small t=1 difference is numerical. Slower protected division is also checked as a fixed uncertainty interval: identical certificate vectors are verified at both endpoints, and affineness covers the interior. This is a scenario analysis, not a measured confidence interval or deep-dormancy model.

## Units, evidence and reuse limits

The optional concentration calculation assumes a calibrated concave engagement law `v(C)=vmax*C/(K+C)`. Necessary reaction exposure then implies an AUC lower bound only when `vmax*T>B_required`; no finite AUC meets equality. A separate one-compartment clearance model converts that necessary AUC into an administered-amount floor, accounting for any initial concentration. The sample K, volume and clearance are uncalibrated placeholders. These are conditional necessary bounds, never suggested treatment schedules. A Hill response with exponent greater than one does not inherit this global-concavity argument.

All founders stay in the denominator. Density dependence, space, observation error, hidden molecular states or persistent immigration require a new source and a new endpoint mapping. Shared net growth rates do not identify separate division and death or their extinction probabilities. Correlated calibration uncertainty needs a jointly valid source set; marginal intervals do not supply joint coverage.

Exact rational residuals, polynomial coefficients and the freshly validated finite-time interval are finite computations. Their population interpretation uses the paper's conventional probability theorems. Numerical PGF curves, long-horizon approximations to the minimal extinction vector, candidate searches and SSA paths remain numerical. Lean is not rerun and the stochastic theorem is not presented as formalized.

Outputs include source configurations, all residuals and refined weights, deterministic schedules, exact finite-time and founder bounds, preparation/withdrawal comparisons, demographic sensitivity, the second actuator and CSV sweeps. PNG/SVG figures derive from those results. Seven scientific test groups check the source, contracts, evidence boundaries and budget behavior.

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