CODEHALT: does the partial recursive code drawn in the instance halt? #
The instance is a syntax tree, drawn with one element per node: a node
carries one of the eight constructor marks of Nat.Partrec.Code, and its
children are named by two binary symbols. The yes-instances are those whose
root draws a code that halts on input 0.
This is the catalog problem the undecidability of the whole development goes
through. Its point is that the passage from Mathlib's halting problem to an
instance is a plain tree encoding – DescriptiveComplexity.codeStruct, in
DescriptiveComplexity.Computability.CodeHalt – rather than the simulation of
a machine: the code is the instance, and only the computation has to be
guessed. That is what makes the map c ↦ instance primitive recursive, which
the machine route could not deliver: Mathlib's universal machine is not
finite-state, so a machine instance cannot carry the program it runs.
The semantics #
DescriptiveComplexity.DecodesTo relates a node of the instance to a
Nat.Partrec.Code, by recursion on the code: a node decodes to zero when it
carries the zero mark, to pair cf cg when it carries the pair mark and
its two children decode to cf and cg, and so on. A yes-instance is one
whose root decodes to a code halting on 0.
Reading the semantics off an existential over codes, rather than as a fixed
point computed inside the instance, is what keeps this file small: the
encoding direction is then immediate, and the converse needs only that
decoding is unique (DescriptiveComplexity.decodesTo_unique), which holds as
soon as the marks are exclusive and the child relations are functional
(DescriptiveComplexity.CodeWF).
Relation symbols of code instances.
- croot : codeRel 1
croot n:nis the root of the syntax tree. - czero : codeRel 1
- csucc : codeRel 1
- cleft : codeRel 1
- cright : codeRel 1
- cpair : codeRel 1
- ccomp : codeRel 1
- cprec : codeRel 1
- crfind : codeRel 1
crfind n:ndraws the constructorrfind'. - carg1 : codeRel 2
carg1 n m:mis the first child ofn. - carg2 : codeRel 2
carg2 n m:mis the second child ofn.
Instances For
Dependency graph
Dependency graph
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The relational language of code instances: the eight constructor marks, the mark of the root, and the two child relations.
Equations
- FirstOrder.Language.code = { Functions := fun (x : ℕ) => Empty, Relations := FirstOrder.Language.codeRel }
Instances For
Dependency graph
Dependency graph
The root symbol.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The rfind' symbol.
Instances For
Dependency graph
The first-child symbol.
Instances For
Dependency graph
The second-child symbol.
Instances For
Dependency graph
The shorthands of the vocabulary #
Being the root.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Drawing the constructor rfind'.
Equations
Instances For
Dependency graph
Being the first child.
Equations
Instances For
Dependency graph
Being the second child.
Equations
Instances For
Dependency graph
Decoding a node into a code #
The eight constructors of Nat.Partrec.Code, as a tag. Naming them makes
the exclusivity of the marks one statement instead of twenty-eight, and the
uniqueness of decoding a uniform argument instead of sixty-four cases.
- zero : CodeTag
The tag of
zero. - succ : CodeTag
The tag of
succ. - left : CodeTag
The tag of
left. - right : CodeTag
The tag of
right. - pair : CodeTag
The tag of
pair. - comp : CodeTag
The tag of
comp. - prec : CodeTag
The tag of
prec. - rfind : CodeTag
The tag of
rfind'.
Instances For
Dependency graph
Dependency graph
The mark a tag stands for.
Equations
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.zero = DescriptiveComplexity.CZero
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.succ = DescriptiveComplexity.CSucc
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.left = DescriptiveComplexity.CLeft
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.right = DescriptiveComplexity.CRight
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.pair = DescriptiveComplexity.CPair
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.comp = DescriptiveComplexity.CComp
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.prec = DescriptiveComplexity.CPrec
- DescriptiveComplexity.Mark DescriptiveComplexity.CodeTag.rfind = DescriptiveComplexity.CRfind
Instances For
Dependency graph
The tag of a code.
Equations
- DescriptiveComplexity.tagOf Nat.Partrec.Code.zero = DescriptiveComplexity.CodeTag.zero
- DescriptiveComplexity.tagOf Nat.Partrec.Code.succ = DescriptiveComplexity.CodeTag.succ
- DescriptiveComplexity.tagOf Nat.Partrec.Code.left = DescriptiveComplexity.CodeTag.left
- DescriptiveComplexity.tagOf Nat.Partrec.Code.right = DescriptiveComplexity.CodeTag.right
- DescriptiveComplexity.tagOf (a.pair a_1) = DescriptiveComplexity.CodeTag.pair
- DescriptiveComplexity.tagOf (a.comp a_1) = DescriptiveComplexity.CodeTag.comp
- DescriptiveComplexity.tagOf (a.prec a_1) = DescriptiveComplexity.CodeTag.prec
- DescriptiveComplexity.tagOf a.rfind' = DescriptiveComplexity.CodeTag.rfind
Instances For
Dependency graph
The node n draws the code c. A recursion on the code: the mark of
the node must be the constructor's, and its children must draw the
constructor's arguments.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.DecodesTo n Nat.Partrec.Code.zero = DescriptiveComplexity.CZero n
- DescriptiveComplexity.DecodesTo n Nat.Partrec.Code.succ = DescriptiveComplexity.CSucc n
- DescriptiveComplexity.DecodesTo n Nat.Partrec.Code.left = DescriptiveComplexity.CLeft n
- DescriptiveComplexity.DecodesTo n Nat.Partrec.Code.right = DescriptiveComplexity.CRight n
- DescriptiveComplexity.DecodesTo n a.rfind' = (DescriptiveComplexity.CRfind n ∧ ∃ (a_1 : A), DescriptiveComplexity.CArg1 n a_1 ∧ DescriptiveComplexity.DecodesTo a_1 a)
Instances For
Dependency graph
Dependency graph
Well-formedness of a code instance: at most one constructor mark per node, and functional child relations. This is what makes decoding unique; it is not folded into the yes-instances, because the problem is stated by an existential over codes and a junk instance simply decodes to nothing.
At most one constructor mark per node.
The first child is unique.
The second child is unique.
Instances For
Dependency graph
Dependency graph
Decoding is unique on a well-formed instance.
Dependency graph
Isomorphism-invariance #
Decoding transports along an isomorphism: what a node draws is a first-order property of the instance.
Dependency graph
The problem #
CODEHALT: does the partial recursive code drawn by the root of the
instance halt on input 0?
The yes-instances are stated by an existential over Nat.Partrec.Code: some
node is the root, it draws some code, and that code halts on 0. Nothing is
promised of the instance, so a junk one simply draws nothing and is a
no-instance.
Equations
- One or more equations did not get rendered due to their size.