Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Computability and logic

Rice's Theorem

Suppose a semantic property of partial functions can be decided computably from program codes. If one partial-recursive function has that property, then every partial-recursive function has it.

Exact theorem

Exact Mathlib statement

theorem ComputablePred.rice (C : Set (ℕ →. ℕ)) (h : ComputablePred fun c => Nat.Partrec.Code.eval c ∈ C) {f g} (hf : Nat.Partrec f) (hg : Nat.Partrec g) (fC : f ∈ C) : g ∈ C

The theorem at a glance

Rice's theorem at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

Computable semantic membership and one admitted partial-recursive witness force every partial-recursive function into the property. Explanatory diagram.
Detailed visual description

Program-code plaques feed into behavioral traces. The exact implication is dominant: computable code membership, Nat.Partrec f, Nat.Partrec g, and f ∈ C lead through a self-referential code to g ∈ C. The poster explicitly excludes syntactic program properties.

Statement structure

From hypotheses to conclusion

Statement map for Rice's TheoremA computably decidable semantic property containing one partial-recursive function contains every partial-recursive function. The pinned upstream declaration is ComputablePred.rice. The exact checked statement is theorem ComputablePred.rice (C : Set (ℕ →. ℕ)) (h : ComputablePred fun c => Nat.Partrec.Code.eval c ∈ C) {f g} (hf : Nat.Partrec f) (hg : Nat.Partrec g) (fC : f ∈ C) : g ∈ C.Mathematical readingA computably decidablesemantic propertycontaining onepartial-recursivefunction contains everypartial-recursivefunction.Pinned declarationmathlib ·ComputablePred.riceExact checked formtheoremComputablePred.rice (C :Set (ℕ →. ℕ)) (h :ComputablePred fun c =>Nat.Partrec.Code.eval c∈ C) {f g} (hf :Nat.Partrec f) (hg :Nat.Partrec g) (fC : f ∈C) : g ∈ CStatement map for Rice's TheoremA computably decidable semantic property containing one partial-recursive function contains every partial-recursive function. The pinned upstream declaration is ComputablePred.rice. The exact checked statement is theorem ComputablePred.rice (C : Set (ℕ →. ℕ)) (h : ComputablePred fun c => Nat.Partrec.Code.eval c ∈ C) {f g} (hf : Nat.Partrec f) (hg : Nat.Partrec g) (fC : f ∈ C) : g ∈ C.Mathematical readingA computably decidablesemantic propertycontaining onepartial-recursivefunction contains everypartial-recursivefunction.Pinned declarationmathlib ·ComputablePred.riceExact checked formtheoremComputablePred.rice (C :Set (ℕ →. ℕ)) (h :ComputablePred fun c =>Nat.Partrec.Code.eval c∈ C) {f g} (hf :Nat.Partrec f) (hg :Nat.Partrec g) (fC : f ∈C) : g ∈ C

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

Evaluated partial-recursive behaviors pass through one self-reference route into the same semantic property that already contains a witness. Explanatory scientific diagram.
Detailed visual description

Five abstract perforated code cards feed a common evaluation aperture. The resulting bundle of incomplete behavior traces passes through one charcoal one-way loop, after which every displayed trace crosses into the translucent emerald region C. A gold witness trace is already in C, and a cobalt trace highlights an otherwise arbitrary displayed behavior joining it. No trace terminates outside the property region. The schematic represents Mathlib's implication for partial-recursive functions and does not depict the separate empty-or-universal equivalence or a classification of syntactic code properties.

Why it matters

A mathematical landmark

Rice's theorem draws a foundational boundary around algorithmic reasoning about programs: a computable decision procedure cannot separate partial-recursive functions by a nontrivial semantic property. Mathlib's selected endpoint proves this through a self-referential code in its partial-evaluation model.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This target indexes Mathlib's implication form of Rice's theorem. For a semantic property C of partial functions, assume program-code membership through eval is computable. If one partial-recursive f belongs to C, then every partial-recursive g belongs to C. It is specific to Mathlib's partial-function and program-code model and does not classify arbitrary syntactic code properties or all noncomputable semantic properties.

Source and local evidence

Where the theorem comes from

Existing declaration
ComputablePred.rice in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.rice-theorem.v001
Source
Open the pinned upstream reference