The K-COS MethodReading edition

Directed probability enclosures

Reading tools
Reading libraryFind statementsInspect Lean
Switch work

Saved reading

Read side by side

Start reading

Resources & source

Original TeX with line links · Download TeX

The wording and mathematics follow the retained manuscript. This reading format does not add a proof review or extend Lean coverage.

Skip contents and start reading

9 Directed probability enclosures

An analytic remainder estimate controls the error of a mathematical approximation. A numerical enclosure must also control the arithmetic used to evaluate it. This chapter joins directed arithmetic to explicit remainder bounds, yielding an interval for an exactly supplied positive spectrum under the stated arithmetic trust assumptions.

The notation follows the analytic development: \(\kappa\) is the cumulant generating function, \(b\) the support endpoint, \(N\) the retained mode count, and \(J_k\) the payoff coefficient. The implementation-name correspondence is given in Appendix C.

9.1 Interval target

For a positive central quadratic form

\[ Q=\sum_{j=1}^{r}\lambda_jZ_j^2, \qquad \lambda_j>0, \]

the output is not merely a point estimate. It is

\[ \boxed{ \log_{10}P(Q\ge q)\in[d_-,d_+]. } \]

Hence the corresponding multiplicative uncertainty satisfies

\[ \boxed{ \frac{p_+}{p_-}\le 10^{d_+-d_-}. } \]

The finite transform and exponential prefactor are evaluated by directed-rounding interval arithmetic. The resulting interval is enlarged by two independently proved analytic remainders: a support/periodization alias bound and an omitted-COS-mode bound.

9.2 No exact saddlepoint is required

Choose any

\[ 0<\theta<\frac{1}{2\lambda_{\max}}. \]

Exponential tilting gives

\[ P(Q\ge q) = e^{\kappa(\theta)-\theta q} S_\theta(q), \]

where

\[ S_\theta(q) = E_\theta\!\left[ e^{-\theta(Q-q)} 1_{\{Q\ge q\}} \right]. \]

The interval proof does not require \(\theta\) to be the exact saddlepoint. A high-precision saddlepoint is used only as an efficient design choice. Once serialized as an exact decimal input, it is simply a valid tilt inside the MGF domain.

The same is true of the support endpoint \(b\) and the auxiliary Chernoff parameter \(\eta\). Correctness requires only

\[ b>q\ge0,\qquad b>0, \qquad \theta<\eta<\frac{1}{2\lambda_{\max}}. \]

9.3 Rigorous support and alias control

Under the tilted measure,

\[ P_\theta(Q>b) \le \exp\left\{ \kappa(\eta)-\kappa(\theta)-(\eta-\theta)b \right\}. \]

The full-characteristic-function cosine expansion periodizes the tilted density on \([0,b]\). Because the original positive quadratic form is supported on \([0,\infty)\), the total positive-tail mass aliased back into one fundamental interval is at most \(P_\theta(Q>b)\).

The actual payoff omitted above \(b\) is at most

\[ e^{-\theta(b-q)}P_\theta(Q>b). \]

Therefore

\[ \boxed{ E_{\rm support} \le P_\theta(Q>b) \left( 1+e^{-\theta(b-q)} \right). } \]

9.4 Rigorous infinite-mode control

Define

\[ a_j= \frac{2\lambda_j}{1-2\theta\lambda_j}. \]

The normalized tilted characteristic function satisfies

\[ |\phi_\theta(t)| = \prod_{j=1}^r \left( 1+(a_jt)^2 \right)^{-1/4}. \]

Since

\[ 1+(a_jt)^2\ge(a_jt)^2, \]

we have

\[ |\phi_\theta(t)| \le C_\theta t^{-r/2}, \qquad C_\theta=\prod_j a_j^{-1/2}. \]

For the payoff coefficient

\[ J_k= \int_q^b e^{-\theta(x-q)} \cos(k\pi x/b)\,dx, \]

the elementary bound

\[ |J_k|\le\frac1\theta \]

holds.

Let

\[ \nu=\frac r2>1,\qquad N\ge1. \]

For a finite transform retaining modes \(0,\ldots,N-1\),

\[ \boxed{ E_{\rm series} \le \frac{2C_\theta}{b\theta} \left(\frac{b}{\pi}\right)^\nu \left[ N^{-\nu} + \frac{N^{1-\nu}}{\nu-1} \right]. } \]

This implemented interval backend therefore requires \(r>2\). Lower-rank positive forms can use a different tail bound and are not claimed by this theorem.

9.5 Final enclosure theorem

Let \(\boldsymbol S_N\) be the directed-rounding interval containing the finite \(N\)-mode tilted COS sum, and set

\[ E=E_{\rm support}+E_{\rm series}. \]

Then

\[ \boxed{ S_\theta(q) \in \boldsymbol S_N+[-E,E]. } \]

If the lower endpoint of this interval is positive, directed rounding gives

\[ \boxed{ \log P(Q\ge q) \in \kappa(\theta)-\theta q + \log\left( \boldsymbol S_N+[-E,E] \right). } \]

All finite arithmetic in this expression is enclosed by the interval backend.

9.6 Completing the running calculation

The factor, spectrum, and tilt of Sections 1.5–6.3 now determine a complete positive-spectrum calculation at \(q=40\). The exact diagonalization supplies the coefficients \((1,1,2,2)\). The implementation receives those coefficients as exact decimal literals, together with a serialized decimal approximation to the admissible tilt. Correctness does not require that decimal to equal the radical saddlepoint exactly.

With \(b=512\), \(N=16384\), auxiliary tilt \(\eta=0.245\), and 60 interval decimal digits, the supplied backend returns a logarithmic interval. Rounding its lower endpoint downward and its upper endpoint upward gives the readable enclosure

\[ \log_{10}P(Q\ge40)\in\bigl[-4.04489575,-4.03897381\bigr]. \]

At \(N=8192\), the directed ratio upper bound is approximately \(0.0246131\), which fails the requested tolerance \(0.02\). Doubling the retained mode count, rather than relaxing the tolerance, gives the interval above. The full serialized interval has a directed multiplicative ratio upper bound below \(0.013731\). The displayed, coarser interval also meets the requested tolerance \(0.02\). An independently evaluated interval for the exact expression \(2e^{-10}-e^{-20}\) lies entirely inside the COS enclosure.

This same fixed enclosure does not meet tolerance \(0.001\). The acceptance routine rejects that tighter request. This is an intended distinction between an accurate point estimate and an established enclosure width. The rank-four example has slower Fourier decay than the rank-eighty control developed later, so its mode count should not be interpreted as a general cost prediction.

The running example under a requested multiplicative width of 2 %. Increasing the mode count narrows the directed interval from a failing width of approximately 2.461 % to a passing width of approximately 1.373 %. Diamonds mark the independent closed-form reference. The reference-centered axis is rounded for display only.
Figure 9.1. The running example under a requested multiplicative width of \(2\%\). Increasing the mode count narrows the directed interval from a failing width of approximately \(2.461\%\) to a passing width of approximately \(1.373\%\). Diamonds mark the independent closed-form reference. The reference-centered axis is rounded for display only.

View full-size figure (new tab)

The certificate in this example concerns the tail evaluation for the exact spectrum. Its connection to the matrix is the explicit algebraic diagonalization above. It does not test a black-box eigensolver. Chapter 5 gives the separate post-verification theorem required for a general computed eigensystem.

9.7 Independent exact interval control through \(10^{-5000}\)

For the control

\[ Q=0.02\chi^2_{80}, \]

the survival probability has the finite exact formula

\[ P(Q\ge q) = e^{-x} \sum_{j=0}^{39} \frac{x^j}{j!}, \qquad x=\frac{q}{0.04}. \]

This finite expression was evaluated independently by directed-rounding interval arithmetic, without using K-COS. The K-COS enclosure and this exact control enclosure are compared at thresholds targeting

\[ p\approx10^{-100}, \qquad 10^{-1000}, \qquad 10^{-5000}. \]

With \(N=128\) and 90 interval decimal digits, the resulting K-COS widths are listed below. Widths and ratios are computed from the full outward endpoints before rounding the displayed values. At all three stored inputs, the independent exact-law interval is fully contained in the K-COS interval.

targetwidth in \(\log_{10}p\)multiplicative ratio minus one
\(10^{-100}\)\(8.93\times10^{-13}\)\(2.06\times10^{-12}\)
\(10^{-1000}\)\(7.01\times10^{-12}\)\(1.62\times10^{-11}\)
\(10^{-5000}\)\(3.34\times10^{-11}\)\(7.70\times10^{-11}\)

Thus the \(10^{-5000}\) result is not merely a point estimate agreeing with a reference. For the exact supplied spectrum, it comes with a directed-rounding logarithmic enclosure whose probability ratio satisfies

\[ \boxed{ \frac{p_+}{p_-} \le 1+7.70\times10^{-11} } \]

The displayed upper bound is rounded upward from the directed ratio bound.

Directed log-probability widths on exact scaled-chi-square controls at fixed N=128 and 90 interval digits. Values come from the corrected full decimal endpoint records. Subtracting rounded binary64 endpoints would give a different diagnostic.
Figure 9.2. Directed log-probability widths on exact scaled-chi-square controls at fixed \(N=128\) and 90 interval digits. Values come from the corrected full decimal endpoint records. Subtracting rounded binary64 endpoints would give a different diagnostic.

View full-size figure (new tab)

9.8 Arithmetic width versus analytic width

At the \(10^{-5000}\) control, the interval precision was swept from 40 to 120 decimal digits. The total certified width remained essentially

\[ 3.34247\times10^{-11} \]

decades.

Over the same sweep, the arithmetic-only width contracted from approximately

\[ 7.5\times10^{-37} \]

to

\[ 6.3\times10^{-117} \]

decades.

Increasing interval precision suppresses finite-arithmetic width but leaves the analytic remainder essentially unchanged at fixed support and mode count. Both quantities are shown separately for the control near 10 -5000 . More digits alone cannot remove a truncation error.
Figure 9.3. Increasing interval precision suppresses finite-arithmetic width but leaves the analytic remainder essentially unchanged at fixed support and mode count. Both quantities are shown separately for the control near \(10^{-5000}\). More digits alone cannot remove a truncation error.

View full-size figure (new tab)

This separation is important. Increasing numerical precision cannot improve an analytic truncation theorem. Conversely, once interval arithmetic is far below the analytic error budget, numerical rounding is no longer the limiting uncertainty.

9.9 Guarantee boundary

The directed enclosure has the following scope:

Guarantee boundary

For an exact supplied positive decimal spectrum of rank greater than two, the backend returns a directed-rounding logarithmic probability enclosure enlarged by proved analytic support/alias and omitted-mode bounds.

The result is conditional on correctness of the interval-arithmetic library implementation. The implementation uses mpmath.iv, whose interval layer applies downward and upward endpoint rounding.

A completely end-to-end guarantee beginning from an arbitrary floating-point matrix requires one more layer: either a rigorously enclosed matrix-to-spectrum computation, or an exact/residual completion step whose linear algebra is also performed with verified interval or ball arithmetic.

The supplied interval backend evaluates the exact spectrum directly. Packet centers, moments, and their propagated errors are not evaluated with directed arithmetic in this implementation. The packetized path therefore retains its separate analytic guarantee.

Source and conversion record

Source SHA-256: 1e3018036d850e37bc7f0f1ef3d61b41bea2427a069ded28b206256d7077e7a5

Unsupported prose commands stop the build. The mathematical expression sequence is checked against the source, with manuscript macros expanded for display.

Conversion records

Notation in The K-COS Method

Look up a symbol without leaving this chapter. Select text before opening help to search for it.

Search this work’s notation.

    Symbols can have different meanings in different passages. Read each result in its own context.

    Open the full notation index