[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"oV0PcZTeBL":3},"# Formalization of Algorithmic Information Theory in Lean 4\n\nThis repository contains a Lean 4 formalization of parts of algorithmic\ninformation theory, centered on Kolmogorov complexity.  The development uses\nMathlib's computability infrastructure and represents decompressors as partial\nfunctions (`Part`).\n\nThe project is currently pinned to Lean `v4.31.0` and Mathlib `v4.31.0`.\n\n## Current Status\n\nThe `main` branch builds with the pinned Lean/Mathlib toolchain and the library\nsources are intended to stay free of `sorry`, `admit`, custom `axiom`, `unsafe`,\n`implemented_by`, `set_option profiler true`, and project-specific\n`set_option maxHeartbeats` overrides.\n\nThe recent Lean 4.31 update also reorganized the prefix-complexity and\nalgorithmic-probability layers into smaller modules. Large Kraft-Chaitin,\nlower-semicomputable semimeasure, prefix-counting, and universal-semimeasure\nfiles have compatibility aggregators at the old import paths, while their\ndefinitions, API lemmas, and computability proofs now live in more focused\nsubmodules.\n\n## Build\n\nInstall Lean through `elan`, then run:\n\n```bash\nlake exe cache get\nlake build\n```\n\nFor a smaller check of the exported library target, run:\n\n```bash\nlake build KolmogorovMathlib\n```\n\n## Scope\n\nThe original core development formalizes plain conditional complexity for\nbitstrings, a universal decompressor, invariance up to an additive constant,\nbasic complexity inequalities, incompressibility, uncomputability of natural\nnumber complexity, and Chaitin-style incompleteness results.  The\nsecond-incompleteness files use abstract formal-system interfaces in a\nKritchman-Raz style rather than formalizing a concrete arithmetic system.\n\nRecent modules add a prefix-complexity and algorithmic-probability layer.  This\nincludes prefix-free codes, prefix machines, conditional prefix complexity,\noptimal prefix decompressors, Kraft inequalities and converse constructions,\ntwo-stage and pair-coding infrastructure, a priori machine semimeasures,\nlower-semicomputable semimeasure interfaces, mixture and domination lemmas, and\nKraft-Chaitin style coding infrastructure.\n\nThe prefix and semimeasure material contains substantial theorem statements and\nchecked infrastructure, but it should be read as an actively developed\nformalization layer.  In particular, the repository avoids claiming a finished\ntextbook equivalence theory with exact logarithmic coding-theorem equalities.\nMany results are stated in additive-complexity or multiplicative semimeasure\nforms over `ENat` and `ENNReal`.\n\n## Project Layout\n\n```text\nKolmogorovMathlib/\n├── Foundation/             # Search operators, recursively enumerable relations, Nat.bits encoding\n├── Core/                   # Maps, conditional/plain complexity, universal decompressor, invariance\n├── Complexity/             # Bounds, incompressibility, uncomputability, incompleteness interfaces\n├── Prefix/                 # Prefix-free codes, prefix machines, prefix complexity, Kraft results\n└── AlgorithmicProbability/ # A priori semimeasures, LSC semimeasures, mixtures, coding infrastructure\n```\n\nThe top-level module `KolmogorovMathlib.lean` imports the library development.\n\n## Lake Metadata\n\nThe Lake package is named `kolmogorov_complexity`; the Lean library target is\n`KolmogorovMathlib`.  The Mathlib dependency is pinned in `lakefile.toml` and\n`lake-manifest.json` to the Lean `v4.31.0` ecosystem.\n\n## Development Notes\n\nThe repository should remain buildable with `lake build` after every public\nchange. Prefer small named helper lemmas and compatibility-preserving module\nsplits over large monolithic computability proofs.\n\nWhen adding new material, keep definitions and lightweight API lemmas separate\nfrom heavier computability or encoding proofs once a file starts to grow. This\nkeeps the project usable as a base for a much larger formalization of\nalgorithmic information theory.\n",1782661969271]