Documentation

LeanPool.GKPCarry.CarryArithmetic

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
Instances For

    Fixed-length output digits emitted while doubling a ternary word. The final carry is retained as the last digit.

    Equations
    Instances For
      theorem GKPCarry.ternaryDoubleCarryStep_eq_div {carry digit : } (hcarry : carry 1) (hdigit : digit < 3) :
      ternaryDoubleCarryStep carry digit = (2 * digit + carry) / 3
      theorem GKPCarry.ternaryDoubleCarryStep_local {carry digit : } (hcarry : carry 1) (hdigit : digit < 3) :
      (2 * digit + carry) % 3 + 3 * ternaryDoubleCarryStep carry digit = 2 * digit + carry
      theorem GKPCarry.ternaryDoubleDigitsAux_length (digits : List ) (carry : ) :
      (ternaryDoubleDigitsAux digits carry).length = digits.length + 1
      theorem GKPCarry.ternaryDoubleDigitsAux_lt_three {digits : List } {carry : } (hcarry : carry < 3) (hdigits : digitdigits, digit < 3) (value : ) :
      value ternaryDoubleDigitsAux digits carryvalue < 3
      theorem GKPCarry.ternaryDoubleDigitsAux_ofDigits {digits : List } {carry : } (hcarry : carry 1) (hdigits : digitdigits, digit < 3) :
      Nat.ofDigits 3 (ternaryDoubleDigitsAux digits carry) = 2 * Nat.ofDigits 3 digits + carry
      theorem GKPCarry.ternaryDoubleDigitsAux_sum_add_two_mul_carries {digits : List } {carry : } (hcarry : carry 1) (hdigits : digitdigits, digit < 3) :
      (ternaryDoubleDigitsAux digits carry).sum + 2 * ternaryDoubleCarryCountAux digits carry = 2 * digits.sum + carry

      Headline carry identity: Kummer's ternary digit excess is exactly twice the number of carries generated by ternary doubling.

      Two ternary doubling carries imply divisibility of the central binomial coefficient by nine.

      theorem GKPCarry.gkpConjecture_of_ternaryCarryCount (h : ∀ (k : ), 2 < kk 6k 82 ternaryDoubleCarryCount (Nat.digits 3 (2 ^ k))) :

      A universal carry certificate on nonexceptional powers of two would imply the GKP conjecture.