A common envelope for saved coins and supported outputs #
A strict-PPT program has one polynomial envelope that bounds both the coins required by its total replay and the encoded length of every supported result. Combining the two bounds once lets callers budget a continuation from the same envelope used to replay its predecessor.
Main results #
Cslib.Probability.IsPPTOn.exists_total_seeded_evaluator_with_length: a native total replay, its exact law for any sufficiently long uniform tape, and a common supported-output bound.
theorem Cslib.Probability.IsPPTOn.exists_total_seeded_evaluator_with_length {α β : Type} {input : α ↪ List Bool} {output : β ↪ List Bool} {program : α → ProbComp β} (h : IsPPTOn input output program) :
∃ (c : ℕ) (d : ℕ) (evaluate : α → List Bool → β),
Turing.MultiTapeTM.ComputableInPolyTime
(fun (x : α × List Bool) =>
match x with
| (a, coins) => evaluate a coins)
(Turing.MultiTapeTM.encPair input Turing.MultiTapeTM.encBits) output ∧ (∀ (a : α) (coins : List Bool), evaluate a coins ∈ (program a).eval.support) ∧ (∀ (a : α) (length : ℕ),
c * ((input a).length + 1) ^ d ≤ length →
(program a).eval = PMF.map (evaluate a) (BitString.uniformList length)) ∧ ∀ (a : α), ∀ result ∈ (program a).eval.support, (output result).length ≤ c * ((input a).length + 1) ^ d
One polynomial envelope bounds both required coins and every supported encoded output. The evaluator is supported even on short or malformed tapes, inherited from the total replay construction. Only its exact uniform distribution law requires the stated minimum length.