Fast computation of the N th term of an algebraic series in positive characteristic Alin Bostan 1 Gilles Christol 1 Inria 2 Institut 2 Philippe Dumas 1 Saclay de mathématiques de Jussieu Functional Equations in Limoges, March 29th 2016 1 / 30 Motivation I I Ubiquity of algebraic functions (combinatorics, number theory, algebraic geometry) Confluence of several domains: – functional equations – automatic sequences – complexity theory I One of the most difficult questions in modular computations is the complexity of computations mod p for a large prime p of coefficients in the expansion of an algebraic function. D. Chudnovsky & G. Chudnovsky, 1990 Computer Algebra in the Service of Mathematical Physics and Number Theory 2 / 30 Problem and main result Input: – field K = Fp – E(x, y) ∈ K[x, y], with E(0, 0) = 0, Ey (0, 0) 6= 0 – N ∈ N≥0 Output: – the N th coefficient of the unique solution f (x) ∈ K[[x]] of E(x, f (x)) = 0, f (0) = 0 Main result: – arithmetic complexity linear in log N and almost linear in p 3 / 30 State of the art First N coefficients Method char. 0 char. p Undetermined coefficients Fixed point iteration Newton iteration Linear recurrence O(N d )† X X¶ X¶ X∗ † d = deg y E(x, y) ¶ FFT used all along e 2 )¶ O(N e )¶ O(N O(N ) ∗ with Kung + Traub, 1976 All algebraic functions can be computed fast p-adic computations Chudnovsky + Chudnovsky, 1986 On expansion of algebraic functions in power and Puiseux series, I 4 / 30 State of the art Only N th term (with precomputation) char. 0 char. p O(log2 N ) + O(1) √ e N ) + O(1) O( X Method Binary powering (d = 1 only) Baby steps – Giant steps Divide and Conquer X∗ e 3d ) O(logp N ) × O(p Rational series by binary powering Miller + Brown, 1966, An algorithm for evaluation of remote terms in a linear recurrence sequence Fiduccia, 1985 An efficient formula for linear recurrences 5 / 30 State of the art Only N th term (with precomputation) Method Rational series Baby steps – Giant steps Divide and Conquer char. 0 char. p O(log2 N ) + O(1) √ e N ) + O(1) O( X X∗ e 3d ) O(logp N ) × O(p Baby steps – Giant steps after precomputing algebraic equation −→ differential equation −→ linear recurrence Chudnovsky + Chudnovsky, 1988 Approximations and complex multiplication according to Ramanujan 6 / 30 State of the art Only N th term (with precomputation) Method Rational series Baby steps – Giant steps Divide and Conquer char. 0 char. p O(log2 N ) + O(1) √ e N ) + O(1) O( X X∗ e 3d ) O(logp N ) × O(p Divide and Conquer after precomputing algebraic equation −→ Mahler equation −→ DAC recurrence Christol + Kamae + Mendès France + Rauzy, 1980, Suites algébriques, automates et substitutions 7 / 30 From algebraic equation to Mahler equation Algebraic equation y = 2x + 5xy + 4xy 2 + xy 3 y 1 y y 0 1 2 0 y3 y9 y 27 p=3 1 1+2x2 +x3 x3 1+2x2 +x3 +2x5 +x6 +x8 +x9 +2x11 +x12 x12 1+x x 1+x+2x2 +x3 +x4 x4 1+x+2x2 +x3 +x4 +2x5 +2x6 +2x7 +x8 +x9 +x10 +2x11 +x12 +x13 x13 2 2 +x3 2 1+x+2x 3 2+2x+x2 +2x3 +2x4 +x5 +x6 +x7 +2x8 +2x9 +2x10 +x11 +2x12 x12 x Mahler equation 2x2 + 2x3 + x4 f (x) + 1 + x2 + 2x3 + 2x4 + x5 + 2x6 f (x3 ) + 2 + 2x3 + 2x5 + x6 + 2x9 f (x9 ) + x9 f (x27 ) = 0 Frobenius f (x)p = f (xp ) 8 / 30 From algebraic equation to Mahler equation Algebraic equation y = 2x + 5xy + 4xy 2 + xy 3 Mahler equation 2x2 + 2x3 + x4 f (x) + 1 + x2 + 2x3 + 2x4 + x5 + 2x6 f (x3 ) + 2 + 2x3 + 2x5 + x6 + 2x9 f (x9 ) + x9 f (x27 ) = 0 Divide-and-conquer recurrence 2fn−2 + 2fn−3 + fn−4 + f n3 + f n−2 + 2f n−3 + 2f n−4 + f n−5 + 2f n−6 3 3 3 3 3 + 2f n9 + 2f n−3 + 2f n−5 + f n−6 + 2f n−9 + f n−9 = 0 9 9 9 9 27 fx = 0 if x 6∈ N≥0 9 / 30 +5x131 +2x130 +4x129 +x128 +2x127 +5x126 +3x125 +2x124 +4x123 +x122 +x121 +6x120 +6x119 From algebraic equation to Mahler equation 118 117 116 115 114 113 112 111 110 109 108 107 +2x +2x +5x +3x +6x +4x +2x +6x +4x +6x +5x +6x +5x106 +6x105 +4x104 +3x103 +4x102 +x101 +2x100 +5x99 +3x98 +4x97 +5x71 +4x69 +2x68 +2x67 +4x66 +5x65 +3x64 +x62 +2x57 +3x55 +3x54 +3x53 +6x52 +4x51 +5x50 +4x48 +2x46 +4x45 +3x44 +x43 +6x42 +5x41 +2x40 +5x39 +3x38 +6x37 +3x36 +2x35 +x34 +4x33 +3x32 +6x31 +5x30 +3x29 +4x28 +x27 +3x26 +6x25 +5x24 +5x23 +5x22 +2x21 +4x20 +x18 +2x17 +5x16 +5x15 +3x14 +4x13 +6x12 +2x11 +4x10 +2x9 +x8 +2x7 +5x6 +5x4 +3x3 +4x2 +1 f (x7 ) ) + 6x165 +5x164 +2x163 +2x162 +4x161 +3x160 +2x155 +3x153 +2x151 +4x150 +3x149 +6x147 ( +x144 +2x143 +5x142 +4x141 +3x140 +6x139 +x137 +2x136 +5x135 +x134 +3x133 +5x132 +2x130 +4x129 +3x128 +4x127 +6x126 +6x125 +6x123 +5x122 +2x121 +2x120 +4x119 +3x118 +5x116 +3x115 +4x114 +4x113 +x112 +6x111 +4x106 +6x104 +4x102 +x101 +6x100 +5x98 +2x71 +3x69 +x67 +2x66 +5x65 +5x64 +3x63 +4x62 +5x57 +4x55 +5x53 +3x52 +4x51 +x49 +5x46 +3x45 +4x44 +6x43 +x42 +2x41 +5x39 +3x38 +4x37 +5x36 +x35 +4x34 +3x32 +6x31 +x30 +6x29 +2x28 +2x27 +2x25 +4x24 +3x23 +6x21 +6x18 +5x17 +2x16 +2x15 +4x14 +3x13 +2x8 +3x6 +2x4 +4x3 +3x2 +6 f (x49 ) ) + x165 +2x164 +5x163 +5x162 +3x161 +4x160 +5x155 +4x153 +5x151 +3x150 +4x149 +x147 f (x343 )=0 ( ) O(logp N ) × pO(d) 10 / 30 Sections Section operators X X Sr fn xn = fpk+r xk , n≥0 0≤r<p k≥0 Lemma Let f be in K[[x]] and let N = (N` · · · N1 N0 )p be the radix p expansion of N . Then fN = (SN` · · · SN1 SN0 f )(0). 11 / 30 Sections N = 100000 p=7 = 5 × 16807 + 6 × 2401 + 4 × 343 + 3 × 49 + 5 × 7 + 5 × 1 = (5, 6, 4, 3, 5, 5)7 f (x) = f0 + f1 x + f2 x2 + f3 x3 + f4 x4 + f5 x5 + · · · S5 f (x) = f5 + f12 x + f19 x2 + f26 x3 + f33 x4 + f40 x5 + · · · S5 S5 f (x) = f40 + f89 x + f138 x2 + f187 x3 + f236 x4 + f285 x5 + · · · S3 S5 S5 f (x) = f187 + f530 x + f873 x2 + f1216 x3 + f1559 x4 + f1902 x5 + · · · S4 S3 S5 S5 f (x) = f1559 + f3960 x + f6361 x2 + f8762 x3 + f11163 x4 + · · · S6 S4 S3 S5 S5 f (x) = f15965 + f32772 x + f49579 x2 + f66386 x3 + f83193 x4 + · · · S5 S6 S4 S3 S5 S5 f (x) = f100000 + f217649 x + f335298 x2 + f452947 x3 + · · · S5 S6 S4 S3 S5 S5 f (0) = f100000 12 / 30 Diagonal F (x, y) = y y(1 − 5xy − xy 2 − 3xy 3 ) 1 − 2x − 5xy − 4xy 2 − xy 3 + 2xy + 4x2 y + x4 y 2 + 3x3 y 3 + 3xy 3 + 5xy p=7 + 4x5 y + 2x4 y + x3 y + 3x2 y 2 + 5x3 y 2 4 = 2 4 + 6x5 y 3 + 4x6 y 3 4 4 + 6x y 5 4 +x y + 2x2 y 5 + 2x3 y 5 + 5x2 y 7 + 6x3 y 7 +x y + 2x y +x y 4 9 +x y + x9 y + 2x10 y + 6x9 y 2 + 3x10 y 2 + 6x8 y 3 7 4 8 4 + 3x y + 6x10 y 3 9 4 + 5x y + 4x9 y 5 + 4x10 y 5 + 5x6 y 6 + 6x7 y 6 + 4x9 y 6 + 6x10 y 6 5 8 + 3x y 5 9 + 3x y + 6x7 y 7 6 8 + 2x y 6 9 + 6x y + 3x9 y 7 + 5x10 y 7 8 8 + 3x y + 6x9 y 8 + 5x10 y 8 + x9 y 9 + 6x10 y 9 7 9 + 6x y + 6x5 y 10 + 2x6 y 10 + 5x3 y 10 + 4x8 y + x7 y 3 +x y + 5x5 y 7 4 8 + 2x7 y + 6x5 y 5 + 4x6 y 5 + 5x7 y 5 + 2x2 y 6 + 3x3 y 6 + 5x4 y 6 3 9 + x6 y + 5x5 y 2 + 2x6 y 2 + 2x7 y 2 + x8 y 10 + 4x10 y 10 + x4 y 11 + x5 y 11 + 5x6 y 11 + 4x7 y 11 + 4x8 y 11 + 2x9 y 11 + 6x5 y 12 + 2x6 y 12 + x7 y 12 4 13 6 13 + 5x y + 3x9 y 13 + x10 y 13 + 5x y 5 14 7 14 + 5x y + 3x9 y 12+ 3x10 y 12 + 3x y + 4x9 y 14+ 2x10 y 14 + 6x5 y 15 + x6 y 15 + 3x7 y 15 + x8 y 15 + 2x9 y 15+ 4x10 y 15 + 5x5 y 16 + 4x6 y 16 + 4x7 y 16 + 5x9 y 16+ 4x10 y 16 · ·3x · 8 + x9 + 4x10 + x14 + 5x15 + · · · f (x) = DF (x) = 2x + 3x + 3x + x + 6x + 5x + 6x + 2 3 4 5 6 7 + 13 / 30 Diagonal Theorem (Furstenberg’s theorem) Every algebraic series is the diagonal of a bivariate rational function. E(x, f (x)) = 0, f (x) = D a b f (0) = 0, Ey (0, 0) 6= 0 with a(x, y) = yEy (xy, y), b(x, y) = E(xy, y)/y Furstenberg, 1967, Algebraic functions over finite fields 14 / 30 Actions univariate sections Sr : action on formal series a Sr f = Sr D b diagonal and commutation rule Sr D = DSr ? bivariate sections Sr : action on bivariate rational functions a a Sr D = DSr b b Frobenius ? pseudo-sections Tr : action on bivariate polynomials a Sr abp−1 Tr a Christol, 1979, DSr = D =D b b b Ensembles presque périodiques k-reconnaissables 15 / 30 Actions univariate sections Sr : action on formal series fN = (SN` · · · SN1 SN0 f )(0) ? bivariate sections Sr : action on bivariate rational functions ? pseudo-sections Tr : action on bivariate polynomials (TN` · · · TN1 TN0 a)(0, 0) fN = b(0, 0) 16 / 30 Finite dimensional stable subspace DSr a Sr abp−1 Tr a =D =D b b b dx = max(degx a, degx b), dy = max(degy a, degy b) Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ p−1 vb Fp [x, y]dx ,dy = vB 7−→ Sr vB = Tr v Fp [x, y]dx ,dy left stable by Tr , 0 ≤ r < p 17 / 30 Finite dimensional stable subspace Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ Fp [x, y]dx ,dy vbp−1 = vB 7−→ Sr vB = Tr v p = 11 E = (1+x)(x−y)+x2 y 2 + (1 + x)y 3 + y 4 a = −y −xy 2 +3y 3 +4y 4 + 3xy 4 + 2x2 y 4 b = −1 + x − xy + y 2 + x2 y + y 3 + xy 3 + x2 y 3 dx = 2, dy = 4 small box [0, dx ] × [0, dy ] b 18 / 30 Finite dimensional stable subspace Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ Fp [x, y]dx ,dy vbp−1 = vB 7−→ Sr vB = Tr v homothety with ratio p − 1 almost large box [0, (p − 1)dx ] × [0, (p − 1)dy ] B = bp−1 19 / 30 Finite dimensional stable subspace Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ Fp [x, y]dx ,dy vbp−1 = vB 7−→ Sr vB = Tr v v = xy 3 in the canonical basis translation by (1, 3) large box [0, pdx ] × [0, pdy ] xy 3 B 20 / 30 Finite dimensional stable subspace Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ Fp [x, y]dx ,dy vbp−1 = vB 7−→ Sr vB = Tr v filter r = 3 xy 3 B 21 / 30 Finite dimensional stable subspace Fp [x, y]dx ,dy −→ Fp [x, y]pdx ,pdy −→ v 7−→ Fp [x, y]dx ,dy vbp−1 = vB 7−→ Sr vB = Tr v contraction small box [0, dx ] × [0, dy ] T3 xy 3 = S3 xy 3 B 22 / 30 Precomputation of A0 , A1 , . . . , Ap−1 All information is in B = bp−1 . matrix Ar : xn y m −−−−−−−−−→ xn y m B −−−−−−−−−→ Sr xn y m B translation selection No computation in K = Fp , except raising b to the power p − 1 e 2 ) (binary powering, Kronecker substitution, FFT) Cost: O(p Theorem The N th coefficient can be computed in time e 2 ) + O(logp N ). O(p 23 / 30 Only a small part of B = bp−1 is enough Task: Computation of A0 , A1 , . . . , Ap−1 row index i = (k, `) column index j = (n, m) B= X cα,β xα y β α,β xn y m −−−−−−−−−→ xn y m B −−−−−−−−−→ Sr xn y m B translation selection X X cα,β xn+α y m+β −−−−→ cα,β xk y ` xn y m −−−−→ α,β (C) n + α = pk + r m + β = p` + r α,β (C) =⇒ β − α = p(` − k) + n − m 24 / 30 Only a small part of B = bp−1 is enough p = 11 p = 109 25 / 30 Improved precomputation B(x/t, t) = X cα,β xα tβ−α = α,β X πδ (x)tδ δ B(x/t, t) = b(x/t, t)p−1 = b(x/t, t)p b(xp /tp , tp ) = b(x/t, t) b(x/t, t) X 1 = cu (x)tu b(x/t, t) u b(xp /tp , tp ) = rational series πδ (x) = X P v bv (x p )tpv for free cu (x)bv (xp ) u+pv=δ 26 / 30 Improved precomputation δ = β − α = intercept of the strips with the ordinates axis e big leaps from one strip to the next O(p) (Kronecker substitution, FFT, Newton iteration) Fiduccia, 1985 An efficient formula for linear recurrences 27 / 30 Main result Theorem Let E be in Fp [x, y]h,d satisfy E(0, 0) = 0 and Ey (0, 0) 6= 0, and let f ∈ Fp [[x]] be its unique root with f (0) = 0. One can compute the coefficient fN of f in e h2 (d + h)2 logp N + O(h(d + h)5 p) operations in Fp . 28 / 30 Timings Maple implementation; timings on Intel Core i5, 2.8 GHz, 3MB. k With p = 9001, N = 1010 , k = 1..6, ComputingTime(N ) ' 0.0011 · logp (N ) − 1.3563 With p = NextPrime(2k ), k = 1..12, PrecomputingTime(p) ' 0.00037 · p log(p) + 0.04835 Documents at url http://specfun.inria.fr/dumas/Research/AlgModp/ 29 / 30 Theorem Let E be in Fp [x, y]h,d satisfy E(0, 0) = 0 and Ey (0, 0) 6= 0, and let f ∈ Fp [[x]] be its unique root with f (0) = 0. One can compute the coefficient fN of f in e h2 (d + h)2 logp N + O(h(d + h)5 p) operations in Fp . Thanks for your attention! 30 / 30
© Copyright 2026 Paperzz