Documentation

AIT.PrefixCounting

Counting bounds on KB and K_bitlen, and KB's non-computability #

The finiteness lemmas setOf_K_le_finite (AIT/KolmogorovComplexity.lean) and setOf_KB_le_finite (AIT/PrefixMachine.lean) carry no count. This module supplies the counts, and the non-computability of KB, the one property of the machine that kraft_KB and the rest of AIT/PrefixMachine.lean leave out, unlike K and KP.

What this establishes #

Three independent results, none consuming another.

What this does NOT establish (flagged) #

KB is unbounded #

theorem PrefixCounting.KB_unbounded (m : ℕ) :
∃ (s : ℕ), m < PrefixMachine.KB s

KB is unbounded: incompressible numbers of every prefix complexity exist — the twin of KolmogorovComplexity.K_unbounded at KB in place of K.

The counting bound on KB #

theorem PrefixMachine.finset_card_KB_le (L : ℕ) (F : Finset ℕ) (hF : ∀ x ∈ F, KB x ≤ L) :
F.card ≤ 2 ^ L

The counting bound on KB, Finset form: at most 2 ^ L naturals are describable within a budget of L bits. Each member of F contributes at least 2 ^ (-L) to the Kraft series (pow_le_pow_of_le_one), so F.card copies of that weight sit below the series' partial sum over F (Finset.sum_le_sum), below the full series (Summable.sum_le_tsum, at summable_two_pow_neg_KB), below one (kraft_KB) — the cast arithmetic closing exactly as CodingTheoremWeak.card_exceeds_lt's does.

theorem PrefixMachine.card_KB_le (L : ℕ) :
{x : ℕ | KB x ≤ L}.ncard ≤ 2 ^ L

The counting bound on KB, ncard form: finset_card_KB_le's corollary at the finiteness setOf_KB_le_finite supplies, over its own Finite.toFinset. Stated separately from the Finset form because Set.ncard of an infinite set is 0, so this sentence alone could not fail; the Finset form is what a reader needs to see the bound bite.

The same count on K_bitlen, by injectivity #

The counting bound on K_bitlen, Finset form: at most 2 ^ L naturals have bit-length complexity at most L. No Kraft inequality is proved here (whether ∑ 2^{-K_bitlen} converges is not settled); the bound is K's injectivity into the indices below 2 ^ L instead — K_bitlen s ≤ L unfolds to K s < 2 ^ L (K_bitlen_eq, Nat.size_le), so F.image K sits inside Finset.range (2 ^ L) and has F's own cardinality (Finset.card_image_of_injOn, at K_injective).

The counting bound on K_bitlen, ncard form: finset_card_K_bitlen_le's corollary at the finiteness of {s | K_bitlen s ≤ L} (setOf_K_bitlen_le_finite), the same shape as card_KB_le.

KB is not computable #

KB is not computable. Were it computable, the partial map f n := Nat.rfind (fun s => decide (n < KB s)) would be Partrec (the search predicate is computable in (n, s)); at each n, KB_unbounded puts a witness in f n's domain (no totality step, unlike KP_not_computable's route through a Kleene fixed point over Code.eval), so some w ∈ f n has n < KB w (Nat.rfind_spec); KB's own partial-map invariance (KB_partial_map_le) then gives `KB w ≤ KB n

  • c, and KB_le_two_mul_sizegivesKB n ≤ 2 * Nat.size n + c', so n < 2 * Nat.size n + c' + cat everyn— contradicted atn := 2 ^ (c + c' + 4), where Nat.size n = c + c' + 5 (Nat.size_pow) reduces the claim to 3 * (c + c') + 10 ≤ 16 * 2 ^ (c + c'), true at every value of c + c' (Nat.lt_two_pow_self`).