The canonical stage enumeration of a c.e. set #
For a code c of a partial computable function, c.domStage s is the finite stage W_{c,s}:
the inputs on which c halts within s steps of Mathlib's step-bounded evaluation
Nat.Partrec.Code.evaln. Step-bounded evaluation only succeeds on inputs below the step bound,
so W_{c,s} ⊆ [0, s); unlike Soare's convention, neither the code nor the output is bounded.
These stages start empty, increase with s, and their limit is the domain W_c of c. Their
binary finite-set codes ∑ x ∈ W_{c,s}, 2 ^ x are primitive recursive uniformly in the code and
the stage, so they form a uniformly indexed family of effective enumerations of all c.e. sets.
Conversely, the limit of finite stages with computable membership is c.e. Together these give
the stage characterization of c.e. predicates on ℕ: a predicate is c.e. exactly when it is the
union of an increasing sequence of finite sets, starting empty, whose binary codes are
computable.
These are raw simulation stages, not a serialized enumeration: several numbers may enter at the same stage.
Main definitions #
Nat.Partrec.Code.domStage: the stageW_{c,s}of the domain of a code.
Main results #
Nat.Partrec.Code.domStage_zero,Nat.Partrec.Code.monotone_domStage: the stages start empty and increase.Nat.Partrec.Code.stageLimit_domStage,Nat.Partrec.Code.exists_mem_domStage_iff: their limit is the domain of the code.Nat.Partrec.Code.primrec₂_evaln_isSome: halting of step-bounded evaluation is primitive recursive in the code, the step bound and the input.Nat.Partrec.Code.primrecRel_mem_domStage,Nat.Partrec.Code.primrec_domStage: membership in the stages and their binary codes are primitive recursive, uniformly in the code and the stage.Nat.Partrec.Code.primrecRel_mem_domStage_ofNatindexes the codes by their numbers.TauCeti.Enumeration.computablePred_mem_of_computable_equivBitIndices: membership in finite stages with computable binary codes is computable.TauCeti.Enumeration.rePred_mem_stageLimit: the limit of finite stages with computable membership is c.e.TauCeti.Enumeration.rePred_iff_exists_stages: a predicate onℕis c.e. if and only if it is the limit of increasing finite stages, starting empty, with computable binary codes.
References #
- R. I. Soare, Recursively Enumerable Sets and Degrees, Springer, 1987, Chapters I.3 and II.1.
Every input enumerated by stage s is smaller than s.
The stages of the domain of a code increase.
Membership in the stages of the domain of a code is primitive recursive, uniformly in the code, the stage and the number.
Membership in the stages of the domain of the code numbered i is primitive recursive,
uniformly in the number i, the stage and the number.
The binary finite-set codes ∑ x ∈ W_{c,s}, 2 ^ x of the stages of the domain of a code are
primitive recursive, uniformly in the code and the stage.
Membership in finite stages is computable, uniformly in the stage and the number, when their binary finite-set codes are computable.
The limit of finite stages is c.e. when membership in the stages is computable, uniformly in the stage and the number.
A predicate on ℕ is c.e. if and only if it is the limit of increasing finite stages,
starting empty, whose binary finite-set codes are computable.