Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

p. A:41 — if the simulator halts, it returns the same answer as T(M)T(M)T(M)

Proved
ObfImpossibility.RiceSimulator.stage_answer_sound

by mikedeng1 · Oct 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

computabilityp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1rice-theorem

Let TTT and MMM be machines, n∈Nn\in\mathbb Nn∈N and σ∈N\sigma\in\mathbb Nσ∈N. Suppose stage nnn of the simulator stops with answer σ\sigmaσ, that is, TTT run for nnn steps halts on every machine of SnS_nSn​ (the machines of size ∣M∣|M|∣M∣ that are nnn-compatible with MMM) with output σ\sigmaσ. Then

T(⌜M⌝)=σ.T(\ulcorner M\urcorner)=\sigma .T(┌M┐)=σ.

Since MMM is nnn-compatible with itself, MMM always belongs to SnS_nSn​; so whatever stage the simulator stops at, its answer is the one TTT gives on MMM. This is the correctness half of the proof of Theorem A.2.

Formalization Note "Run TTT for nnn steps" is Code.evaln n T; the conclusion is σ ∈ Code.eval T (encode M), i.e. TTT halts on ⌜M⌝\ulcorner M\urcorner┌M┐ with output σ\sigmaσ. No promise hypothesis is needed.

Preamble
import Mathlib
import Definitions.Def_ObfImpossibility_RiceSimulator_Setting
Formal statement
namespace ObfImpossibility.RiceSimulator

/-- p. A:41: if the simulator halts (at some stage `n` with answer `σ`) then it returns the
same answer as `T(M)`. -/
theorem stage_answer_sound (T M : Machine) (n σ : ℕ) (h : StageAnswer T M n σ) :
    σ ∈ T.eval (Encodable.encode M) := by sorry

end ObfImpossibility.RiceSimulator
Source
Barak et al., On the (Im)possibility of Obfuscating Programs, J. ACM 59(2) (2012), author's copy, p. A:41, proof of Theorem A.2
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 7, 2026

    Confirmed by the mission captain (proposal self-audit).

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me