Polynomial Factoring. Ramesh Hariharan



Similar documents
H/wk 13, Solutions to selected problems

CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

minimal polyonomial Example

calculating the result modulo 3, as follows: p(0) = = 1 0,

PROBLEM SET 6: POLYNOMIALS

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

The Division Algorithm for Polynomials Handout Monday March 5, 2012

Modern Algebra Lecture Notes: Rings and fields set 4 (Revision 2)

Factorization Algorithms for Polynomials over Finite Fields

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

THE FUNDAMENTAL THEOREM OF ALGEBRA VIA PROPER MAPS

Quotient Rings and Field Extensions

Some applications of LLL

Introduction to Finite Fields (cont.)

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

3 1. Note that all cubes solve it; therefore, there are no more

Factoring polynomials over finite fields

The van Hoeij Algorithm for Factoring Polynomials

Factoring of Prime Ideals in Extensions

it is easy to see that α = a

Die ganzen zahlen hat Gott gemacht

1 Lecture: Integration of rational functions by decomposition

2 Polynomials over a field

Factoring Trinomials: The ac Method

Unique Factorization

Applications of Fermat s Little Theorem and Congruences

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

MOP 2007 Black Group Integer Polynomials Yufei Zhao. Integer Polynomials. June 29, 2007 Yufei Zhao

GREATEST COMMON DIVISOR

9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

by the matrix A results in a vector which is a reflection of the given

Lagrange Interpolation is a method of fitting an equation to a set of points that functions well when there are few points given.

8 Primes and Modular Arithmetic

Factoring Polynomials

SOLVING POLYNOMIAL EQUATIONS

1.7. Partial Fractions Rational Functions and Partial Fractions. A rational function is a quotient of two polynomials: R(x) = P (x) Q(x).

Zeros of Polynomial Functions

Factoring Algorithms

1 Homework 1. [p 0 q i+j p i 1 q j+1 ] + [p i q j ] + [p i+1 q j p i+j q 0 ]

Factoring a Difference of Two Squares. Factoring a Difference of Two Squares

Theory of Matrices. Chapter 5

The Method of Partial Fractions Math 121 Calculus II Spring 2015

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

Equivalence of Polynomial Identity Testing and Deterministic Multivariate Polynomial Factorization

ON GALOIS REALIZATIONS OF THE 2-COVERABLE SYMMETRIC AND ALTERNATING GROUPS

Factoring Polynomials

MATH10040 Chapter 2: Prime and relatively prime numbers

Factoring Polynomials

Partial Fractions Examples

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Math 319 Problem Set #3 Solution 21 February 2002

JUST THE MATHS UNIT NUMBER 1.8. ALGEBRA 8 (Polynomials) A.J.Hobson

Partial Fractions. (x 1)(x 2 + 1)

1.3 Polynomials and Factoring

Algebra 3: algorithms in algebra

Basics of Polynomial Theory

Factorization Methods: Very Quick Overview

College Algebra - MAT 161 Page: 1 Copyright 2009 Killoran

RESULTANT AND DISCRIMINANT OF POLYNOMIALS

The cyclotomic polynomials

Integer Factorization using the Quadratic Sieve

r + s = i + j (q + t)n; 2 rs = ij (qj + ti)n + qtn.

MA107 Precalculus Algebra Exam 2 Review Solutions

Elementary factoring algorithms

Introduction to Algebraic Geometry. Bézout s Theorem and Inflection Points

7. Some irreducible polynomials

Integrals of Rational Functions

PROOFS BY DESCENT KEITH CONRAD

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

Finding Small Roots of Bivariate Integer Polynomial Equations Revisited

is identically equal to x 2 +3x +2

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

8 Divisibility and prime numbers

A number field is a field of finite degree over Q. By the Primitive Element Theorem, any number

Factoring Cubic Polynomials

POLYNOMIAL RINGS AND UNIQUE FACTORIZATION DOMAINS

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

The last three chapters introduced three major proof techniques: direct,

Section 6.1 Factoring Expressions

10 Splitting Fields. 2. The splitting field for x 3 2 over Q is Q( 3 2,ω), where ω is a primitive third root of 1 in C. Thus, since ω = 1+ 3

Arithmetic algorithms for cryptology 5 October 2015, Paris. Sieves. Razvan Barbulescu CNRS and IMJ-PRG. R. Barbulescu Sieves 0 / 28

Lecture 13 - Basic Number Theory.

Field Fundamentals. Chapter Field Extensions Definitions Lemma

A Tool Kit for Finding Small Roots of Bivariate Polynomials over the Integers

Factoring. Factoring 1

FACTORING SPARSE POLYNOMIALS

Factorization in Polynomial Rings

3.6. Partial Fractions. Introduction. Prerequisites. Learning Outcomes

Congruence properties of binary partition functions

Lecture 3: Finding integer solutions to systems of linear equations

3 Factorisation into irreducibles

Systems of Linear Equations

The finite field with 2 elements The simplest finite field is

Factoring Polynomials

Math Abstract Algebra I Questions for Section 23: Factoring Polynomials over a Field

Transcription:

Polynomial Factoring Ramesh Hariharan

The Problem Factoring Polynomials overs Integers Factorization is unique (why?) (x^2 + 5x +6) (x+2)(x+3) Time: Polynomial in degree

A Related Problem Factoring Integers 6 2 x 3 Time: No algorithm polynomial in log n is known If the polynomial is not monic (highest deg coeff=1) then polynomial factorization subsumes integer factorization; so assume that the polynomial is monic

Another Related Problem Factoring Polynomials mod prime p Factorization is unique (why?) (x^2 +1) (x+2)(x+3) mod 5 Time: Polynomial in degree

Yet Another Related Problem Factoring Polynomials in number fields Factorization is not unique (why?) In Q(sqrt(5)) 4 = 2.2 4= [3-sqrt(5)] x [3+sqrt(5)]

Factoring Polynomials To factor P(x) Find F(x) such that F(x) has known factorization P(x) divides F(x) but not any of its factors GCD of P(x) and one of the irreducible factors of F(x) gives a factor of P(x) in polynomial time If P(x) is irreducible then no such F(x) can exist

Factoring Polynomials mod p Berlekamp s Algorithm The required F(x) can be found in polynomial time!! Key Idea: x^p x = x (x-1) (x-2) (x-p+1) mod p f(x)^p f(x) = f(x) (f(x)-1) (f(x)-2) (f(x)-p+1) mod p So F(x)=f(x)^p f(x) has known factorization mod p by Fermat s theorem

Factoring Polynomials mod p Berlekamp s Algorithm Find f(x) such that P(x) divides f(x)^p f(x) hard P(x) does not divide f(x) i for all i in 0.. p-1 easy, keep degree of f(x) smaller than that of P(x)

Factoring Polynomials mod p Berlekamp s Algorithm Find f(x) such that n = deg(p(x)) > deg(f(x)) f(x)^p f(x) mod P(x) is 0

Factoring Polynomials mod p Berlekamp s Algorithm: Now comes the trick f(x) = a + bx + cx^2. f(x)^p = a + bx^p + c x^2p, i.e., no cross terms f(x)^p f (x) = a + bx^p + c x^2p - a + bx + cx^2., i.e. degree (n-1)p f(x)^p f(x) mod P(x) = a [1 mod P(x)] + b [x^p mod P(x)] + c [x^2p mod P(x)] - a + b x + c x^2. f(x)^p f(x) mod P(x) can be represented by a known n-1xn-1 matrix Q-I multiplying the unknown vector v=[a,b,c ], we solve vq=0 for v;

Factoring Polynomials mod p Matrix Formulation n-1 a b c n-1 x^0 mod P(x) ( ) x^p mod P(x) x^2p mod P(x) - I.. x^(n-1)p mod P(x)

Factoring Polynomials mod p Berlekamp s Algorithm: Timing Analysis Find Q: n remainder calculations, each poly in n and log p Solving v(q-i) takes poly in n Computing gcd of P(x) with each of f(x)-i takes p X poly in n can be tweaked to log p * poly in n This gives at least one factor, now recurse. So time is poly in n and p, improvable to log p

Factoring Polynomials mod p^2 Given the factorization of P(x) mod p, can we compute the factorization mod p^2 To begin with we have P(x) = A(x) B(x) mod p A,B are relatively prime mod p A,B are monic and therefore deg(p)=deg(a)+deg(b) Let P(x) = A(x)B(x) + p e(x) mod p^2, where deg(e)<deg(p)

Factoring Polynomials mod p^2 Find A,B such that P(x) = (A(x) + pa (x)) (B(x) + pb (x)) mod p^2 = A(x)B(x) + p ( A(x)B (x)+a (x)b(x) ) mod p^2 = P(x) + p ( A(x)B (x)+a (x)b(x) e(x) ) mod p^2 We want A(x)B (x) + B(x)A (x) = e(x) mod p

Factoring Polynomials mod p^2 To find A,B such that A(x)B (x) + B(x)A (x) = e(x) mod p Since A,B are rel. prime mod p, there exists s<b,t<a such that A(x)s(x)+B(x)t(x)=1 (mod p) Set B (x)=e(x)s(x) mod p, A (x)=e(x)t(x) mod p!! Problem: B+pB and A+pA need not be monic Fix: Make deg(b )<deg(b) B (x)= remainder r(x) of e(x)s(x) wrt B(x) mod p, e(x)s(x)=q(x)b(x)+r(x) mod p A (x)=e(x)t(x) + A(x)q(x) mod p

Factoring Polynomials mod p^2 We also need A+ pa, B+pB to be relatively prime mod p^2 to continue this process We want s <B, t <A such that (s+ps ) (A + pa ) + (t+pt ) (B + pb ) = 1 mod p^2 Let As+Bt=1+ p f mod p^2, we want 1+ pf + s pa +t pb + spa +tpb = 1 mod p^2 f + s A+t B+sA +tb = 0 mod p s A + t B = f mod p where f = - (f+sa +tb ) Set s = sf mod p, t =tf mod p Same problem as before so set s to remainder of sj wrt B mod p and adjust t accordingly

Factoring Polynomials mod p^2 Hensel Lifting Given A,B, finding s,t using GCD computation is polynomial in n and log p Finding A,B requires finding remainders wrt polynomials of degree n modulo p, so polynomial in n and log p Finding s,t is similar In general A factorization of P(x)=A(x)B(x) mod p with A,B relatively prime can be lifted to a factorization P(x)=A (x)b (x) mod p^k with A,B rel. prime in time poly in n, k, log p

Factoring Polynomials on Integers The Algorithm Find P(x)=A(x)B(x) mod p for some prime p~n Use Hensel lifting to lift so we have P(x) = A(x)B(x) mod p^k for some large enough k Then what? Somehow need to keep coefficients small to avoid wraparound. Needs another new idea.

Lattices Given a set of vectors the lattice generated by these vectors is the set of all integer linear combinations of these vectors

Polynomials and Lattices The set of all polynomials of degree at most 2m divisible by polynomial f(x)= sum a_i x^i, deg(f)<m can be represented as a lattice. n rows of this matrix generate the lattice in 2m dimensions. Multiplying by a row vector of length m (i.e., a polynomial of degree at most m) gives an element of the lattice, i.e., polynomial divisible by f and with degree at most 2m. 2m m

The Resultant Given a(x) of degree m and b(x) of degree n, how does one capture all polynomials which are obtained by taking s(x)a(x) + t(x)b(x), deg(s)<deg(b), deg(t)<deg(a) m+n * m+n matrix, premultiply with [s0 s1 sn t0 t1 tm] The determinant of this matrix is the resultant(a,b)

A Key Property Given a(x) of degree m and b(x) of degree n, if a(x) and b(x) are relatively prime then there exist s,t such that sa+tb = Resultant(a,b)!= 0 (why not 1? We re working on integers) Resultant < a ^n b ^m

Back to Factorization Start with P(x) of degree n. We have found monic, non-constant A(x) of degree <n which divides P(x) mod p^k Suppose we find a short polynomial B(x) of degree m<n in the lattice generated by A(x) mod p^k (so A divides B mod p^k) Short means that Resultant(P,B)< P ^m B ^n < p^k Then P,B must have a common non-trivial factor if not then there exist s,t such that sp+tb=resultant(p,b)!=0 Then sp+tb=resultant(p,b) mod p^k A divides Resultant(P,B) mod p^k Resultant(P,B)=0 mod p^k Resultant(P,B)=0 Contradiction GCD(P,B) gives a factor of P

How Short Must B be Short means that Resultant(P,B)< P ^m B ^n < p^k Suppose the entries in P are at most 2^n, then P ^n = 2^(n^2), we can choose p^k to be larger than this, time is poly in k and log p, so still ok. The problem is B ^n; entries in B can be as big as p^k. We need to keep the entries in B smaller than p^{k/n}. Indeed, B can be kept down to P 2^n, so B ^n becomes independent of p^k. Finding short vectors in lattices in polynomial time requires the LLL algorithm (another talk).

Thank You