Documentation

DescriptiveComplexity.Problems.CodeHalt.Membership

CODEHALT is in RE #

The syntax half of DescriptiveComplexity.CodeHalt.codehalt_iff_cert: the certificate of a halting computation is written as an ∃SO[new] sentence, the logic defining RE.

The deep conjunct is the justification of an evaluation fact (DescriptiveComplexity.CodeHalt.evOkS): eleven guarded quantifiers, which is why the variables are named by their distance from their binder, exactly as in DescriptiveComplexity.Problems.Machine.HaltMem.

The corollary the file exists for is DescriptiveComplexity.codehalt_le_finsat, and with it DescriptiveComplexity.finsat_not_computable: Trakhtenbrot's theorem, now with nothing left to assume.

The second-order block #

The relation variables of the ∃SO[new] definition of CODEHALT: the order of the numeral segment, addition and pairing on it, the code each node draws, and the value each code takes on each argument.

  • le : EvIx

    The order of the numeral segment.

  • add : EvIx

    Addition on the segment.

  • pr : EvIx

    Cantor's pairing on the segment.

  • dec : EvIx

    The number of the code a node draws.

  • ev : EvIx

    The value a code takes on an argument.

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

    The single existential block of the definition.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph
      Dependency graph
      @[reducible, inline]

      A relation symbol of the instance, in the kernel's vocabulary.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]

        The symbol marking the original elements.

        Equations
        Instances For
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph

          The extended universe #

          @[instance_reducible]

          The vocabulary of the instance, read on the extended universe.

          Equations
          Instances For
            Dependency graph
            @[instance_reducible]

            The structure the kernel is read in: the extended structure together with an assignment of the relation variables.

            Equations
            Instances For
              Dependency graph
              Dependency graph
              Dependency graph
              Dependency graph

              The certificate an assignment carries #

              The certificate an assignment carries: the relation variables read at the sorts they are meant for.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.CodeHalt.certOf_le {A : Type} {m : } (ρ : evBlock.Assignment (A Fin m)) (x y : Fin m) :
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.CodeHalt.certOf_add {A : Type} {m : } (ρ : evBlock.Assignment (A Fin m)) (x y z : Fin m) :
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.CodeHalt.certOf_pr {A : Type} {m : } (ρ : evBlock.Assignment (A Fin m)) (a b p : Fin m) :
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.CodeHalt.certOf_dec {A : Type} {m : } (ρ : evBlock.Assignment (A Fin m)) (n : A) (e : Fin m) :
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.CodeHalt.certOf_ev {A : Type} {m : } (ρ : evBlock.Assignment (A Fin m)) (e x v : Fin m) :
                Dependency graph

                Atomic formulas #

                Dependency graph
                Dependency graph
                Dependency graph
                noncomputable def DescriptiveComplexity.CodeHalt.eqF {γ : Type} (x y : γ) :

                Equality of two variables.

                Equations
                Instances For
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_oldF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (x : γ) (v : γA Fin m) :
                  (oldF x).Realize v IsOld (v x)
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_eqF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (x y : γ) (v : γA Fin m) :
                  (eqF x y).Realize v v x = v y
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_leF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (x y : γ) (v : γA Fin m) :
                  (leF x y).Realize v ρ EvIx.le ![v x, v y]
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_addF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (x y z : γ) (v : γA Fin m) :
                  (addF x y z).Realize v ρ EvIx.add ![v x, v y, v z]
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_prF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (a b p : γ) (v : γA Fin m) :
                  (prF a b p).Realize v ρ EvIx.pr ![v a, v b, v p]
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_decF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (n e : γ) (v : γA Fin m) :
                  (decF n e).Realize v ρ EvIx.dec ![v n, v e]
                  Dependency graph
                  @[simp]
                  theorem DescriptiveComplexity.CodeHalt.realize_evF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (e x v' : γ) (v : γA Fin m) :
                  (evF e x v').Realize v ρ EvIx.ev ![v e, v x, v v']
                  Dependency graph

                  Naming the symbols of the instance #

                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph
                  Dependency graph

                  Guarded quantifiers #

                  Every quantifier of the kernel ranges over one of the two sorts of the extended universe – the nodes of the instance, marked by old, and the numerals – and is guarded accordingly. A variable is named by its distance from its binder.

                  @[reducible, inline]
                  abbrev DescriptiveComplexity.CodeHalt.up {γ : Type} (x : γ) :

                  A variable of the enclosing scope, seen from inside one guarded quantifier.

                  Equations
                  Instances For
                    Dependency graph
                    @[reducible, inline]

                    The variable bound by the innermost guarded quantifier.

                    Equations
                    Instances For
                      Dependency graph
                      @[reducible, inline]

                      The variable bound one guarded quantifier further out.

                      Equations
                      Instances For
                        Dependency graph
                        @[reducible, inline]

                        The variable bound two guarded quantifiers further out.

                        Equations
                        Instances For
                          Dependency graph
                          @[reducible, inline]

                          The variable bound three guarded quantifiers further out.

                          Equations
                          Instances For
                            Dependency graph
                            @[reducible, inline]

                            The variable bound four guarded quantifiers further out.

                            Equations
                            Instances For
                              Dependency graph
                              @[reducible, inline]

                              The variable bound five guarded quantifiers further out.

                              Equations
                              Instances For
                                Dependency graph
                                @[reducible, inline]

                                The variable bound six guarded quantifiers further out.

                                Equations
                                Instances For
                                  Dependency graph
                                  @[reducible, inline]

                                  The variable bound seven guarded quantifiers further out.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    @[reducible, inline]

                                    The variable bound eight guarded quantifiers further out.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      @[reducible, inline]

                                      The variable bound nine guarded quantifiers further out.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        @[reducible, inline]

                                        The variable bound ten guarded quantifiers further out.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          @[reducible, inline]

                                          The variable bound eleven guarded quantifiers further out.

                                          Equations
                                          Instances For
                                            Dependency graph

                                            ∃ x, old x ∧ φ: a quantifier over the nodes of the instance.

                                            Equations
                                            Instances For
                                              Dependency graph

                                              ∀ x, old x → φ: a quantifier over the nodes of the instance.

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

                                                ∃ d, ¬old d ∧ φ: a quantifier over the numerals.

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

                                                  ∀ d, ¬old d → φ: a quantifier over the numerals.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    Dependency graph
                                                    theorem DescriptiveComplexity.CodeHalt.exists_inr_of_not_isOld {A : Type} {m : } {x : A Fin m} (h : ¬IsOld x) :
                                                    ∃ (j : Fin m), x = Sum.inr j
                                                    Dependency graph
                                                    @[simp]
                                                    theorem DescriptiveComplexity.CodeHalt.realize_exOldF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (φ : certLang.Formula (γ Unit)) (v : γA Fin m) :
                                                    (exOldF φ).Realize v ∃ (a : A), φ.Realize (Sum.elim v fun (x : Unit) => Sum.inl a)
                                                    Dependency graph
                                                    @[simp]
                                                    theorem DescriptiveComplexity.CodeHalt.realize_allOldF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (φ : certLang.Formula (γ Unit)) (v : γA Fin m) :
                                                    (allOldF φ).Realize v ∀ (a : A), φ.Realize (Sum.elim v fun (x : Unit) => Sum.inl a)
                                                    Dependency graph
                                                    @[simp]
                                                    theorem DescriptiveComplexity.CodeHalt.realize_exNewF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (φ : certLang.Formula (γ Unit)) (v : γA Fin m) :
                                                    (exNewF φ).Realize v ∃ (j : Fin m), φ.Realize (Sum.elim v fun (x : Unit) => Sum.inr j)
                                                    Dependency graph
                                                    @[simp]
                                                    theorem DescriptiveComplexity.CodeHalt.realize_allNewF {A : Type} [FirstOrder.Language.code.Structure A] [Nonempty A] {m : } {ρ : evBlock.Assignment (A Fin m)} {γ : Type} (φ : certLang.Formula (γ Unit)) (v : γA Fin m) :
                                                    (allNewF φ).Realize v ∀ (j : Fin m), φ.Realize (Sum.elim v fun (x : Unit) => Sum.inr j)
                                                    Dependency graph

                                                    The shapes that repeat #

                                                    The order-theoretic shapes (IsZ, IsS, strictly below) and the arithmetic of a code's number, each a builder used many times below.

                                                    Dependency graph
                                                    Dependency graph
                                                    noncomputable def DescriptiveComplexity.CodeHalt.isSF {γ : Type} (x y : γ) :

                                                    y is the numeral just above x.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      Dependency graph
                                                      noncomputable def DescriptiveComplexity.CodeHalt.quadF {γ : Type} (p q : γ) :

                                                      q is four times p.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        Dependency graph
                                                        noncomputable def DescriptiveComplexity.CodeHalt.plus4F {γ : Type} (q e : γ) :

                                                        e is q + 4.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          Dependency graph
                                                          noncomputable def DescriptiveComplexity.CodeHalt.plus5F {γ : Type} (q e : γ) :

                                                          e is q + 5.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            Dependency graph
                                                            noncomputable def DescriptiveComplexity.CodeHalt.plus6F {γ : Type} (q e : γ) :

                                                            e is q + 6.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For
                                                              Dependency graph
                                                              noncomputable def DescriptiveComplexity.CodeHalt.plus7F {γ : Type} (q e : γ) :

                                                              e is q + 7.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                Dependency graph
                                                                noncomputable def DescriptiveComplexity.CodeHalt.isOneF {γ : Type} (e : γ) :

                                                                e is the numeral 1.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  Dependency graph
                                                                  noncomputable def DescriptiveComplexity.CodeHalt.isTwoF {γ : Type} (e : γ) :

                                                                  e is the numeral 2.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    Dependency graph
                                                                    noncomputable def DescriptiveComplexity.CodeHalt.isThreeF {γ : Type} (e : γ) :

                                                                    e is the numeral 3.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      Dependency graph
                                                                      noncomputable def DescriptiveComplexity.CodeHalt.isPairEF {γ : Type} (e e₁ e₂ : γ) :

                                                                      e numbers the code pair e₁ e₂.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        Dependency graph
                                                                        noncomputable def DescriptiveComplexity.CodeHalt.isPrecEF {γ : Type} (e e₁ e₂ : γ) :

                                                                        e numbers the code prec e₁ e₂.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          Dependency graph
                                                                          noncomputable def DescriptiveComplexity.CodeHalt.isCompEF {γ : Type} (e e₁ e₂ : γ) :

                                                                          e numbers the code comp e₁ e₂.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            Dependency graph
                                                                            noncomputable def DescriptiveComplexity.CodeHalt.isRfindEF {γ : Type} (e e₁ : γ) :

                                                                            e numbers the code rfind' e₁.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              Dependency graph
                                                                              noncomputable def DescriptiveComplexity.CodeHalt.nextPRF {γ : Type} (a' b' a b : γ) :

                                                                              (a, b) is the pair enumerated just after (a', b').

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

                                                                                The order of the numeral segment #

                                                                                Dependency graph

                                                                                The order is transitive.

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

                                                                                  The order is antisymmetric.

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

                                                                                    The order is total.

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

                                                                                      The numeral segment is linearly ordered.

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

                                                                                        The justification rules #

                                                                                        Every addition fact is justified by the recurrence.

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

                                                                                          Every pairing fact is justified by the successor rule.

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

                                                                                            Every decoding fact is justified by the node's mark and its children.

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

                                                                                              Every evaluation fact is justified by the rules of its code.

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

                                                                                                The root draws a code that returns something on 0.

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

                                                                                                  The kernel: the invented values carry a halting computation.

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

                                                                                                    What the kernel says #

                                                                                                    Dependency graph

                                                                                                    The assignment a certificate induces #

                                                                                                    Read back by DescriptiveComplexity.CodeHalt.certOf, this is the identity definitionally, which is what makes the round trip a rfl.

                                                                                                    The assignment a certificate induces.

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

                                                                                                      The theorems #

                                                                                                      CODEHALT is definable in ∃SO[new]: the invented values are the numeral segment of a halting computation of the code the root draws, and the kernel says that they carry one.

                                                                                                      Dependency graph

                                                                                                      CODEHALT is in RE. The certificate is the whole computation of the drawn code – its numbers, its pairings and its intermediate values – which is a finite object, but no function of the instance bounds it: that is exactly the difference between Σ₁ and ∃SO[new], and between NP and RE.

                                                                                                      Dependency graph

                                                                                                      CODEHALT first-order-reduces to finite satisfiability. No new hardness work is needed: DescriptiveComplexity.finsat_hard_of_sigmaSONewDefinable is proved for an arbitrary source vocabulary, so putting a problem in RE reduces it to DescriptiveComplexity.FINSAT at once.

                                                                                                      Dependency graph