A Lean 4 proof that a good stochastic natural latent can be replaced by a deterministic natural latent, with an explicit loss depending only on the number of variables and the deletion budget—not on any alphabet size.
Fix a finite joint law for
and choose a deletion budget
For any finite latent
A stochastic latent
A deterministic latent is a hard code
These are genuinely different objectives. Define
and
The certified theorem proves, simultaneously for every
where
The coefficient is intentionally coarse. Its important feature is that it is
independent of the alphabet of
The stochastic optimization can randomize
The Lean definition of
The proof first replaces each maximum by a sum over the
Two independent posterior copies of
where
The certified two-variable theorem and a finite random-table construction then
produce a genuine hard code
The number NVarTwoVariableInput.oneSidedFactor. The multivariate proof refers only to
that definition, so a future two-variable improvement is isolated to the
small adapter module rather than repeated throughout the proof.
A general entropy ledger transfers this approximation into the summed hard score. Finally,
converts the summed theorem back to the requested max-redundancy objectives.
The stable public declaration is
stoch_to_det.general_stoch_to_det_all_deletions.
Its conclusion is
deletionMaxT (m := m) p <=
(Nat.choose n m : Real) *
(1 + ((n : Real) + (Nat.choose n m : Real) + 1) *
NVarTwoVariableInput.oneSidedFactor *
(((n : Real) ^ 2 * ((n : Real) - 2)) + 1)) *
deletionMaxTau (m := m) punder the hypotheses IsPMF p, 3 <= n, 1 <= m, and m < n.
The earlier coordinate-sum theorem remains available as
stoch_to_det.general_stoch_to_det for
backward compatibility. It is not used to identify the deterministic and
stochastic redundancy errors above.
Install Elan, then run:
git clone https://github.com/satchlj/general_stoch_to_det.git
cd general_stoch_to_det
lake exe cache get
./verify.shThe Mathlib cache command avoids rebuilding upstream dependencies when a matching binary cache is available. The verifier then:
- rejects unfinished or disallowed Lean constructs;
- builds the complete public library;
- checks the all-deletion theorem and its key intermediate lemmas with
assert_no_sorry; and - checks the complete axiom dependencies of the public declarations.
The expected axiom set is exactly
[propext, Classical.choice, Quot.sound]
GitHub Actions runs the same verification on every push and pull request.
| File | Role |
|---|---|
MainTheorems.lean |
Short, stable public theorem statements |
NVarAllDeletion.lean |
Arbitrary deletion sets, summed score, max score, and final all-deletion theorem |
NVarReplicaBound.lean |
Alphabet-free replica-defect inequality |
NVarTwoVariableInput.lean |
Single adapter for the certified two-variable factor and derived one-sided factor |
NVarPosteriorCompression.lean |
Two-variable compression, posterior sampling, and seed fixing |
NVarHardening.lean |
Converts approximation errors into a deterministic hard score |
SharedRace.lean |
Certified T <= 96 * tau endpoint used by posterior compression |
Ledger96.lean |
Calibrated two-variable ledger beneath the shared-race endpoint |
VerifyAllDeletion.lean |
Dedicated no-sorry and axiom audit for the all-deletion theorem |
Verify.lean |
Audit of the stable public declarations |
verify.sh |
One-command source, build, and kernel audit |
Exploratory files and abandoned proof routes are intentionally not included.
This development builds on David Lorell's
stoch_to_det repository. The
two-variable endpoint used here comes from
PR #5.
See NOTICE.md for exact revisions and checksums. The repository
is licensed under Apache 2.0; see LICENSE.