8 factoring polynomials over finite fields
play

8. Factoring polynomials over finite fields CS-E4500 Advanced Course - PowerPoint PPT Presentation

8. Factoring polynomials over finite fields CS-E4500 Advanced Course on Algorithms Spring 2018 Peteri Kaski Department of Computer Science Aalto University Lecture schedule Tue 16 Jan: 1. Polynomials and integers Tue 23 Jan: 2. The fast


  1. 8. Factoring polynomials over finite fields CS-E4500 Advanced Course on Algorithms Spring 2018 Peteri Kaski Department of Computer Science Aalto University

  2. Lecture schedule Tue 16 Jan: 1. Polynomials and integers Tue 23 Jan: 2. The fast Fourier transform and fast multiplication Tue 30 Jan: 3. Qotient and remainder Tue 6 Feb: 4. Batch evaluation and interpolation Tue 13 Feb: Exam week — no lecture Tue 20 Feb: 5. Extended Euclidean algorithm and interpolation from erroneous data Tue 27 Feb: 6. Identity testing and probabilistically checkable proofs Tue 6 Mar: 7. Finite fields Tue 13 Mar: 8. Factoring polynomials over finite fields Tue 20 Mar: 9. Factoring integers

  3. CS-E4500 Advanced Course in Algorithms (5 ECTS, III–IV, Spring 2018) Q3 Q6 D3 D6 T3 T6 L4 L7 Q7 Q4 D7 T7 Exam L8 week Q8 L1 Q1 D4 D8 T4 T8 L5 L9 D1 T1 Q5 Q9 L2 D5 Q2 D9 T5 T9 L6 D2 T2 L3 L = Lecture; hall T5, Tue 12–14 Q = Q & A session; hall T5, Thu 12–14 D = Problem set deadline; Sun 20:00 T = Tutorial (model solutions); hall T6, Mon 16–18

  4. Recap of last week ◮ Prime fields (the integers modulo a prime) ◮ Irreducible polynomial , existence of irreducible polynomials ◮ Fermat’s Litle Theorem and its generalization (exercise) ◮ Finite fields of prime power order via irreducible polynomials (exercise) ◮ The characteristic of a ring; fields have either zero or prime characteristic ◮ Extension field , subfield , degree of an extension ◮ Algebraic and transcendental elements of a field extension; the minimal polynomial of an algebraic element ◮ Multiplicative order of a nonzero element in a finite field; the multiplicative group of a finite field is cyclic ◮ Formal derivative of a polynomial with coefficients in a field (exercise)

  5. Motivation for this and next week ◮ A tantalizing case where the connection between polynomials and integers apparently breaks down occurs with factoring ◮ Namely, it is known how to efficiently factor a given univariate polynomial over a finite field into its irreducible components, whereas no such algorithms are known for factoring a given integer into its prime factors ◮ This week we develop one efficient factoring algorithm for univariate polynomials over a finite field ◮ The best known algorithms for factoring integers run in time that scales moderately exponentially in the number of digits in the input; next week we study one such algorithm

  6. Factoring polynomials over finite fields (von zur Gathen and Gerhard [9], Sections 14.1–3, 14.6)

  7. Finite fields (Lidl and Niedderreiter [16])

  8. Key content for Lecture 8 ◮ Factoring a monic polynomial into monic irreducible polynomials over a finite field ◮ Square-and-multiply algorithm for modular exponentiation (exercise) ◮ The squarefree part of a polynomial ◮ Computing the squarefree part using the formal derivative , greatest common divisors, and modular exponentiation (exercise) ◮ The distinct-degree factorization of a squarefree polynomial ◮ Computing the distinct-degree factorization using extended Fermat’s litle theorem , modular exponentiation, and greatest common divisors ◮ The equal-degree factorization of a polynomial with known identical degrees for the irreducible factors ◮ Cantor–Zassenhaus algorithm and random spliting polynomials (analysis: exercise)

  9. Irreducible polynomial ◮ Let q be a prime power ◮ Let F q be the finite field with q elements ◮ We say that a polynomial f ∈ F q [ x ] is irreducible if f � F q and for any g , h ∈ F q [ x ] with f = gh we have g ∈ F q or h ∈ F q ◮ Let us also recall that we say that f ∈ F q [ x ] is monic if its leading coefficient is 1

  10. Factorization into irreducible polynomials ◮ Let f ∈ F q [ x ] ◮ The factorization of f consists of distinct monic irreducible polynomials f 1 , f 2 , . . . , f r ∈ F q [ x ] and integers d 1 , d 2 , . . . , d r ∈ Z ≥ 1 such that f = lc ( f ) f d 1 1 f d 2 2 · · · f d r r ◮ The factorization of f is unique up to ordering of the irreducible factors ◮ The polynomial f is squarefree if d 1 = d 2 = · · · = d r = 1

  11. Example: Factorization into irreducible polynomials ◮ The factorization of f = 2 + 2 x + x 2 + 2 x 4 + 2 x 5 + 2 x 6 + 2 x 8 + 2 x 9 + x 10 + x 11 + x 12 + x 13 ∈ F 3 [ x ] is f = ( 1 + x ) 3 ( x 2 + x + 2 )( x 2 + 1 )( x 3 + 2 x + 2 ) 2 ◮ Or what is the same, f 1 = 1 + x , d 1 = 3 , f 2 = x 2 + x + 2 , d 2 = 1 , f 3 = x 2 + 1 , d 3 = 1 , f 4 = x 3 + 2 x + 2 , d 4 = 2

  12. Preliminaries: Fast modular exponentiation ◮ Let f , g ∈ F q [ x ] with g � 0, deg f , deg g ≤ d and m ∈ Z ≥ 0 ◮ Then, there exists an algorithm that computes f m rem g in O ( M ( d ) log m ) operations in F q (exercise)

  13. Preliminaries: Greatest common divisor ◮ Let f , g ∈ F q [ x ] such that at least one of f , g is nonzero ◮ Let us write gcd ( f , g ) for the monic greatest common divisor of f and g ◮ That is, in what follows we assume that lc ( gcd ( f , g )) = 1

  14. Squarefree part ◮ Let f = lc ( f ) f d 1 1 f d 2 2 · · · f d r be the factorization of f ∈ F q [ x ] r ◮ The squarefree part of f is the (monic) polynomial f 1 f 2 · · · f r ◮ To factor f , it suffices to factor the squarefree part of f since f and its squarefree part have the same irreducible factors ◮ Indeed, given an irreducible factor f j of f , it is easy to determine the maximum exponent d j ∈ Z ≥ 1 such that f d j divides f j

  15. Example: Squarefree part ◮ The squarefree part of 2 + 2 x + x 2 + 2 x 4 + 2 x 5 + 2 x 6 + 2 x 8 + 2 x 9 + x 10 + x 11 + x 12 + x 13 ∈ F 3 [ x ] is 1 + x + 2 x 2 + x 5 + 2 x 7 + x 8 ∈ F 3 [ x ]

  16. The squarefree part and the formal derivative (1/2) ◮ Let p be the characteristic of F q ; that is, q is a power of the prime p ◮ Let f ∈ F q [ x ] be monic with factorization f = f d 1 1 f d 2 2 · · · f d r r ◮ Then, we have (exercise) r f � f ′ = d j f ′ (36) j f j j = 1 f ◮ Furthermore, for all i , j = 1 , 2 , . . . , r we have that f d i divides d j f ′ f j when i � j j i ◮ When i = j , clearly f d j − 1 f divides d j f ′ f j ; j j furthermore, we have that f d j f divides d j f ′ f j if and only if f j divides d j f ′ j ; j j since deg f ′ j < deg f j , we have that f j divides d j f ′ j if and only if p divides d j

  17. The squarefree part and the formal derivative (2/2) ◮ Set u ← gcd ( f , f ′ ) and v ← f / u ◮ For j = 1 , 2 , . . . , r , let   if p does not divide d j ; 1  δ j =  0 if p divides d j  ◮ We have u = f d 1 − δ 1 f d 2 − δ 2 · · · f d r − δ r r 1 2 v = f δ 1 1 f δ 2 2 · · · f δ r r ◮ In particular, v is the squarefree part of f if δ 1 = δ 2 = · · · = δ r = 1 ◮ Otherwise, that is, when δ j = 0 for at least one j , we need to do some more work ...

  18. Extracting a p th power ◮ Recall that we have f = f d 1 1 f d 2 2 · · · f d r r v = f δ 1 1 f δ 2 2 · · · f δ r r ◮ Let w ← f / gcd ( f , v deg f ) (exercise: how do you compute w fast given f and v as input?) ◮ We have w = f ( 1 − δ 1 ) d 1 f ( 1 − δ 1 ) d 2 · · · f ( 1 − δ r ) d r � f d j = r 1 2 j p | d j p | d j f d j / p ◮ That is, we have that w is the p th power of the polynomial � j ◮ To access the squarefree part of w (which, when multiplied with v , forms the squarefree part of f ), it suffices to recurse on a p th root of w ◮ Next we look at how to compute p th roots ...

  19. The structure of a p th power in characteristic p ◮ Let p be the characteristic of F q i = 0 ψ i x i ∈ F q [ x ] ◮ Let g = � d ◮ By the multinomial theorem, we have � � p � � d ψ j 0 0 ψ j 1 1 · · · ψ j d g p = k = 0 kj k d x j 0 , j 1 , . . . , j d 0 ≤ j 0 , j 1 ,..., j d ≤ p j 0 + j 1 + ... + j d = p p ! � p � ◮ Since p is prime, we have that p divides j 0 ! j 1 ! ··· j d ! unless there exists a = j 0 , j 1 ,..., j d � p � k = 0 , 1 , . . . , d with j k = p , in which case = 1 j 0 , j 1 ,..., j d ◮ Thus, we have d � ψ p g p = i x pi i = 0

  20. Computing a p th root of a p th power in characteristic p ◮ Let p be the characteristic of F q i = 0 ψ i x i ∈ F q [ x ] ◮ Let g = � d i = 0 ψ p ◮ From the previous slide, we have g p = � d i x pi i = 0 η i x pi as input and we want to compute a p th root of h ◮ Suppose we are given h = � d ◮ By Fermat’s litle theorem, for η = ψ p with ψ ∈ F q we have η q / p = ( ψ p ) q / p = ψ q = ψ ◮ Thus, we have h = g p for d � η q / p x i g = i i = 0 (exercise: how do you compute η q / p fast, given η ∈ F q together with q and p as input?)

  21. Example: Computing the squarefree part ◮ Let us compute the squarefree part of f = 2 + 2 x + x 2 + 2 x 4 + 2 x 5 + 2 x 6 + 2 x 8 + 2 x 9 + x 10 + x 11 + x 12 + x 13 ∈ F 3 [ x ] ◮ We have f ′ = 2 + 2 x + 2 x 3 + x 4 + x 7 + x 9 + 2 x 10 + x 12 ◮ And thus u = gcd ( f , f ′ ) = 2 + 2 x + 2 x 4 + x 6 v = f / u = 1 + 2 x 2 + x 3 + 2 x 4 + 2 x 5 + x 6 + x 7 w = 1 + x 3 ◮ Since w � 1 we proceed to take the p th root for p = 3, and obtain w 1 / 3 = 1 + x ◮ The squarefree part of w 1 / 3 is trivially 1 + x , so we obtain that ( 1 + x ) v = 1 + x + 2 x 2 + x 5 + 2 x 7 + x 8 is the squarefree part of f

Recommend


More recommend