Documentation

DescriptiveComplexity.Problems.CodeHalt.Hardness.Draw

The drawn instance draws the intended code #

The correctness of the drawing: the instance built by DescriptiveComplexity.codeProgInterp is well formed (DescriptiveComplexity.codeWF_codeProg) and its root draws

comp cP (pair (numeral card) (nest of the tables))

(DescriptiveComplexity.decodesTo_rootPt).

Everything is a walk of the input order, taken with the increasing enumeration DescriptiveComplexity.ordEnum of the universe: the numeral chain and each level of each table block are proved by the same downward induction, from the tail of the chain – the shared zero element – back to its head.

The subtree of the fixed code cP is the one place the induction is on a code rather than on the order: DescriptiveComplexity.decodesTo_subPos says that a drawing whose marks and children follow DescriptiveComplexity.subAt, DescriptiveComplexity.sub1 and DescriptiveComplexity.sub2 draws every subterm at its position, by structural induction on the code.

Drawing a fixed code #

A drawing of the syntax tree of a code: every position carries the mark of its subterm's constructor, and the child relations follow the positions of the children.

  • mark (p : SubPos c) : Mark (tagOf (subAt c p)) (F p)

    Every position carries the mark of its subterm's constructor.

  • arg1 (p q : SubPos c) : sub1 c p = some qCArg1 (F p) (F q)

    The first-child relation follows the first child of a position.

  • arg2 (p q : SubPos c) : sub2 c p = some qCArg2 (F p) (F q)

    The second-child relation follows the second child of a position.

Instances For
    Dependency graph
    theorem DescriptiveComplexity.Draws.embed {N : Type} [FirstOrder.Language.code.Structure N] {c c' : Nat.Partrec.Code} {F : SubPos cN} (h : Draws c F) (e : SubPos c'SubPos c) (hsub : ∀ (q : SubPos c'), subAt c (e q) = subAt c' q) (h1e : ∀ (q : SubPos c'), sub1 c (e q) = Option.map e (sub1 c' q)) (h2e : ∀ (q : SubPos c'), sub2 c (e q) = Option.map e (sub2 c' q)) :
    Draws c' (F e)

    A drawing restricts to a drawing of a subterm, along an embedding of positions that respects subterms and children.

    Dependency graph

    A drawing of a code draws every subterm at its position. The hypotheses are exactly what the defining formulas of the interpretation give for the tags of cP; the induction is on the code.

    Dependency graph

    The increasing enumeration of a finite linear order #

    noncomputable def DescriptiveComplexity.ordEnum (A : Type) [LinearOrder A] [Finite A] :

    The increasing enumeration of a finite linear order. Every chain of the drawing walks the order along it.

    Equations
    Instances For
      Dependency graph
      Dependency graph
      Dependency graph
      theorem DescriptiveComplexity.ordEnum_lt_succ {A : Type} [LinearOrder A] [Finite A] {k : } (h : k + 1 < Nat.card A) :
      (ordEnum A) k, < (ordEnum A) k + 1, h
      Dependency graph
      theorem DescriptiveComplexity.ordEnum_covBy {A : Type} [LinearOrder A] [Finite A] {k : } (h : k + 1 < Nat.card A) (a : A) :
      ¬((ordEnum A) k, < a a < (ordEnum A) k + 1, h)
      Dependency graph

      Uniqueness of the elements the guards pin down #

      theorem DescriptiveComplexity.eq_of_isBot {A : Type} [LinearOrder A] {a b : A} (ha : IsBot a) (hb : IsBot b) :
      a = b
      Dependency graph
      theorem DescriptiveComplexity.canon_ext {A : Type} [LinearOrder A] {D m : } {u u' : Fin DA} (h : Canon m u) (h' : Canon m u') (hag : ∀ (j : Fin D), j < mu j = u' j) :
      u = u'
      Dependency graph
      theorem DescriptiveComplexity.cov_unique {A : Type} [LinearOrder A] {a b b' : A} (h1 : a < b) (h2 : ∀ (c : A), ¬(a < c c < b)) (h1' : a < b') (h2' : ∀ (c : A), ¬(a < c c < b')) :
      b = b'
      Dependency graph
      theorem DescriptiveComplexity.not_isTop_of_lt {A : Type} [LinearOrder A] {a b : A} (h : a < b) :
      Dependency graph
      theorem DescriptiveComplexity.canon_mono {A : Type} [LinearOrder A] {D m m' : } {u : Fin DA} (h : Canon m u) (hm : m m') :
      Canon m' u
      Dependency graph

      The elements of the drawing #

      noncomputable def DescriptiveComplexity.botOrd (A : Type) [LinearOrder A] [Finite A] [Nonempty A] :
      A

      The least element of the input order.

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.botTup {L : FirstOrder.Language} (V : L.FinVocab) (A : Type) [LinearOrder A] [Finite A] [Nonempty A] :
        Fin (dimOf V)A

        The canonically padded tuple every unindexed element of the drawing carries.

        Equations
        Instances For
          Dependency graph
          Dependency graph
          Dependency graph
          Dependency graph
          noncomputable def DescriptiveComplexity.bitPt {L : FirstOrder.Language} (V : L.FinVocab) (cP : Nat.Partrec.Code) (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (i : Fin V.numSyms) (u : Fin (dimOf V)A) :

          The element carrying the bit of a tuple: the shared succ element if the symbol holds of it, the shared zero element if it does not.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.chainPt {L : FirstOrder.Language} (V : L.FinVocab) (cP : Nat.Partrec.Code) (A : Type) [LinearOrder A] [Finite A] [Nonempty A] (i : Fin V.numSyms) (l : Fin (dimOf V)) (u : Fin (dimOf V)A) (k : ) :

            The element standing at position k of the level-l chain of the block of the symbol i, above the prefix u.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.levelPt {L : FirstOrder.Language} (V : L.FinVocab) (cP : Nat.Partrec.Code) (A : Type) [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (i : Fin V.numSyms) :
              (Fin (dimOf V)A)(codeProgInterp V cP).Map A

              The element whose value is that of DescriptiveComplexity.levelVal: the bit at the bottom, the head of the next chain above it.

              Equations
              Instances For
                Dependency graph
                noncomputable def DescriptiveComplexity.numPt {L : FirstOrder.Language} (V : L.FinVocab) (cP : Nat.Partrec.Code) (A : Type) [LinearOrder A] [Finite A] [Nonempty A] (k : ) :

                The element standing at position k of the numeral chain.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.symPt {L : FirstOrder.Language} (V : L.FinVocab) (cP : Nat.Partrec.Code) (A : Type) [LinearOrder A] [Finite A] [Nonempty A] (k : ) :

                  The element standing at the symbol k of the chain of blocks.

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

                    The two shared leaves #

                    Dependency graph
                    Dependency graph

                    The chains of the blocks #

                    theorem DescriptiveComplexity.canon_setCo {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} [LinearOrder A] {m j : } (hj : j < m) (a : A) {u : Fin (dimOf V)A} (h : Canon m u) :
                    Canon m (setCo V j a u)
                    Dependency graph
                    theorem DescriptiveComplexity.setCo_at {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} (l : Fin (dimOf V)) (a : A) (t : Fin (dimOf V)A) :
                    setCo V (↑l) a t l = a
                    Dependency graph
                    theorem DescriptiveComplexity.setCo_at_fz {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} (a : A) (t : Fin (dimOf V)A) :
                    setCo V 0 a t (CodeProgRed.fz V) = a
                    Dependency graph
                    theorem DescriptiveComplexity.setCo_bot_at {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} [LinearOrder A] [Finite A] [Nonempty A] (l : Fin (dimOf V)) {u : Fin (dimOf V)A} (h : IsBot (u l)) :
                    setCo V (↑l) (botOrd A) u = u
                    Dependency graph
                    theorem DescriptiveComplexity.okOn_chainN {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [LinearOrder A] (i : Fin V.numSyms) (l : Fin (dimOf V)) (u : Fin (dimOf V)A) :
                    OkOn (ProgTag.chainN i l) u Canon (l + 1) u
                    Dependency graph
                    theorem DescriptiveComplexity.cArg1_chainPt {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (i : Fin V.numSyms) (l : Fin (dimOf V)) (m : ) (hm : l + m + 1 = dimOf V) {uk : Fin (dimOf V)A} (hok : Canon (l + 1) uk) :
                    CArg1 (progPt (ProgTag.chainN i l) uk) (levelPt V cP A i m uk)
                    Dependency graph
                    theorem DescriptiveComplexity.cArg2_chainPt {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (i : Fin V.numSyms) (l : Fin (dimOf V)) {u : Fin (dimOf V)A} (hu : Canon (↑l) u) (k : ) (hk : k < Nat.card A) :
                    CArg2 (progPt (ProgTag.chainN i l) (setCo V (↑l) ((ordEnum A) k, hk) u)) (chainPt V cP A i l u (k + 1))
                    Dependency graph
                    theorem DescriptiveComplexity.decodesTo_levelPt {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (m : ) :
                    m dimOf V∀ (i : Fin V.numSyms) (u : Fin (dimOf V)A), Canon (dimOf V - m) uDecodesTo (levelPt V cP A i m u) (levelCode V (Nat.card A) (⇑(ordEnum A)) i m u)

                    Every level of a block is drawn: the chain that walks the coordinate dimOf V - m draws the nest of the values below it. The induction is on the level, and inside it on the position along the chain, downwards from its tail.

                    Dependency graph

                    The head of the chains of a block draws the block.

                    Dependency graph

                    The chain of the blocks of the symbols #

                    theorem DescriptiveComplexity.decodesTo_symPt {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] (j k : ) :
                    k + j = V.numSymsDecodesTo (symPt V cP A k) (codeNestFrom (blockCode V (Nat.card A) (⇑(ordEnum A)) (botTup V A)) k)
                    Dependency graph

                    The numeral chain #

                    Dependency graph

                    The whole instance #

                    The element of the pair draws the numeral of the universe size beside the nest of the tables.

                    Dependency graph

                    The root of the drawn instance draws the intended program: the fixed procedure cP, composed with the pair of the numeral of the universe size and the nest of the tables.

                    Dependency graph

                    The drawing is well formed #

                    theorem DescriptiveComplexity.progPt_congr {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} {t t' : ProgTag V cP} {u u' : Fin (dimOf V)A} (h : t = t') (h2 : u = u') :
                    progPt t u = progPt t' u'
                    Dependency graph
                    theorem DescriptiveComplexity.canon0_ext {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} [LinearOrder A] {u u' : Fin (dimOf V)A} (h : Canon 0 u) (h' : Canon 0 u') :
                    u = u'
                    Dependency graph
                    theorem DescriptiveComplexity.canon_one_bot {L : FirstOrder.Language} {V : L.FinVocab} {A : Type} [LinearOrder A] {u : Fin (dimOf V)A} (h1 : Canon 1 u) (h0 : IsBot (u (CodeProgRed.fz V))) :
                    Canon 0 u
                    Dependency graph
                    Dependency graph
                    theorem DescriptiveComplexity.arg1_det {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [L.Structure A] [LinearOrder A] {ta tb tb' : ProgTag V cP} {ua ub ub' : Fin (dimOf V)A} (hob : OkOn tb ub) (hob' : OkOn tb' ub') (h : Arg1On ta tb ua ub) (h' : Arg1On ta tb' ua ub') :
                    progPt tb ub = progPt tb' ub'

                    The first child of an element is unique.

                    Dependency graph
                    theorem DescriptiveComplexity.arg2_det {L : FirstOrder.Language} {V : L.FinVocab} {cP : Nat.Partrec.Code} {A : Type} [LinearOrder A] {ta tb tb' : ProgTag V cP} {ua ub ub' : Fin (dimOf V)A} (hob : OkOn tb ub) (hob' : OkOn tb' ub') (h : Arg2On ta tb ua ub) (h' : Arg2On ta tb' ua ub') :
                    progPt tb ub = progPt tb' ub'

                    The second child of an element is unique.

                    Dependency graph

                    The drawn instance is well formed: at most one constructor mark per element and functional child relations, which is what makes what an element draws unique.

                    Dependency graph