Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem A.2 (Rice's Theorem, second generalization) — a decidable promise problem closed under [⋅][\cdot][⋅] is decided by a simulator with ⟨M⟩\langle M\rangle⟨M⟩ and 1∣M∣1^{|M|}1∣M∣

Proved
ObfImpossibility.RiceSimulator.theorem_A_2

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

computabilityoracle-machinesp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1promise-problemsrice-theorem

Let Π=(ΠY,ΠN)\Pi=(\Pi_Y,\Pi_N)Π=(ΠY​,ΠN​) be a promise problem on machines that is closed under [⋅][\cdot][⋅] (functionally equivalent machines lie in the same parts of Π\PiΠ) and decidable (some machine TTT outputs 111 on the description of every M∈ΠYM\in\Pi_YM∈ΠY​ and 000 on the description of every M∈ΠNM\in\Pi_NM∈ΠN​). Then there exists a single oracle machine SSS such that, for every machine MMM,

M∈ΠY ⇒ S⟨M⟩(1∣M∣)=1,M∈ΠN ⇒ S⟨M⟩(1∣M∣)=0.M\in\Pi_Y\ \Rightarrow\ S^{\langle M\rangle}(1^{|M|})=1,\qquad M\in\Pi_N\ \Rightarrow\ S^{\langle M\rangle}(1^{|M|})=0 .M∈ΠY​ ⇒ S⟨M⟩(1∣M∣)=1,M∈ΠN​ ⇒ S⟨M⟩(1∣M∣)=0.

Here SSS receives only the size ∣M∣|M|∣M∣ of MMM as input and oracle access to the bounded-run function ⟨M⟩(1t,x)\langle M\rangle(1^t,x)⟨M⟩(1t,x); it does not see the description of MMM. Both equalities include that SSS halts.

This is the paper's computability-theoretic form of the slogan "the only useful thing you can do with a machine is run it": any semantic property of machines that can be decided from their code, even only on a promise, can already be decided by running the machine on inputs of one's choice for budgets of one's choice, given a bound on its size.

Formalization Note SSS is a uniform oracle program (FriedbergMuchnik.Program) chosen before MMM; S⟨M⟩(z)S^{\langle M\rangle}(z)S⟨M⟩(z) is oracleEval with the total oracle oracle M. The input 1∣M∣1^{|M|}1∣M∣ is passed as the number ∣M∣|M|∣M∣ = Nat.size (encode M) (unary versus binary is immaterial for computability); it is not the description of MMM, and many machines share each size. ⟨M⟩(1t,x)\langle M\rangle(1^t,x)⟨M⟩(1t,x) is Mathlib's fuel-bounded evaluation Code.evaln t M x.

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

/-- Theorem A.2 (Rice's Theorem — second generalization), p. A:41: if a promise problem
`Π` closed under `[·]` is decidable, then one oracle machine `S` decides it from oracle
access to `⟨M⟩` and the input `|M|`. -/
theorem theorem_A_2 (P : PromiseProblem) (hclosed : P.ClosedUnderFn) (hdec : P.IsDecidable) :
    ∃ S : FriedbergMuchnik.Program,
      (∀ M ∈ P.yes, simRun S M (size M) = Part.some 1) ∧
      (∀ M ∈ P.no, simRun S M (size M) = Part.some 0) := 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, 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