Manuscript Offprint

arXiv:2610.22404

Aligning Information Theory and Formal Verification: A Lean Formalization of Rate-Distortion Theory

Fubin Yan, Ruxuan Dong, Ruoxuan Shi, Duolei Wang, Kenneth W. Shum

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Fubin Yan, Ruxuan Dong, Ruoxuan Shi, Duolei Wang, and Kenneth W. Shum

School of Science and Engineering

The Chinese University of Hong Kong, Shenzhen

Shenzhen, China.

Abstract—Large language models have recently demonstrated an ability to generate substantial mathematical proofs and formalizations, including machine-checked arguments for major open problems and classical theorems. These developments highlight a growing workflow in which AI systems search for proofs while proof assistants certify their correctness. Within information theory, however, formalized libraries remain limited, and existing formalized theorems focus almost exclusively on Shannon's foundational lossless theorems. This paper presents the first Lean formalization of core components of rate–distortion theory, a central framework for lossy compression and modern machine-learning analysis. We identify the alignment challenges that arise when translating information-theoretic definitions, such as distortion measures, typicality and achievability, into a proof-assistant setting, and we develop a reusable library of definitions and lemmas faithful to textbook conventions. Our formalization provides a foundation for future AI-assisted proofs in information theory and enables subsequent mechanized developments to build on a coherent, verified infrastructure rather than generating long proofs from scratch.

Keywords: Rate-distortion theory, computer proof assistant, vibe proving, AI for math, Lean.

I. INTRODUCTION

Recent breakthroughs in AI-assisted mathematics have demonstrated that large language models can now produce substantial, technically sophisticated proofs, either with human guidance or even from a single prompt. Two landmark examples are a solution attempt for the Navier–Stokes equation and a complete computer formalization of Fermat's Last Theorem. In September 2026, an internal OpenAI model generated a 166-page proof of Statements C and D from the Clay Mathematics Institute's millennium prize announcement [1], and verified its correctness in Lean. In the same month, Anthropic's Claude produced a full formalization of Fermat's Last Theorem, comprising 13.4 million lines of Lean code and 29,500 intermediate lemmas [2].

These developments illustrate an emerging workflow for AI-assisted mathematics. Before an AI system can effectively search for a proof, the relevant definitions, hypotheses, and target statements must be expressed with complete precision. After a proof is found – especially one that is long or LLM generated – formal verification provides a mechanism to certify that no hidden gaps remain in the formal proof relative

TABLE I RECENT AI-ASSISTED WORKS IN INFORMATION THEORY

TopicLean formalizedReference
Cyclic Hadamard matrix and Barker sequence conjectureno[3]
Three conjectures about doubly symmetric binary sourceyes[4]
Weak Hellinger inequality for noisy Boolean channelsyes[5]
Upper bound on binary deletion channel capacityyes[6]
Sub-optimality of Marton inner boundno[7]
Classification of (n, 4)cdoe for binary symmetric channelyes[8]
Improvement of MRRW boundyes[9]
Improved lower bound on zero-error capacity of CnC_nyes[10]-[12]

to the stated definitions and hypotheses. Table I summarizes several recent results in information theory obtained with assistance from AI systems.

For elementary combinatorial or algebraic problems, the computer formalization step is often straightforward. In contrast, many problems in information theory require a substantial layer of background definitions and customary conventions before the statement itself becomes mathematically meaningful. Concepts such as entropy, mutual information, KL divergence, typicality, and asymptotic achievability form a specialized language for reasoning about communication systems and statistical learning. Ensuring that formal definitions and theorem statements faithfully capture the intended mathematics is known as the alignment problem. Lean verifies proofs against the formal definitions and statements, but their correspondence with the intended mathematics requires separate checking. Bastounis, Circelli, and Hansen [13] discuss mismatches between natural-language arguments and their Lean formalizations.

In our development, we checked the formal definitions and theorem statements against the intended mathematics before using AI assistance to complete the proofs. This method allows us to benefit from the speed of AI-assisted code generation while reducing the risk of mismatches with the intended mathematics.

Despite recent advances in auto-formalization, the Lean proofs produced in the works listed in Table I are not easily reusable in other projects. For example, the proof of the improved MRRW bound in [9] is so long that reading it line by line is infeasible for humans. If a new AI-generated proof is produced and one wishes to verify it in Lean, current AI models typically start from scratch and generate yet another lengthy proof. A well-designed library of definitions and theorems in Lean, that is aligned with textbook conventions and standard information-theoretic practice, is therefore essential for simplifying future formalization efforts and enabling reuse across projects.

Currently, the mathematical library of Lean contains some basic results in information theory, such as KL divergence and Hamming distance. However, the library is not complete and the development is on-going. In a companion of the proof of polynomial Freiman–Ruzsa conjecture [14], Tao and his collaborators need the Ruzsa distance in their project, and for this purpose, they implemented Shannon entropy and mutual information for up to three random variables [15]. Luccioli in his master's thesis formalized f-divergences, and the associated data processing inequality in Lean [16]. Concentration inequalities, Rademacher complexity and Dudley's entropy integral theorem for sub-Gaussian processes are implemented in [17], [18], providing a formal foundation for statistical learning theory. A more comprehensive project on building a Lean library for machine learning research was initiated by Degenne and Rauber [19], with the aim of analyzing machine learning algorithms in Lean.

Rate–distortion theory is a central branch of classical information theory, characterizing the minimum communication rate required to represent a source subject to a prescribed distortion constraint. In recent years, it has also become an important tool in the analysis and design of neural networks and machine-learning systems. Since Shannon’s foundational work and its systematic development in standard texts such as Berger [20], Viterbi and Omura [21], Cover and Thomas [22], McEliece [23], and Yeung [24], rate–distortion arguments have become indispensable in lossy compression, quantization, statistics, learning theory, and network information theory.

Although rate–distortion theory plays a central role in information theory, it has not yet been formalized in mainstream proof assistants. Existing computer formalization in information theory have focused primarily on Shannon’s foundational lossless results, and have been carried out mainly in Isabelle/HOL or the Rocq proof assistant. Mhamdi, Hasan, and Tahar formalized entropy measures in HOL [25]. In parallel, Affeldt, Hagiwara, and Senizergues developed a substantial formalization of core Shannon theory—including coding theorems and typical-sequence arguments—first reported in [26] and later expanded in [27]. This line of work was consolidated into the infotheo library, which provides a Rocq infrastructure for classical coding theorems [28], and has supported further case studies such as the formalization of the binary symmetric erasure channel [29]. In another direction, a Lean formalization of quantum information theory has recently been developed in [30].

This paper fill this gap by initiating a Lean formalization of the core of rate–distortion theory for finite alphabets. We introduce the information measures, including entropy, KL divergence, and mutual information, using Mathlib's existing infrastructure. We then establish the supporting inequalities and probabilistic estimates, and use them to prove the direct and converse results of the rate–distortion theorem. The direct result establishes achievability for R>RI(D)R > R_I(D), with every code satisfying the prescribed rate bound, while the converse holds for all distortion thresholds. Under an asymptotic rate constraint, we also prove achievability at R=RI(D)R = R_I(D) whenever RI(D)R_I(D) is finite. We also establish the existence of optimal test channels and the right continuity of the information rate–distortion function. This work also provides some reusable definitions and lemmas in information theory built on Mathlib. The long-term objective is to build a library for reusable formalization that can be extended toward more advanced topics, such as multi-terminal problems, information geometry, and statistical learning theory.

The remainder of this paper is organized as follows. We review the problem formulation of rate-distortion problem for finite alphabet in Section II, and define the basic information measures, such as entropy, KL divergence and mutual information in Section III. In Section IV, we define the information rate-distortion function as the optimal value of an optimization problem with mutual information as the objective function. After setting up these prerequisites, we formulate the operational rate-distortion problem in Section V and state the direct and converse parts of the rate-distortion theorem in Lean. Section VI presents the formal proofs and discusses the reusable components developed along the way. Finally, Section VII concludes the paper.

References (30)