Arithmetic correctness of the ternary doubling transducer #
The transducer in GKPCarry.Definitions counts outgoing carries while doubling
a little-endian ternary word. This file proves that, on the canonical ternary
digits of n, twice that count is exactly Kummer's ternary digit excess.
Kummer's ternary digit excess for a central binomial coefficient.
Equations
- GKPCarry.ternaryDigitExcess n = 2 * (Nat.digits 3 n).sum - (Nat.digits 3 (2 * n)).sum
Instances For
Fixed-length output digits emitted while doubling a ternary word. The final carry is retained as the last digit.
Equations
- GKPCarry.ternaryDoubleDigitsAux [] x✝ = [x✝]
- GKPCarry.ternaryDoubleDigitsAux (digit :: digits) x✝ = (2 * digit + x✝) % 3 :: GKPCarry.ternaryDoubleDigitsAux digits (GKPCarry.ternaryDoubleCarryStep x✝ digit)
Instances For
theorem
GKPCarry.ternaryDoubleCarryStep_eq_div
{carry digit : ℕ}
(hcarry : carry ≤ 1)
(hdigit : digit < 3)
:
Headline carry identity: Kummer's ternary digit excess is exactly twice the number of carries generated by ternary doubling.
theorem
GKPCarry.nine_dvd_centralBinom_of_two_le_ternaryDoubleCarryCount
{n : ℕ}
(h : 2 ≤ ternaryDoubleCarryCount (Nat.digits 3 n))
:
Two ternary doubling carries imply divisibility of the central binomial coefficient by nine.
theorem
GKPCarry.gkpConjecture_of_ternaryCarryCount
(h : ∀ (k : ℕ), 2 < k → k ≠ 6 → k ≠ 8 → 2 ≤ ternaryDoubleCarryCount (Nat.digits 3 (2 ^ k)))
:
A universal carry certificate on nonexceptional powers of two would imply the GKP conjecture.