Moments by a verified recurrence #
Sendov.integral_moment computes ∫ t in 0..1, t ^ 3 * Q ^ k as the multinomial double
sum (M). That formula is correct but has Θ(k²) terms, and expanding it with simp
becomes impossible around k = 20: at n = 53 the 676-term expansion exhausts two million
heartbeats.
This file computes the same integral by a recurrence instead. Clearing denominators with
D = 2 (n-1) (3+α), the quadratic D * Q has integer coefficients as a polynomial in
α:
D * Q t = g₀ + g₁ t + g₂ t², g₀ = D, g₁ = -2Dc, g₂ = DA,
so the coefficients of (D * Q t) ^ k in t satisfy
Rec (k+1) j = g₀ * Rec k j + g₁ * Rec k (j-1) + g₂ * Rec k (j-2),
which is just multiplication of the previous row by a fixed quadratic. Integrating term by
term against t ^ 3 then gives the moment. This replaces Θ(k²) summands by k steps on
vectors of length ≤ 2k+1.
The essential point is that the coefficients are held as integers, not as real
expressions: a recurrence carried out symbolically over ℝ would grow its terms by a factor
of three per step and reproduce the blow-up in another form. So polynomials in α are
represented here by List ℤ (dense, lowest degree first) with their own arithmetic, and
Sendov.pev is the evaluation homomorphism into ℝ. Everything a degree needs is then a
kernel computation on integer data.
Main statements #
Sendov.pev_padd,Sendov.pev_pmul: evaluation is a ring homomorphism;Sendov.rev_qrow:qrowcomputes the coefficients of(g₀ + g₁t + g₂t²) ^ k;Sendov.integral_irow: integrating a row againstt ^ (i+3)givesirow;Sendov.integral_moment_rec: the moment, via the recurrence.
Evaluation of a dense integer polynomial at a real point, by Horner's rule.
Equations
- Sendov.pev [] x✝ = 0
- Sendov.pev (a :: p) x✝ = ↑a + x✝ * Sendov.pev p x✝
Instances For
Addition of dense integer polynomials.
Equations
- Sendov.padd [] x✝ = x✝
- Sendov.padd (a :: p) [] = a :: p
- Sendov.padd (a :: p) (b :: q) = (a + b) :: Sendov.padd p q
Instances For
Multiplication of dense integer polynomials.
Equations
- Sendov.pmul [] x✝ = []
- Sendov.pmul (a :: p) x✝ = Sendov.padd (List.map (fun (b : ℤ) => a * b) x✝) (0 :: Sendov.pmul p x✝)
Instances For
Evaluation of a row at α (coefficientwise) and t (by Horner's rule).
Equations
- Sendov.rev [] x✝¹ x✝ = 0
- Sendov.rev (p :: r) x✝¹ x✝ = Sendov.pev p x✝¹ + x✝ * Sendov.rev r x✝¹ x✝
Instances For
Addition of rows.
Equations
- Sendov.radd [] x✝ = x✝
- Sendov.radd (p :: r) [] = p :: r
- Sendov.radd (p :: r) (q :: s) = Sendov.padd p q :: Sendov.radd r s
Instances For
Multiply every coefficient of a row by a fixed polynomial in α.
Equations
- Sendov.rscale g r = List.map (Sendov.pmul g) r
Instances For
The recurrence #
One step of the recurrence: multiply a row by g₀ + g₁ t + g₂ t².
Equations
- Sendov.qstep g₀ g₁ g₂ r = Sendov.radd (Sendov.rscale g₀ r) (Sendov.radd ([] :: Sendov.rscale g₁ r) ([] :: [] :: Sendov.rscale g₂ r))
Instances For
The coefficients of (g₀ + g₁ t + g₂ t²) ^ k, as a polynomial in t whose
coefficients are integer polynomials in α.
Equations
- Sendov.qrow g₀ g₁ g₂ 0 = [[1]]
- Sendov.qrow g₀ g₁ g₂ k.succ = Sendov.qstep g₀ g₁ g₂ (Sendov.qrow g₀ g₁ g₂ k)
Instances For
Integration #
irow r i α = ∑ⱼ (coefficient j of r, at α) / (i + j + 4), the value of
∫ t in 0..1, t ^ (i+3) * rev r α t.
Equations
- Sendov.irow [] x✝¹ x✝ = 0
- Sendov.irow (p :: r) x✝¹ x✝ = Sendov.pev p x✝ / (↑x✝¹ + 4) + Sendov.irow r (x✝¹ + 1) x✝
Instances For
The moment, by the recurrence. If D * Q t has the integer coefficient
polynomials g₀, g₁, g₂ in α, then the moment is a kernel computation on those integers.
No hypothesis beyond D ≠ 0 is needed: this is a polynomial identity.
The coefficients for a given degree #
With D = 2 (n-1) (3+α) one has D * Q t = g₀ + g₁ t + g₂ t² where, as polynomials in α
with integer coefficients,
g₀ = 6(n-1) + 2(n-1) α,
g₁ = -12(n-1) + (12 - 2(n-1)) α + 4 α²,
g₂ = 6(n-1) + (2(n-1) - 12) α - 4 α².