Documentation

ReflectiveSubsystems.IndexCost

The index cost of a description #

Provenance: [Discovery] §1.1 (the reference machine) and [Decoupling] Theorem 6.7 (the two currencies, index-length vs. description-length). Registered in [Discovery] §1.1's formalization note as FV row FV-33.

K_bitlen prices a program by its Gödel INDEX's bit-length (codelen', AIT.KolmogorovBitlen), while KB prices a description by its LENGTH (AIT.PrefixMachine). Mathlib's encodeCode sends pair a b/comp a b to 4 * Nat.pair (ea) (eb) + O(1), so an index's bit-length DOUBLES at each node of a code's tree: an arithmetic literal of chain depth size w costs about 2 ^ size w, which is why no arithmetic literal of the description may appear in a K_bitlen-vs-KB bound. A BALANCED tree over the description's bits costs only about its leaf count instead, and the construction here is that tree.

What this establishes #

What this does NOT establish (flagged) #

Hypotheses: paper-stated vs added #

The balanced nest, over naturals and over codes #

One pairing round: pairs up neighbouring values with Nat.pair, carrying an odd tail value up unchanged to the next round.

Equations
Instances For
    theorem ReflectiveSubsystems.pairUp_length_lt (x y : ℕ) (rest : List ℕ) :
    (pairUp (x :: y :: rest)).length < (x :: y :: rest).length

    Folds a bit list into a balanced nest under Nat.pair, pairing neighbours and carrying an odd tail up.

    Equations
    Instances For

      The Code-valued balanced nest: Code.zero/Code.succ for false/true — the two cheapest codes in the encoding, evaluating at 0 to the bit they stand for — folded the same way as nestValue.

      Equations
      Instances For

        The depth-indexed inverse: unpairs a value h times into its 2 ^ h leaf bits. Correct on values built by nestValue/bitNest from a list of length exactly 2 ^ h (NestSpec's third clause), where no round ever carries an odd tail.

        Equations
        Instances For

          Drops trailing padding falses and then one marker true. Correct on any base ++ true :: List.replicate k false regardless of base's own content (stripPad_append_marker_pad), since the marker true stops the trailing-false scan before it ever reaches base.

          Equations
          Instances For

            The three specifications, taken as hypotheses #

            codelen''s growth law at pair/comp: pairing/composing two codes costs at most twice the wider child plus three (the three attained).

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

              SizeLaw, proved. encodeCode's own clauses at pair/comp are 4 * Nat.pair (encodeCode cf) (encodeCode cg) + 4 and + 6; size_four_mul_add_four_le/size_four_mul_add_six_le turn that + 4/+ 6 into + 3 bits over the pairing's own bit-length, and size_pair_le_max bounds the pairing by twice the wider child's bit-length.

              The nest's own evaluation, size and round-trip facts.

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

                A decoder reading a depth-tagged, padded nest back through univPrefix.

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

                  Code.const's own growth law, proved from SizeLaw #

                  Code.const is Mathlib's own unary successor tower (const (n + 1) = comp succ (const n)), not one of the three hypotheses, so its codelen' growth is proved here from SizeLaw.

                  Code.const h's own codelen' growth law, matching NestSpec's second clause's shape: proved by induction on h, using SizeLaw's comp clause at each unary step.

                  NestSpec, proved #

                  NestSpec, proved: the nest's own evaluation law (nestSpec_eval), its size law from sizeLaw (nestSpec_size), and its round-trip law (nestSpec_roundTrip) — nothing beyond sizeLaw assumed.

                  DecoderSpec, proved #

                  The decoder's defining function is partial recursive: univPrefix.eval composed after the primitive-recursive stripped-nest bits, by Nat.Partrec.Code.eval_part at the constant code univPrefix.

                  The decoder, as a code: reads a depth-tagged, padded nest back through univPrefix, taken by Nat.Partrec.Code.exists_code at partrec_decoderFn.

                  Equations
                  Instances For

                    DecoderSpec, proved. decoderCode reads Nat.pair h V back to univPrefix.eval on the padded nest's stripped bits, at every h and V — decoderCode's own defining property, read at Nat.pair h V through Nat.unpair_pair.

                    The conditional theorem #

                    The index cost of a description: K_bitlen x ≤ 32 * KB x + c, c carrying only the decoder's own index. Proved from the three specifications: assemble a KB-minimal description into a padded, depth-tagged balanced nest, and run it through the decoder U.

                    The index cost of a description, unconditional. sizeLaw, nestSpec and decoderSpec discharge every hypothesis of K_bitlen_le_32_mul_KB_of, so K_bitlen x ≤ 32 * KB x + c holds outright, c carrying only the decoder's own index.