# Trustworthy amplification decisions

Companion to manuscript 57, SHA-256 `c8a26ae06acfe7284d0ee02fd04f90eb89d13d6a77ce839e73e2bda765912dba`. Python 3.11+. All generated observations are synthetic. The reference parameters use the paper's normalized clock, g=1; assigning minutes requires a measured growth rate.

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

## What this example teaches

A detection time is produced by a stochastic source and then interpreted by a decision rule. The source, observation channel, and calibration population each matter. In the reference assay, **every timing-only decision fails the simultaneous 1% blank-positive / 5% loaded-negative targets**. Additional occupied-source information can repair the decision while preserving the amplification source. Increasing resource headroom can instead repair the timing experiment itself. Neither repair follows from a faster clock alone.

The second task is capacity measurement. Comparing waits at two fixed, absolute states removes a common clock multiplier. Keeping only completed wells destroys that cancellation. The example therefore carries finite intervals, right censoring, unresolved comparisons and calibration uncertainty through to a capacity set. An unbounded interval is a useful result, not an optimization failure.

## Editable models and component boundaries

The top of `example.py` holds the source, error targets, identity channel, acquisition settings, seed and uncertainty budgets. The **user source** follows those inputs. Clearly labeled **reference** calculations continue to reproduce the manuscript's fixed examples; their guarantees are not silently transferred to edited parameters.

* `source.py`: immutable `AmplificationSource`, exact `ErrorBounds`, conditional `IdentityChannel`, and a fixed-rate uncertainty envelope. The source exposes numerical forward errors, a hit-time sampler, initial-hit mass and rational certification. It has no measurement-fitting responsibilities.
* `observation.py`: calibrated state and crossing intervals, censored comparisons, paired/block capacity models, and confidence-set inversion. These components accept observations independently of the source solver.
* `certificates.py`: the fixed-reference timing dual, directed large-threshold scalar bounds, explicit deadlines and numerical limit laws.
* `example.py`: orchestration, synthetic acquisitions, CSV output and plots. Import the component classes to sweep capacities or replace the acquisition layer. There is no shared framework required by the other paper examples.

## The finite source and its decision boundary

The latched chain jumps z to z+1 at `q[z]=(b+g*z)*(1-z/R)` until threshold h. Require R>h-1 so every transient rate is positive. Blank wells start at zero. Loaded wells start at min(Poisson(lambda),h); the initial-positive atom is retained. Renormalizing only subthreshold loads would change the experiment. At h=20 and lambda=4 the atom is about 1.02005e-8; it is larger at h=5.

`numerical_errors` evaluates a transient matrix exponential. `certify` independently uses nonnegative uniformization, a rational exponential enclosure and an explicit omitted-Poisson tail. It supports repeated rates and returns exact rational endpoints. Large state/time requests beyond the declared budget raise an error instead of acquiring a certificate by approximation. Numerical root finding supplies a proposed blank-boundary deadline, not a rigorous root enclosure.

For h=R=5, b=.01, g=1, lambda=4, the numerical optimum at blank error 1% is time 4.459373 with miss probability **8.956569%**. Exact bounds at time five put both errors above their targets. Since blank errors increase and misses decrease, this separates all deadlines. The manuscript's likelihood-ratio theorem then extends the exclusion to **all randomized timing rules**, including the initial-hit atom. We use that theorem; a finite time grid would not establish this conclusion.

The package also regenerates the density sign polynomial and its four rational cells. Together with F(4)>.0073 and M(5)>.069, the manuscript's dual construction gives `Miss > .1055 - 5*FP`, hence >.0555 at FP<=.01. The separate deadline-optimality argument sharpens the nominal exclusion to >.069. These are sufficient lower bounds, distinct from the numerical optimum .08956569.

`deadline_status` returns usable only when both upper error bounds pass, excludes that deadline when a lower bound fails, and otherwise returns unresolved. `separates_all_timing` additionally requires both lower errors to exceed their targets at the same time and relies on the theorem's shared positive-rate source assumptions. A monotone downstream, label-neutral measurement cannot create source identity information; that data-processing statement is supplied by the paper.

## Adding identity while preserving the source

Let F be the blank hit probability, M the loaded miss probability, and e the empty-load probability. Occupied hit mass is `C=1-M-e*F`. A channel with false-positive cap f conditional on an empty-well hit and sensitivity floor s conditional on an occupied-well hit gives `FP<=f*F` and `Miss<=1-s*C`. This construction does not assume unconditional independence between identity and timing. It requires the stated conditional guarantees on the actual hit population.

`joint_fixture` provides an actual, source-preserving numerical law over hit/identity+, hit/identity-, and no hit, for both blank and loaded wells. Its occupied/empty mixture sums to one. The conservative guarantee does not credit accidental positives in empty loaded wells. At time seven, f=.01 and s=.99 give the paper's coarse bounds FP<.0003 and Miss<.0422443; freshly computed endpoints are tighter.

The example repeats the calculation for **fixed** coordinatewise rate changes of +/-2%, loading mean at least 3.99, and any deadline in [6.99,7.01]. Coupled holding times bound blank errors at the fastest/latest source and misses at the slowest/earliest source. The fresh upper bounds are approximately .00030848 and .04370698, below the paper's rounded .00032 and .04525192. This does not cover arbitrary time-varying rates. The capacity-ten reference similarly verifies a timing window [3.19,3.21].

The identity fixture is mathematical. It supplies no biochemical mechanism or measured specificity. Complete timing-law total-variation perturbations delta0,delta1 preserve the dual exclusion if `5*delta0+delta1<=.0055`. Separate total-variation budgets for the **joint** observation add to its two error bounds. Marginal timing accuracy does not establish a joint-channel budget. Zero-error trial counts 368, 72 and 12,295 illustrate the stated one-sided binomial plans; the last requires eligible hit-conditioned trials, not an arbitrary set of wells.

## Large thresholds without a huge chain

With growing headroom the centered time tends to a startup law `-log Gamma(n+a)`. With fixed zero headroom it has an additional independent limiting `-log Exp(1)` term. The two finite waiting-time sums use the same exponential innovations; independence is a limiting theorem, not a finite-source assumption. For the reference loading, numerical limiting blank-boundary misses are about **3.96249%** with growing reserve and **10.91390%** with zero headroom. Limits are not finite-threshold certificates.

`large_threshold_certificate` recomputes directed Riemann bounds, rational exponential/Poisson tails and the scalar inequalities underlying the paper's theorem for every h>=1,000,000. It uses imported gamma/product comparisons and concentration inequalities. The resulting reference claims are: timing exclusion at zero headroom (blank>.01086 and miss>.0563 at a separating deadline); identity-assisted FP<.00085 and Miss<.0413; and timing-only FP<.009373 and Miss<.048732 when R=2h. The fixed a=.01, lambda=4 and conditional channel are part of this theorem.

`explicit_deadlines` evaluates the stated finite harmonic sums through digamma differences, using constant storage. For h=1,000,000 the three normalized deadlines are approximately 29.52814, 32.92934 and 15.71263. These displayed times use floating-point arithmetic; the certificate concerns the exact formulas, not arbitrary rounding of a laboratory deadline. Changing the source requires new bounds. Lean is not rerun.

## Absolute-state capacity inference

At states i<j with known a=b/g and R>j, independent exponential waits within each well give `p=P(Dj>Di)=qi/(qi+qj)`. A common positive clock, even random between wells, cancels before comparison. `PairedCapacity` inverts p through `kappa=((1-p)/p)*(a+i)/(a+j)` and `R=(j-i*kappa)/(1-kappa)`. It intersects the probability/a interval with the physical domain 0<kappa<1. Results distinguish incompatible data, a finite outer interval, a lower bound and unresolved capacity. R=j is excluded; depletion zero denotes a limiting infinite capacity, not a finite model.

`BlockCapacity` replaces single waits with disjoint consecutive state blocks. A rational backward race computes P(V>rU), independently checked against a Kronecker-sum linear solve. Strict monotonicity is supplied by the manuscript's coupling theorem. Exact bisection returns outward capacity endpoints, retaining infinity when necessary. At states [1,3) and [3,5), r=1, R=7, the probability is exactly 111503293/331058412.

An endpoint-only blank law need not identify capacity if a is unknown: the two displayed sources at R=6 and R=4 have permuted rate lists (2,5/2,8/3), hence identical sums of exponential waits. The paired inversion explicitly requires known or bounded a. The sample planner shows why high capacities are difficult: sufficient wells for a 10% **point-estimator** relative-error target rise from 4,883 at R=7 to 9,911,503 at R=100. Guaranteeing an entire confidence interval inside that relative bracket uses a different, four-times-larger sufficient size.

Plateau-fraction timings answer a different question. The ratio of expected block times at 20%,40%,60% of capacity tends to .82678021 regardless of capacity. This is a ratio of expectations, not the expected ratio, and finite corrections can retain information. Use absolute calibrated states for the demonstrated inversion.

## Censoring and signal calibration

For duration intervals U=[LU,UU], V=[LV,UV], a comparison is positive only when LV>r*UU and negative only when UV<=r*LU. Everything else is unknown, including many right-censored wells. All n independent wells remain in the denominator. `CensoredComparison.confidence` uses the two one-sided Hoeffding bounds with an outward interval-arithmetic radius, plus a supplied average interval-failure budget. Shared calibration failure is a separate union-bound allowance. Arbitrary within-well dependence of crossing brackets is allowed; independence is required across the underlying comparison indicators with the declared common probability.

The reference seeded acquisitions exactly reproduce positive/negative/unknown counts **1752/2229/19**, **478/639/2883**, and **1367/2600/33**. Their capacity sets are approximately [6.745,8.715], [4.175,infinity), and [15.167,infinity). The short follow-up and high-capacity settings are not assigned artificial upper bounds. Selecting only U+V<=1 changes comparison probability with the clock, as the separate numerical quadrature demonstrates.

`SignalCalibration` converts y=B+Kz+error to an integer state interval, including baseline, gain and bounded-error uncertainty. For y=1110, B in [95,105], K in [.0009,.0011], error within +/-5, it returns **909091..1133333** units. An empty intersection returns incompatibility. `crossing_bracket` converts calibrated, monotone state intervals to crossing brackets; initially positive and right-censored records remain explicit. `DurationInterval.from_crossings` propagates shared crossing uncertainty without treating successive waits as independent. The paper's three-bracket example yields U=[1.4,1.6], V=[1.3,1.5], an unresolved comparison.

## Evidence and outputs

The package includes three full synthetic well tables, exact/directed results, numerical tradeoff curves, capacity sample-design values, figures, and provenance hashes. Seven test groups compare independent formulations, reproduce finite bounds, verify monotone interval containment, preserve loading atoms and censored records, and test physical-domain failures. General likelihood-ratio, coupling, limit-law and concentration theorems remain manuscript inputs. No empirical fit, clinical validation or Lean build is claimed.

## License

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