Documentation

DescriptiveComplexity.Problems.CodeHalt.Defs

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.

Instances For
    Dependency graph
    Dependency graph
    def FirstOrder.Language.instDecidableEqCodeRel.decEq {a✝ : } (x✝ x✝¹ : codeRel a✝) :
    Decidable (x✝ = x✝¹)
    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
      Instances For
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        Dependency graph
        @[reducible, inline]

        The first-child symbol.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The second-child symbol.

          Equations
          Instances For
            Dependency graph

            The shorthands of the vocabulary #

            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            Dependency graph
            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.

            Instances For
              Dependency graph
              @[instance_reducible]
              Equations
              Dependency graph
              Dependency graph
              Dependency graph
              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.

              • exclusive (a : A) (t t' : CodeTag) : Mark t aMark t' at = t'

                At most one constructor mark per node.

              • arg1_fun (a b b' : A) : CArg1 a bCArg1 a b'b = b'

                The first child is unique.

              • arg2_fun (a b b' : A) : CArg2 a bCArg2 a b'b = b'

                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.
                Instances For
                  Dependency graph
                  Dependency graph