Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Succinct descriptions and the bit-query program of the compression argument

Definition
MIPRE_Foundations_Cost_Succinct

by thomasvidick · Oct 12, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilitymipre-formalizationrecursive-compressionsuccinct-descriptions

This bundle defines succinct descriptions, the central notion of the recursive compression method, and the bit-query program that produces them.

MIPRE.Cost.IsSuccinctDesc c n xc\ n\ xc n x says that the pair (c,n)(c, n)(c,n) of a program ccc and a natural number nnn succinctly describes the bit string x∈{0,1}∗x \in \{0,1\}^*x∈{0,1}∗:

  1. ccc is closed (well scoped at length 111);
  2. ∣x∣≤2n|x| \le 2^n∣x∣≤2n;
  3. for every index m∈Nm \in \mathbb{N}m∈N, presented in binary, ccc on the input encode(m)\mathrm{encode}(m)encode(m) halts with the answer bitQueryAnswer(x,m)\mathrm{bitQueryAnswer}(x, m)bitQueryAnswer(x,m) (the mmm-th bit of xxx, or the marker 222 for m≥∣x∣m \ge |x|m≥∣x∣) at some cost t≤(n+1)(∣m∣+1)2t \le (n + 1)(|m| + 1)^2t≤(n+1)(∣m∣+1)2, where ∣m∣|m|∣m∣ is the binary length of mmm (Nat.size m).

In symbols, the third condition reads

∀m∈N  ∃t≤(n+1) (∣m∣+1)2:c on encode(m) halts with bitQueryAnswer(x,m) at cost t.\forall m \in \mathbb{N}\ \ \exists t \le (n + 1)\,(|m| + 1)^2 :\quad c \text{ on } \mathrm{encode}(m) \text{ halts with } \mathrm{bitQueryAnswer}(x, m) \text{ at cost } t .∀m∈N  ∃t≤(n+1)(∣m∣+1)2:c on encode(m) halts with bitQueryAnswer(x,m) at cost t.

The pair (c,n)(c, n)(c,n) is exponentially smaller than xxx itself; a compression procedure's guarantees are required only on genuine succinct descriptions, but it must run, in polynomial time, on all inputs.

MIPRE.Cost.Prog.bitQueryProg univ\mathrm{univ}univ is the bit-query program β\betaβ of the recursive compression argument, relative to a universal program univ\mathrm{univ}univ: on the input encode(((c′,e),n),m)\mathrm{encode}(((c', e), n), m)encode(((c′,e),n),m) it runs univ\mathrm{univ}univ on cons(encode c′,encode(e,n))\mathtt{cons}(\mathrm{encode}\ c', \mathrm{encode}(e, n))cons(encode c′,encode(e,n)), that is, it simulates the program c′c'c′ on the input (e,n)(e, n)(e,n) to obtain a string yyy which is given only implicitly as the output of c′c'c′, and then answers the bit query mmm about yyy with bitAtProg. Hardcoding the triple ((c′,e),n)((c', e), n)((c′,e),n) into it through hardcode yields a succinct description of that output whenever the simulated run is fast enough for the budget. MIPRE.Cost.bitQueryBound UUU, for a universal machine UUU with overhead polynomial pUp_UpU​, is the polynomial

pU(X+1)+(X+1)(X+534)+2X+29p_U(X + 1) + (X + 1)(X + 534) + 2X + 29pU​(X+1)+(X+1)(X+534)+2X+29

bounding the cost of the bit-query program per factor (∣m∣+1)2(|m| + 1)^2(∣m∣+1)2, as a function of X=esize(c′)+esize(e)+esize(n)+tX = \mathrm{esize}(c') + \mathrm{esize}(e) + \mathrm{esize}(n) + tX=esize(c′)+esize(e)+esize(n)+t with ttt the cost of the run of c′c'c′.

No lemma is proved inside this bundle; the correctness of the bit-query program (bitQueryProg_runs) and the succinctness of its hardcoded instances (isSuccinctDesc_hardcode) are stated separately.

Formalization Note. [MNY, Definition 2.4] requires the runtime of ccc on mmm to be at most nnn for all mmm; in a cost model that charges for reading its input, as this one does, that bound is vacuous for ∣m∣>n|m| > n∣m∣>n, and the formalization requires (n+1)(∣m∣+1)2(n + 1)(|m| + 1)^2(n+1)(∣m∣+1)2 instead. Any polynomial in nnn and ∣m∣|m|∣m∣ would serve, provided the same bound is used in the compression theorem for games, whose output verifiers are what get succinctly described; the quadratic factor is exactly what the bit-indexing program bitAtProg achieves, because each zero test and decrement of the binary index copies it. The indices mmm enter in binary, under the SizedEncoding ℕ instance, and the paper's Turing machine eee is a closed program of the ambient model.

Definition code
/-
Copyright (c) 2026 Thomas Vidick. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Thomas Vidick
-/
/- Generated for Prove2Me from vidick/MIPRE-formalization@70cbf1c, MIPRE/Foundations/Cost/Succinct.lean (definition bundle: declarations the uploaded statements rest on);
   produced mechanically by prove2me/tools/gen.py, never edited by hand. -/
import Mathlib.Algebra.Polynomial.Eval.Defs
import Mathlib.Data.List.Basic
import Mathlib.Data.Nat.Bits
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.Size
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
import Definitions.Def_MIPRE_Foundations_Cost_Basic
import Definitions.Def_MIPRE_Foundations_Cost_Encoding
import Definitions.Def_MIPRE_Foundations_Cost_PolyTime
import Definitions.Def_MIPRE_Foundations_Cost_Closure
import Definitions.Def_MIPRE_Foundations_Cost_Loops
import Definitions.Def_MIPRE_Foundations_Cost_Unary
import Definitions.Def_MIPRE_Foundations_Cost_Numeric
import Definitions.Def_MIPRE_Foundations_Cost_BitQuery
import Definitions.Def_MIPRE_Foundations_Cost_Toolkit

/-!
# Succinct descriptions and the bit-query program

`IsSuccinctDesc c n x` is [MNY, Definition 2.4] (blueprint `def:succinct`), with the time
bound adapted to the ambient model (see the module docstring of
`MIPRE.Foundations.Compression`). The **bit-query program** `bitQueryProg univ` of the
recursive compression argument answers bit-queries about a string that is only given
*implicitly*, as the output of a program `c'` on an input `(e, n)`: on
`encode (((c', e), n), m)` it simulates `c'` on `encode (e, n)` through the universal machine
and indexes the result with `bitAtProg`. Its correctness is conditional on the run of `c'`
(`bitQueryProg_runs`), and hardcoding `((c', e), n)` into it gives a succinct description of
that output whenever the run is fast enough for the budget (`isSuccinctDesc_hardcode`).
-/

namespace MIPRE.Cost

open Polynomial

/-! ## Succinct descriptions ([MNY, Definition 2.4]; blueprint `def:succinct`) -/

/-- `(c, n)` **succinctly describes** the bit string `x`: `c` is a closed program, `x` has
length at most `2 ^ n`, and `c` answers every bit-query `m` (presented in binary; the
answer is `bitQueryAnswer x m`) within cost `(n + 1) * (|m| + 1) ^ 2`.

[MNY, Definition 2.4], with the time bound adapted as discussed in the module docstring of
`MIPRE.Foundations.Compression`. The pair `(c, n)` is exponentially smaller than `x` itself;
a compression procedure's guarantees are only required on genuine succinct descriptions,
but it must *run* (in polynomial time) on all inputs. -/
def IsSuccinctDesc (c : Prog) (n : ℕ) (x : BitStr) : Prop :=
  c.WellScoped 1 ∧ x.length ≤ 2 ^ n ∧
    ∀ m : ℕ, ∃ t ≤ (n + 1) * (Nat.size m + 1) ^ 2, c.Runs (encode m) (bitQueryAnswer x m) t

namespace Prog

/-- The bit-query program: on `encode (((c', e), n), m)`, run `univ` on
`cons (encode c') (encode (e, n))` to obtain the string `y`, then answer the bit-query `m`
about `y` with `bitAtProg`. -/
def bitQueryProg (univ : Prog) : Prog :=
  .elim 0 .nil (.elim 0 .nil (.elim 0 .nil
    (.let_ (.cons (.var 0) (.cons (.var 1) (.var 3)))
      (.let_ (callVar 0 univ)
        (.let_ (.cons (.var 0) (.var 7))
          (callVar 0 bitAtProg))))))

end Prog

/-- The cost of the bit-query program, as a polynomial in
`s = esize c' + esize e + esize n + t` (with `t` the cost of the run of `c'`), per
`(|m| + 1) ^ 2`. -/
noncomputable def bitQueryBound (U : UniversalMachine) : Polynomial ℕ :=
  U.bound.comp (X + C 1) + (X + C 1) * (X + C 534) + C 2 * X + C 29

end MIPRE.Cost
Source
https://github.com/vidick/MIPRE-formalization/blob/70cbf1c52e3d5e1dff1162fdf952c9a9f4bd99ed/MIPRE/Foundations/Cost/Succinct.lean; blueprint def:succinct; [MNY] A. Marks, S. S. Nezhadi, H. Yuen, The recursive compression method for proving undecidability results, manuscript, Definition 2.4

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me