This repository is the Lean 4 formalization accompanying the paper
José A. R. Fonollosa, Minimum modulus for the unique multiset-sum problem, with an application to computing the permanent, arXiv:XXXX.XXXXX, 2026.
The main theorem of the paper is kernel-checked end-to-end: nmin_eq builds
with 0 errors, 0 sorries and uses only the standard axioms
(propext, Classical.choice, Quot.sound, checked with #print axioms nmin_eq).
Fix
For the super-increasing set
Theorem.
$N_{\min}(n) = 2^n - 2^{\lfloor \log_2 n \rfloor}$ for all$n \ge 2$ .
The Lean development proves exactly this, for all nmin_eq states
IsLeast {N | 2 ≤ N ∧ Valid n N} (2^n − 2^m) with m = Nat.log 2 n, combining
the paper's Theorem A (validity / upper bound) and Theorem B (lower bound).
That this
| File | lean/MinModulus/Basic.lean (~940 lines, single file) |
| Toolchain | Lean 4 v4.15.0, Mathlib pinned v4.15.0 (prebuilt cache) |
| Build | cd lean && lake build — green (0 errors, 0 sorries) |
| Axioms | propext, Classical.choice, Quot.sound only |
export PATH=$HOME/.elan/bin:$PATH
cd lean && lake build # ~seconds warm; Mathlib comes from the cache in lean/.lakeThe development is stated in k-space over ℕ: a candidate multiset is
k : ℕ → ℕ with ∑_{i<n} k i = n, validity is the paper's k-vector condition
with Nat.ModEq, and the paper's signed multiples M ≡ 2^n − 1 [MOD N] on
| Lean declaration | Corresponds to (paper) | Status |
|---|---|---|
a, dsum, val, Supp, Valid
|
Problem statement, k-vector form | ✅ defined |
sum_two_pow, sum_a_add_dsum
|
§3 reduction identities | ✅ proved |
not_valid_of_witness |
Lemma 1 (reduction), witness direction | ✅ proved |
val_pad, dsum_pad, supp_mono, update_top, shift_*, unshift_*
|
(plumbing) | ✅ proved |
ones_rep, ones_erase_rep, exists_rep_le, exists_rep_lt, exists_rep_compl
|
§6 Prop. 1 (master achievability criterion), existence half | ✅ proved |
dsum_succ_of_lt, exists_dsum_eq
|
Lemma 3 (digit sum), contiguity (upward) half | ✅ proved |
theoremB |
§6 Theorem B — lower bound, all four cases | ✅ proved |
gmin, gmin_add_le, gmin_add_pow, gmin_ones
|
§4 greedy digit sum |
✅ proved |
gmin_le_dsum |
Lemma 3 (digit sum), minimality (downward) half | ✅ proved |
ones_unique |
Lemma 2 ( |
✅ proved |
dsum_le_val, val_le_dsum_mul
|
§3 trivial range |
✅ proved |
gmin_step |
§5 Lemma 4 (step), |
✅ proved |
slack |
§5 slack bound |
✅ proved |
theoremA |
§5 Theorem A — upper bound / validity | ✅ proved |
nmin_eq |
Main theorem, IsLeast {N ∣ 2 ≤ N ∧ Valid n N} (2^n − 2^m) |
✅ proved |
- Theorem B constructs the four witness representations directly by
induction on bit-width with a parity split, instead of certifying them
via
s_min/popcount. - Theorem A avoids popcount entirely and follows the paper's §5
route directly.
gmin w M(binary digits ofMbelow bitw, plus the whole quotient on the top coin) is defined by the one-bit-peeling recursiongmin (w+1) M = M % 2 + gmin w (M / 2), so every proof is an induction whose steps only use literal/2,%2—omegahandles all arithmetic.gmin_stepis the paper's Lemma 4 (subtraction encoded asM' + 2^t = M + 2^{w+1}), proved by bit-peeling with a parity split;slackiterates it overjfrom the basegmin_ones. No range restriction onj, noNat.logcase analysis, no small-nevaluations. - Lemma 2 (
ones_unique) is a descent on the bottom coin: parity forcesk 0 = 1 + 2t, andgmin_le_dsum+gmin_add_leforcet = 0.
omegatreats2^was an opaque atom, but does abstract nonlinear products (j * N) as atoms — provide bridging equations byringand let omega finish linearly. Corners that are vacuous on paper via pow semantics need explicit case splits feeding omega the reduced facts.- Mathlib v4.15 names:
Nat.lt_two_pow_self(argument implicit),Function.update_of_ne/Function.update_self,Nat.log_eq_of_pow_le_of_lt_powfor concreteNat.logvalues (does not reduce bydecide). - Goals of the form
val w (fun i => …) = …are stated about a lambda;rw/omeganeed the beta-reduced shape — open such proofs withshow, or reuseshift_*through a pointwiseFinset.sum_congr.