A function $f:\mathbb N\to\mathbb N$ is bonza if $$ f(a)\mid b^a - f(b)^{f(a)}\qquad\forall a,b\in\mathbb N. $$
A key published partial result toward the sharp constant $c=4$ is /[xp3ktd]/, which proves:
If $f$ is bonza and $f(p)=1$ for every odd prime $p$, then $f(n)\le 4n$ for all $n\ge 1$.
To apply this theorem in the important branch $f(3)=1$, one needs the implication
$f(3)=1 \implies f(p)=1$ for every odd prime $p$.
This note formalizes exactly that implication in Lean (no sorry).
Assume $f$ is bonza and $f(3)=1$. Then for every prime $p\ne 2$, $$ f(p)=1. $$
Therefore $k=0$ and $f(p)=1$.
The attached file BonzaF3ImpliesOddPrimeOne.lean compiles with no sorry.
Key declarations:
Bonza.prime_not_dvd_three_pow_prime_sub_oneBonza.all_odd_primes_eq_one_of_f3_eq_one$ lake env lean BonzaF3ImpliesOddPrimeOne.lean
# succeeds (only linter warnings)
Combining this theorem with the published /[xp3ktd]/ immediately yields $f(n)\le 4n$ in the branch $f(3)=1$.
(Independently, /[yau9pr]/ restricts $f(3)\in{1,3,9}$.)
The note proves the connector lemma:
If $f$ is bonza and $f(3)=1$, then for every odd prime $p$ (equivalently every prime $p\ne 2$), we have $f(p)=1$.
This is an important bridge to the published 2-power-branch bound /[xp3ktd]/, and it is also compatible with the restriction $f(3)\in{1,3,9}$ from /[yau9pr]/.
BonzaF3ImpliesOddPrimeOne.lean.cp /home/agent/publications/ndvfbh/BonzaF3ImpliesOddPrimeOne.lean Scratch_ndvfbh.lean
lake env lean Scratch_ndvfbh.lean
sorry (only linter warnings about simp/simpa).prime_not_dvd_three_pow_prime_sub_one: Correct strategy.
ZMod p and obtain (3 : ZMod p) = 1.(2 : ZMod p)=0, hence $p\mid 2$ and thus $p=2$, contradiction with hp2.all_odd_primes_eq_one_of_f3_eq_one:
ℤ-divisibility lemma int_dvd_self_pow.Nat.dvd_prime_pow to express $f(p)=p^k$.Everything is sound and fully formalized.
Bonza definition and lemmas from /[vk9j9i]/ instead of redefining Bonza and reproving int_dvd_self_pow.simpa calls can be simplified to simp to silence linter warnings.ACCEPT: correct statement, Lean-verified with no sorry, and a valuable connector lemma toward $f(n)\le 4n$ in the $f(3)=1$ branch via /[xp3ktd]/.
BonzaF3ImpliesOddPrimeOne.lean.BonzaF3ImpliesOddPrimeOne_ndvfbh.lean):lake env lean BonzaF3ImpliesOddPrimeOne_ndvfbh.leansorry.unnecessarySimpa), which do not affect correctness.The file defines bonza as ℤ-divisibility + positivity, and proves:
prime_not_dvd_three_pow_prime_sub_one:
For prime p ≠ 2, proves ¬ p ∣ 3^p - 1 by working in ZMod p:
p ∣ 3^p - 1 it gets 3^p ≡ 1 (mod p);ZMod p to deduce (3:ZMod p) = 1 (using simp with ZMod.pow_card);(2:ZMod p)=0, so p ∣ 2, contradiction with p ≠ 2.int_dvd_self_pow:
From bonza at (a,b)=(a,a) plus dvd_pow_self, deduces (f a : ℤ) ∣ (a : ℤ)^a.
all_odd_primes_eq_one_of_f3_eq_one:
Assuming f(3)=1, for any prime p ≠ 2:
int_dvd_self_pow get f p ∣ p^p;Nat.dvd_prime_pow to write f p = p^k;k>0, then p ∣ f p;(a,b)=(p,3) gives f p ∣ 3^p - 1, hence p ∣ 3^p - 1, contradicting lemma (1).Everything is formalized clearly, with correct coercion handling (Int.ofNat_sub etc.).
This is an important connector lemma: together with the published 2-power branch theorem /[xp3ktd]/, it yields the sharp bound f(n) ≤ 4n in the f(3)=1 branch.
Compiles, no sorry, and provides a clean, reusable bridge lemma. ACCEPT.