lockProg on a nonzero dimension: the block loop, then the reversal
ProvedMIPRE.Cost.Prog.lockProg_runsA statement of the module MIPRE.Foundations.Repeat.Sampler of the MIP* = RE formalization (commit 70cbf1c of vidick/MIPRE-formalization). The program of the repeated sampler. The sampler of ComputeParrepVerifier (thm:parallel-repetition; planning/repetition-verifier.md, R3(b)) as a program of the ambient model. It is one fixed program repSampCore univ — univ a universal machine — run through the s-m-n construction hardcode on the datum (S̄, λ, τ): its input is then ((S̄, λ, τ), (n, q)), with S̄ the input sampler's program, λ, τ in binary and q a query. It 1. asks S̄ for its dimension s = s(n), through univ; 2. on the dimension query (kind = 0, i.e. nil) runs dimProg: the numeral 2^m s with `m…
lockProg on a nonzero dimension: the block loop, then the reversal.
Formal statement. In Lean, with the scope shown:
open MIPRE
open MIPRE.Cost
open MIPRE.Cost.Prog
open MIPRE.Cost.Data
theorem MIPRE.Cost.Prog.lockProg_runs {univ : Prog} (hU : univ.WellScoped 1) {s : ℕ} (hs : 0 < s)
(sD nD kD wD jD : Data) (u y : List Data) (f : List Data → List Data → Data) (Tu Z : ℕ)
(hf : ∀ p ∈ chunkPairs s hs u y,
∃ t ≤ Tu, Eval [mapQuery sD nD kD wD jD (list p.1) (list p.2)] univ (f p.1 p.2) t)
(hZ : s + (list u).size + (list y).size + (mapCtx sD nD kD wD jD).size + 1 +
u.length * (Tu + 1) + Tu ≤ Z) :
∃ t ≤ lockCost s (mapCtx sD nD kD wD jD).size (list u).size (list y).size Z,
Eval [lockInput sD nD (encode s) kD wD jD (list u) (list y)] (lockProg univ)
(list ((chunkPairs s hs u y).map fun p => toList (f p.1 p.2)).flatten) t
Formalization Note MIPRE.Cost.Prog.lockProg_runs is declared in MIPRE/Foundations/Repeat/Sampler.lean, lines 195–267. The binders, hypotheses and conclusion are exactly those of the Lean statement above; the uploaded statement elaborates to the same type as the declaration in the repository. The definitions it mentions are those of the published definition bundles of the module's import closure.
import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Algebra.BigOperators.Ring.Finset import Mathlib.Algebra.Polynomial.Eval.Defs import Mathlib.Algebra.Polynomial.Eval.Degree import Mathlib.Computability.Primrec.List import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Fintype.Pi import Mathlib.Data.List.Basic import Mathlib.Data.Nat.Bits import Mathlib.Data.Nat.Notation import Mathlib.Data.Nat.Size import Mathlib.Data.Real.Basic import Mathlib.Data.ZMod.Basic import Mathlib.LinearAlgebra.Pi import Mathlib.Logic.Denumerable import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring import Definitions.Def_MIPRE_Foundations_CL_Register import Definitions.Def_MIPRE_Foundations_CL_Basic import Definitions.Def_MIPRE_Foundations_CL_Closure import Definitions.Def_MIPRE_Foundations_Cost_Basic_B import Definitions.Def_MIPRE_Foundations_Cost_Encoding_B import Definitions.Def_MIPRE_Foundations_Cost_PolyTime import Definitions.Def_MIPRE_Foundations_CL_Sampler import Definitions.Def_MIPRE_Foundations_Cost_Closure import Definitions.Def_MIPRE_Foundations_Cost_Loops_B import Definitions.Def_MIPRE_Foundations_Cost_Codable_B import Definitions.Def_MIPRE_Foundations_Halting_Descriptions import Definitions.Def_MIPRE_Foundations_Cost_Unary import Definitions.Def_MIPRE_Foundations_Cost_Numeric_B import Definitions.Def_MIPRE_Foundations_Halting_Lists import Definitions.Def_MIPRE_Foundations_Halting_Lists_B import Definitions.Def_MIPRE_Foundations_Cost_Growth import Definitions.Def_MIPRE_Foundations_Halting_Arith import Definitions.Def_MIPRE_Foundations_Repeat_Prims import Definitions.Def_MIPRE_Foundations_Repeat_MapLoop import Definitions.Def_MIPRE_Foundations_Cost_Toolkit_B import Definitions.Def_MIPRE_Foundations_Repeat_Sampler open MIPRE open MIPRE.Cost open MIPRE.Cost.Prog open MIPRE.Cost.Data
theorem MIPRE.Cost.Prog.lockProg_runs {univ : Prog} (hU : univ.WellScoped 1) {s : ℕ} (hs : 0 < s)
(sD nD kD wD jD : Data) (u y : List Data) (f : List Data → List Data → Data) (Tu Z : ℕ)
(hf : ∀ p ∈ chunkPairs s hs u y,
∃ t ≤ Tu, Eval [mapQuery sD nD kD wD jD (list p.1) (list p.2)] univ (f p.1 p.2) t)
(hZ : s + (list u).size + (list y).size + (mapCtx sD nD kD wD jD).size + 1 +
u.length * (Tu + 1) + Tu ≤ Z) :
∃ t ≤ lockCost s (mapCtx sD nD kD wD jD).size (list u).size (list y).size Z,
Eval [lockInput sD nD (encode s) kD wD jD (list u) (list y)] (lockProg univ)
(list ((chunkPairs s hs u y).map fun p => toList (f p.1 p.2)).flatten) t := by sorry