Carry polynomials in an arbitrary odd base #
The coefficient of X ^ r in the length-k polynomial counts odd-base digit
words whose doubling creates exactly r carries. Splitting the digit set at
the carry threshold gives a two-state transfer matrix and its scalar
second-order recurrence.
def
OddPrimeValuationDistribution.oddCarryWordDigits
{half length : ℕ}
(word : List.Vector (Fin (oddBase half)) length)
:
Convert an odd-base word to natural digits.
Equations
Instances For
Odd-base carry-count enumerator from an arbitrary incoming carry.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Odd-base carry-count enumerator from incoming carry zero.
Equations
- OddPrimeValuationDistribution.oddCarryPolynomial half length = OddPrimeValuationDistribution.oddCarryPolynomialFrom half 0 length
Instances For
def
OddPrimeValuationDistribution.oddCarryWordsSuccEquiv
(half length : ℕ)
:
List.Vector (Fin (oddBase half)) (length + 1) ≃ (_ : Fin (oddBase half)) × List.Vector (Fin (oddBase half)) length
Peeling the least significant digit from an odd-base word.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
OddPrimeValuationDistribution.oddCarryPolynomialFrom_succ
(half carry length : ℕ)
:
oddCarryPolynomialFrom half carry (length + 1) = ∑ digit : Fin (oddBase half),
Polynomial.X ^ oddDoubleCarryStep half carry ↑digit * oddCarryPolynomialFrom half (oddDoubleCarryStep half carry ↑digit) length
Split digits into the half + 1 no-carry choices and half carry choices
when the incoming carry is zero.
Equations
Instances For
Split digits into the half no-carry choices and half + 1 carry choices
when the incoming carry is one.
Equations
Instances For
@[simp]
theorem
OddPrimeValuationDistribution.oddZeroCarryDigitSplitEquiv_symm_inl_val
(half : ℕ)
(digit : Fin (half + 1))
:
@[simp]
theorem
OddPrimeValuationDistribution.oddZeroCarryDigitSplitEquiv_symm_inr_val
(half : ℕ)
(digit : Fin half)
:
@[simp]
theorem
OddPrimeValuationDistribution.oddOneCarryDigitSplitEquiv_symm_inl_val
(half : ℕ)
(digit : Fin half)
:
@[simp]
theorem
OddPrimeValuationDistribution.oddOneCarryDigitSplitEquiv_symm_inr_val
(half : ℕ)
(digit : Fin (half + 1))
:
theorem
OddPrimeValuationDistribution.oddDoubleCarryStep_zero_split_inl
(half : ℕ)
(digit : Fin (half + 1))
:
theorem
OddPrimeValuationDistribution.oddDoubleCarryStep_zero_split_inr
(half : ℕ)
(digit : Fin half)
:
theorem
OddPrimeValuationDistribution.oddDoubleCarryStep_one_split_inl
(half : ℕ)
(digit : Fin half)
:
theorem
OddPrimeValuationDistribution.oddDoubleCarryStep_one_split_inr
(half : ℕ)
(digit : Fin (half + 1))
:
theorem
OddPrimeValuationDistribution.oddCarryPolynomialFrom_zeroCarry_succ
(half length : ℕ)
:
oddCarryPolynomialFrom half 0 (length + 1) = ↑(half + 1) * oddCarryPolynomialFrom half 0 length + ↑half * Polynomial.X * oddCarryPolynomialFrom half 1 length
theorem
OddPrimeValuationDistribution.oddCarryPolynomialFrom_oneCarry_succ
(half length : ℕ)
:
oddCarryPolynomialFrom half 1 (length + 1) = ↑half * oddCarryPolynomialFrom half 0 length + ↑(half + 1) * Polynomial.X * oddCarryPolynomialFrom half 1 length
@[simp]
@[simp]
theorem
OddPrimeValuationDistribution.oddCarryPolynomial_recurrence
(half length : ℕ)
:
oddCarryPolynomial half (length + 2) + ↑(oddBase half) * Polynomial.X * oddCarryPolynomial half length = ↑(half + 1) * (1 + Polynomial.X) * oddCarryPolynomial half (length + 1)
Headline recurrence for the full carry distribution in odd base
2 * half + 1.