The running time of the wrapper #
Decider.wrap reads a string as a decider (Halting/Wrapper.lean); this file bounds its
running time. That bound is what makes the verifier a string denotes λ-bounded, and so what
makes the classes MIPRE.Halting.classA, classB inhabited at all: until it, every proof of
Verifier.IsBounded in the repository was conditional on another time bound.
The shape throughout is Cost.Prog.HasPolyCost: cost at most C n · (|d| + 1) ^ k at index
n on input d, with C polynomially bounded and k constant — what Decider.TimeBoundAt
asks for after Halting/Bounded.lean, and what composes (Cost.PolyCost). Nothing here is
tight: each stage is bounded by a generous square and the stages are summed, since
λ-boundedness quantifies the constants away.
Everything is proved on arbitrary data. TimeBoundAt quantifies over every input at the
index, well formed or not, so no stage may assume it is handed a question pair:
Data.toSpineandProg.lenProgD_runs: the length program on any datum, walking its right spine, not only on a list built byData.list.Prog.wrapCheckEnvNandwrapCheckD_cost_of_eq,wrapCheckD_cost_of_ne: one length check, which comparesData.spinewith the sampler's dimension — onencode lthat isl.length, and on anything else it is what the program actually computes.Prog.wrapCore_hasPolyCost: the whole, by the three outcomes — the first check fails, the second fails, or both pass and the string's own decider runs through the universal machine.Verifier.ofSamplerDecider_isBounded: the verifier a pair denotes isn-bounded at every level from somen₀on, byVerifier.exists_isBounded.
The hypotheses are exactly three: the sampler's program and the string's decider have
polynomially bounded cost, and the sampler's dimension is polynomially bounded. For a sampler
coming from MIPRE.GapCompression all three are its fields, through
CL.Sampler.hasPolyCost_of_timeBound.
The right spine of a datum #
The stages #
The environment the head hands to its continuation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The quantity whose square bounds the head's cost at index n, for a sampler running
within Cf n · (|d| + 1) ^ kf: the sizes and running times of the dimension query, its
simulation, and the conversion of the dimension to unary. Explicit, so that the accounting of
the compressor's output can be uniform in its parameters.
Equations
- One or more equations did not get rendered due to their size.
Instances For
wrapHeadZ is polynomially bounded in the index when the sampler's cost and dimension
are.
The head, with explicit constants. For a sampler running within
Cf n · (|d| + 1) ^ kf, the head costs at most 60 · wrapHeadZ n ^ 2 beyond its continuation:
the dimension query runs on a fixed input, and the conversion to unary on the dimension.
The length check, on arbitrary data #
The environment one length check hands to its continuation, parameterized by the spine length it measured rather than by a bit string: the wrapper is run on malformed inputs too.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A generous bound on the cost of one length check, in the size of the datum tested and the number it is compared with.
Instances For
The prefix #
The environment the prefix hands to the first length check, for an input whose tail is
cons A (cons B C) — the only shape on which the checks run at all.
Equations
- MIPRE.Cost.Prog.wrapPreEnvD S n A B C = B :: C :: A :: B.cons C :: MIPRE.Cost.Prog.wrapHeadEnv S n (A.cons (B.cons C))
Instances For
The prefix, on every input, with explicit constants. On a tail of the shape
cons A (cons B C) it hands the environment wrapPreEnvD to its continuation; on a shorter
tail it rejects outright. Both cost 60 · wrapHeadZ n ^ 2 + 4 beyond the continuation.
The whole wrapper #
The wrapper's cost at index n on an input of size s, when the string's decider runs
within T on it: the prefix, the two checks, the copies, and the universal machine on the
string's decider.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The wrapper halts within an explicit cost on every input, well formed or not, at an
index n at which the string's decider runs within Td |d| on every input d.
The wrapper halts within a polynomially bounded cost on every input, well formed or
not, provided the sampler and the string's own decider do. This is what inhabits
Verifier.IsBounded for the verifier a string denotes.
The verifier a string denotes is λ-bounded, at every level from some n₀ on,
provided the sampler and the string's own decider have polynomially bounded cost and the
sampler's dimension is polynomially bounded. This is what inhabits Verifier.IsBounded.