Documentation

ReflectiveSubsystems.CodeDataRate

The data rate of the additive complexity KE is bounded away from one bit per bit #

Provenance: [Discovery] §1.1 (the 2^{−K} prior over a fixed reference machine). Extends CodeLayer/AdditiveComplexity.lean (E, elen, KE, minCode, card_KE_le) with a node-counted refinement of the counting bound.

What this establishes #

Why node counts, not raw bit-strings #

card_KE_le (AdditiveComplexity.lean) bounds {x | KE x ≤ L} by the bit-strings of length at most L, of which there are < 2^(L+1) — the bound a general prefix code would need. E's serialization is tighter than that: its opcode alternates a 1-in-8 fixed choice among a 3-bit budget with a binary/leaf structural constraint, so the codes of n nodes number only Θ((1 + 4√3)ⁿ) ≈ Θ(7.928ⁿ), not Θ(8ⁿ). This file makes that gap a machine-checked bound and draws the consequence for KE's data rate.

Hypotheses: paper-stated vs added #

E spends exactly three bits per AST node.

Counting codes by node count #

codesOfNodes n enumerates the codes with exactly n nodes. It is built with an explicit fuel parameter (codesOfNodesFuel) so the recursive calls are on a strictly smaller first argument — plain structural recursion, avoiding a well-founded-recursion obligation over a Finset.biUnion closure that carries no bound on its argument. fuel = n always suffices (mem_codesOfNodesFuel), which is all codesOfNodes ever needs.

Codes of exactly n AST nodes, computed with fuel levels of recursion depth; correct once fuel ≥ n (mem_codesOfNodesFuel).

Equations
Instances For

    Codes with exactly n AST nodes. n fuel levels always suffice (mem_codesOfNodes).

    Equations
    Instances For

      codesOfNodes finds every code at its own node count.

      The growth bound #

      A truncated-Cauchy-square inequality (sum_antidiagonal_sq_le) turns the recursive cardinality bound into a bound on the weighted partial sums ∑ (codesOfNodes n).card · zⁿ, uniformly ≤ 11/10 at z = 20/159; the pointwise and tail-sum growth bounds follow.

      The growth bound. At most (11/10)·(159/20)ⁿ codes have n nodes — the singularity of the counting generating function is at 1 + 4√3 ≈ 7.928, below the 8 the three-bit-per-node budget could carry.

      theorem ReflectiveSubsystems.sum_card_codesOfNodes_le (N : ℕ) :
      10 * 20 ^ N * ∑ n ∈ Finset.range (N + 1), (codesOfNodes n).card ≤ 11 * 159 ^ N

      The tail-sum growth bound: the same rate, summed over every node count up to N.

      The counting bound on KE, reindexed by node counts #

      The counting bound on KE, counted by node budget rather than by raw bit-strings. Each x with KE x ≤ L has its own shortest program (minCode, injective by minCode_E_injective), and that program has at most L / 3 nodes (elen = 3 · nodes).

      The data rate of KE #

      theorem ReflectiveSubsystems.KE_data_rate (c : ℕ) :
      ∃ (x : ℕ), 501 * x.size + 500 * c < 500 * AdditiveComplexity.KE x

      The data rate of KE is bounded away from one bit per bit. No constant c makes KE x ≤ (1 + 1/500) · Nat.size x + c for every x. Consequently no constant makes KE an ideal code for the computable measure μ_ε(x) := 2^{−⌈(1 + 1/500) · Nat.size x⌉ − 1}, whose total mass is under one.