Documentation

DescriptiveComplexity.Computability.CodeHalt

Drawing a partial recursive code as a concrete instance #

The computable half of the undecidability bridge: a primitive recursive map

Nat.Partrec.Code → FirstOrder.Language.FinStruct codeVocab

whose image is a yes-instance of DescriptiveComplexity.CODEHALT exactly when the code halts on 0 (DescriptiveComplexity.codehalt_toPred_codeStruct).

Nothing here simulates anything: the code is the instance, so the map is a plain tree flattening. DescriptiveComplexity.codeNodes lists the nodes of a code in preorder, each node carrying its constructor tag and the relative offsets of its children – relative, so that the flattening of a subterm is literally a segment of the flattening of the whole (DescriptiveComplexity.Seg), which is what makes the correctness proof an induction on the code and nothing more.

This is exactly what the machine route could not deliver. Mathlib's universal machine Turing.PartrecToTM2.tr is not finite-state, so code ↦ machine instance is not available; code ↦ syntax tree is trivially primitive recursive, and pushes the whole difficulty into CODEHALT ∈ RE, an ordinary membership proof of the catalog (DescriptiveComplexity.Problems.CodeHalt.Membership).

Whence the two results the layer exists for: DescriptiveComplexity.not_computablePred_of_RE_hard, every RE-hard problem is undecidable, and its first instance DescriptiveComplexity.finsat_not_computable, Trakhtenbrot's theorem.

Dependency graph

The vocabulary of code instances, presented: eleven symbols, nine unary and two binary.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Dependency graph

    Flattening a code into a list of nodes #

    The reading of an index outside the flattening: a tag no constructor carries, and no children.

    Equations
    Instances For
      Dependency graph
      Dependency graph

      Segments #

      The instance a code draws #

      The constructor tag of the node at index i.

      Equations
      Instances For
        Dependency graph

        The offset of the first child of the node at index i, 0 for none.

        Equations
        Instances For
          Dependency graph

          The offset of the second child of the node at index i, 0 for none.

          Equations
          Instances For
            Dependency graph

            The relations a list of nodes denotes.

            Equations
            Instances For
              Dependency graph

              The instance a list of nodes draws. One element per node, and one spare element at the end which carries no mark – out-of-range readings return DescriptiveComplexity.nodeNone, whose tag is no constructor's.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                Dependency graph
                Dependency graph

                The instance a code draws does draw it #

                The instance a code draws is well formed #

                The instance draws the code, and nothing else #

                Dependency graph

                The map is primitive recursive #

                Undecidability #

                CODEHALT is undecidable. Mathlib's halting problem maps into it by the tree encoding, which is primitive recursive, so a decision procedure for the concrete instances would decide whether a partial recursive code halts. Registered in the Lax archive as Lax624099.HaltingUndecidable.codehalt_not_computable.

                Dependency graph

                An RE-hard problem is undecidable. Hardness in this library is cofinal, so an RE-hard problem is in particular a target of CODEHALT, which is undecidable; and a first-order reduction is a computable many-one reduction of the induced sets (DescriptiveComplexity.not_computablePred_of_relOrderedReduction).

                This is the leverage the whole DescriptiveComplexity.Computability layer exists for: every completeness theorem for RE now yields undecidability with no computability work of its own. Registered in the Lax archive as Lax624099.REHardUndecidable.not_computablePred_of_RE_hard.

                Dependency graph

                Trakhtenbrot's theorem: whether a first-order sentence has a finite model is undecidable. Registered in the Lax archive as Lax624099.Trakhtenbrot.finsat_not_computable.

                Dependency graph