Jacobi Symbol and Its Computation

Jacobi Symbol and Its Computation

Jacobi Symbol and its computation Barbarino Giovanni July 19, 2015 Abstract A short essay on the methods of computation of the Legendre and Jacobi-Kronecker Symbol 1 Contents 1 Legendre Symbol 3 2 Jacobi-Kronecker Symbol 8 2 1 Legendre Symbol One of the problem that aroused in algebra was to determine, taken p an odd prime, and 0 ≤ a < p an integer, if the equation x2 ≡ a (mod p) has any solution in Z=pZ and how many they are. Since the group Z=pZ is a field, from the Fundamental Theorem of Algebra we know that x2 − a = 0 has two solutions in an algebraic closure. Moreover, if b 2 (Z=pZ)∗ is a solution, then also −b is a solution, and b 6= −b since p is odd. From this observations, we deduce there are only three cases: 8 2 distinct solutions if 9b 6= 0 : b2 = a <> 1 solution if a = 0 > :no solutions if @b : b2 = a In the first case, we say that a is a quadratic residue modulus p, and in the last case we say that a is not a quadratic residue. If p = 2 we have x2 − a ≡ (x − a)2 (mod 2) so it’s easy to find solutions. We can now define the Legendre Symbol Definition 1. Given p an odd positive prime, and a an integer, we define the Legendre Symbol as 8 0 a ≡ 0 (mod p) a <> = 1 9 x : a ≡ x2 (mod p) p :>−1 otherwise We know that, if p is prime, there exists a generator g of the group (Z=pZ)∗. a It’s obvious that if a = g2n then a is a quadratic residue, so = 1. We can p also prove that this condition is necessary and sufficient: Lemma 1. The Legendre symbol can be computed as a ≡ a(p−1)=2 (mod p) p 3 Proof. We can always suppose 0 ≤ a ≤ p − 1. If a = 0, then it’s obvious. If g is the generator of (Z=pZ)∗, then a 6= 0 is a quadratic residue if and only if there exists x 6= 0 : x2 = a, so a = 1 () 9x 6= 0 : x2 = a () 9m :(gm)2 = g2m = a p since p − 1 is even, then it also means that a 6= 0 is not a quadratic residue if and only if is an odd power of g. We know that g(p−1)=2 = −1, since it’s a root of x2 − 1 and it’s different from 1. If a is a quadratical residue, then a = g2n =) a(p−1)=2 = gn(p−1) = 1 If a is not a quadratical residue, then a = g2n+1 =) a(p−1)=2 = gn(p−1)g(p−1)=2 = −1 This gives us a simple way of computing the Legendre Symbol: given a and p, we have if a = 0 then return 0 end if y = 1 , n = (p − 1)=2 while n 6= 0 do if n odd then y = y ∗ a (mod p) n = n − 1 else a = a ∗ a (mod p) n = n=2 end if end while return y This algorithm runs in O(log3(p)) due to the cost of the multiplications. We can do better, but we need some other property of the Legendre Symbol. First of all we can prove that it’s multiplicative on a: Lemma 2. The Legendre Symbol is multiplicative on a, that is ab ab = p p p 4 Proof. Using the result above, ab ab ≡ a(p−1)=2b(p−1)=2 ≡ (ab)(p−1)=2 ≡ (mod p) p p p The most important theorem on this symbol is called Legendre-Gauss quadratic reciprocity law, that is not so simple to prove as the precedent propositions: Theorem 2. Given p and q different old primes, and a 6= 0 (mod p), then 1. a = (−1)µ p where µ is the number of values in fa; 2a; 3a; : : : ; (p − 1)a=2g such that their residues modulus p are greater than p=2 2. If a = q, and p0 = (p − 1)=2, then p0 X kq ≡ µ (mod 2) p k=1 3. pq = (−1)(p−1)(q−1)=4 q p Proof. 1. the residues of fa; 2a; 3a; : : : ; (p−1)a=2g are all different among them, and we call them 0 0 0 r1; r2; : : : ; rλ − r1; −r2;:::; −rµ 0 λ + µ = (p − 1)=2; 0 < ri < p=2; 0 < ri < p=2 0 If ri = rj, then, modulus p, 0 ma = ri na = −rj =) ma + na = 0 =) m + n = 0 0 which is impossible. So ri and ri are a rearrangement of 1;:::; (p − 1)=2, and p − 1 p − 1 a(p−1)=2 ! ≡ a · 2a ····· (p − 1)a=2 ≡ (−1)µ ! 2 2 a ≡ a(p−1)=2 ≡ (−1)µ p 5 2. Given fq; 2q; 3q; : : : ; p0qg, we can write kq kq = p + u (1) p k 0 where 1 ≤ k ≤ p =) 0 < uk < p. We have, like above, that we can divide uk into 0 0 0 r1; r2; : : : ; rλ − r1; −r2;:::; −rµ 0 0 λ + µ = p ; 0 < ri < p=2; 0 < ri < p=2; 0 and we define wi = −ri + p that correspond to ui > p=2 . Let’s sum the equation (1) for all k until it reaches p0. The sum of numbers from 1 to p0 is (p2 − 1)=8, so p2 − 1 X kq X X kq X X q = p + u = p + r + w 8 p k p i i X X p2 − 1 X X p2 − 1 r + r0 = =) µp + r − w = i i 8 i i 8 p2 − 1 X kq X p2 − 1 =) q = p + 2 w + − µp 8 p i 8 p2 − 1 X kq X =) (q − 1) = p + 2 w − µp 8 p i but q − 1 is even, p2 − 1 is divisible by 8, and p is odd, so X kq ≡ µ (mod 2) p 3. Let’s call p0 = (p − 1)=2, and q0 = (q − 1)=2. If we call S(q; p) the quantity above, we have that pq = (−1)S(p;q)+S(q;p) q p The last step is to prove that S(p; q) + S(q; p) = p0q0. Let’s suppose p > q. Given a couple (a; b) with 0 < a; b, we have b=a < q=p () b < aq=p; b=a > p=q () a < bq=p If a ≤ p0, b ≤ q0, then aq=p and bp=q are not integer, so baq=pc is the number of couples (a; b) with b < aq=p, but it’s easy to verify that a ≤ p0 =) b ≤ q0 and the same for bbp=qc. The thesis follow. 6 Using this results, we can device another algorithm. In fact we can factorize a into primes, and apply the reciprocity law on each factor. This algorithm, though, have some big flaws: the factorization is slow, and we could end up with too many factors. In order to optimize this algorithm, we will introduce the Jacobi-Kronecker Symbol, but before that, we need a last result: Theorem 3. Given p an old prime, then 2 2 = (−1)(p −1)=8 p Proof. Let’s first suppose that p ≡ 1 (mod 4). Define S as the product of the even values between 1 and p − 1 modulus p. We can see they are exactly f2; 2 · 2; 3 · 2;:::; (p − 1)2=2g. We notice that, from (Theorem 2), µ = (p − 1)=4, and keeping in mind that (p + 1)=2 is odd, we obtain 2 (p+1)=2 2 = (−1)(p−1)=4 = (−1)(p−1)=4 = (−1)(p −1)=8 p The other case is p ≡ 3 (mod 4). Repeating the same argument, and noticing that µ = (p + 1)=4 and that (p − 1)=2 is odd, we obtain 2 (p−1)=2 2 = (−1)(p+1)=4 = (−1)(p+1)=4 = (−1)(p −1)=8 p 7 2 Jacobi-Kronecker Symbol Definition 4. Given a and b two integers, let’s define the Kronecker a Symbol as follows: b • If b = 0, then ( a 1 a = ±1 = 0 0 otherwise • If b = −1, then ( a 1 a ≥ 0 = −1 −1 a < 0 • If b = 2, then ( a 0 a even = 2 2 (−1)(a −1)=8 a odd • If not in one of the precedent options, we write b = Q p, where p are primes, not necessarily distinct, or p = −1. Then a Y a = b p This Symbol is well-defined thanks to the fact that the factorization in N is unique, so we have only to look out for b = −1. In fact, b = (−1)(−1)b, but a 2 = 1, so there’s no problem. More in general, if b is a perfect square −1 a different from zero, then = 1, so for every b not zero, we can substitute it b with his squarefree part. The main aim for this Symbol is to extend the Legendre Symbol so that it becomes multiplicative even in his lower part, and such that a more generalized reciprocity law holds. This new Symbol gains a lot of useful properties, such as Lemma 3. Given a, b and c integers, we have 1. a = 0 () (a; b) 6= 1 b 8 2. If c 6= −1, or ab 6= 0, ab ab = c c c 3. If a 6= −1, or bc 6= 0, a aa = bc b c Proof. 1. Obviously, if p is a prime, then a aa pj(a; b) =) = = 0 b p b0 a Conversely, suppose (a; b) = 1 and = 0.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    14 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us