Homepage Solution manuals Ivan Niven An Introduction to the Theory of Numbers Exercise 5.8.4 (Number of solutions of the congruence $x^2 + y^2\equiv 1 \pmod p$)

Exercise 5.8.4 (Number of solutions of the congruence $x^2 + y^2\equiv 1 \pmod p$)

Let p be a prime number, p > 2 , and suppose that x and y are integers such that x 2 + y 2 1 ( mod p ) , x 1 ( mod p ) . Let u be determined by the congruence ( 1 x ) u y ( mod p ) . Show that u 2 + 1 0 ( mod p ) , and that x ( u 2 1 ) v , y 2 uv ( mod p ) , where ( u 2 + 1 ) v 1 ( mod p ) .

Show, conversely, that if u is an integer such that u 2 + 1 0 ( mod p ) and if v , x , y are given in terms of u as above, then x 2 + y 2 1 ( mod p ) and x 1 ( mod p ) . Show that the number of u ( mod p ) that arise in this way is p 1 ( 1 p ) . Deduce that the number of solutions ( x , y ) of the congruence x 2 + y 2 1 ( mod p ) is p ( 1 p ) .

Answers

beginproof

(a)
We translate the problem in p . Let X , Y , U , V denote the classes of x , y , u , v in p . We write 0 , 1 , 2 , for the classes 0 ¯ , 1 ¯ , 2 ¯ , in p .

Suppose that X , Y in p satisfy X 2 + Y 2 = 1 and X 1 . Then 1 X is invertible. Put U = Y ( 1 X ) 1 , then

U 2 + 1 = Y ( 1 X ) 1 + 1 = ( 1 X ) 1 ( Y + 1 X ) .

Assume for the sake of contradiction that U 2 + 1 = 0 . Then X 0 , otherwise Y = ± 1 , thus U = Y ( 1 X ) 1 = ± 1 , and U 2 + 1 = 2 0 , because p 2 .

Since ( 1 X ) 1 0 , then Y = X 1 , therefore

1 = X 2 + Y 2 = X 2 + ( X 1 ) 2 = 2 X 2 2 X + 1 ,

so 0 = 2 X ( X 1 ) , which is impossible because X 0 , X 1 (and p 2 ). This shows that U 2 + 1 0 , so we may define

{ U = ( 1 X ) 1 Y , V = ( U 2 + 1 ) 1 . (1)

Then

U 2 + 1 = ( 1 X ) 2 Y 2 + 1 = ( 1 X ) 2 ( Y 2 + ( 1 X ) 2 ) = ( 1 X ) 2 ( X 2 + Y 2 2 X + 1 ) = 2 ( 1 X ) 2 ( 1 X ) ( since  X 2 + Y 2 = 1 ) = 2 ( 1 X ) 1 .

Therefore (1) becomes

{ U = ( 1 X ) 1 Y , V = 2 1 ( 1 X ) . (2)

This gives

2 U V = 2 ( 1 X ) 1 Y 2 1 ( 1 X ) = Y ,

and X = 1 2 V = ( U 2 1 ) V (because ( U 2 1 ) V + 2 V = ( U 2 + 1 ) V = 1 ), so

{ X = ( U 2 1 ) V , Y = 2 U V . (3)

In conclusion, for all ( X , Y ) ( p ) 2 , if X 2 + Y 2 = 1 , X 1 then there are ( U , V ) ( p ) 2 such that

( U 2 + 1 ) V = 1 ( so  U 2 + 1 0 ) { X = ( U 2 1 ) V , Y = 2 U V .
(b)
Conversely, suppose that there are ( U , V ) ( p ) 2 such that ( U 2 + 1 ) V = 1 { X = ( U 2 1 ) V , Y = 2 U V .

Then

X 2 + Y 2 = [ ( U 2 1 ) V ] 2 + 4 U 2 V 2 = [ ( U 2 + 1 ) V ] 2 = 1 ,

and X 1 , otherwise Y = 0 . Then 1 = ( U 2 1 ) V , thus V 0 , and 0 = 2 U V , therefore U = 0 , V = 1 . Then 1 = ( U 2 + 1 ) V = 1 . This gives the waited contradiction, because 1 1 in p where p 2 . In conclusion

X 2 + Y 2 = 1 , X 1 ( U , V ) ( p ) 2 , ( U 2 + 1 ) V = 1 and  { X = ( U 2 1 ) V , Y = 2 U V .
(c)
Consider the two curves in the plans p 2 : 𝒞 = { ( X , Y ) p 2 X 2 + Y 2 = 1 } , 𝒞 = { ( U , V ) p 2 ( U 2 + 1 ) V = 1 } ,

and let φ be the map defined by

φ { 𝒞 𝒞 { ( 1 , 0 ) } ( U , V ) ( ( U 2 1 ) V , 2 U V )

Then φ is well defined, because ( ( U 2 1 ) V , 2 U V ) 𝒞 { ( 1 , 0 ) } by part (b).

Moreover φ is surjective (onto) by part (a).

We show that φ is injective (one-to-one). Suppose that φ ( U , V ) = φ ( U , V ) , where ( U , V ) and ( U , V ) are points on 𝒞 . Put ( X , Y ) = φ ( U , V ) = φ ( U , V ) . Then X = ( U 2 1 ) V and Y = 2 U V . Therefore ( U 2 + 1 ) V = 1 and

( 1 X ) U = [ 1 ( U 2 1 ) V ] U = [ 1 + V U 2 V ] U = ( 1 + V + 1 V ) U ( because  ( U 2 + 1 ) V = 1 ) = 2 U V = Y .

Similarly ( 1 X ) U = Y thus ( 1 X ) U = ( 1 X ) U , where X 1 , thus U = U .

Therefore ( U 2 1 ) V = ( U 2 1 ) V and 2 U V = 2 U V . If U 0 , the second equation shows that V = V , and if U = 0 , the first equation shows also V = V . So ( U , V ) = ( U , V ) . This shows that φ is injective.

Since φ is bijective,

C a r d ( 𝒞 ) = C a r d ( 𝒞 { ( 1 , 0 ) } = C a r d ( 𝒞 ) 1 .

We compute directly C a r d ( 𝒞 ) .

  • If 1 p = 1 , then for all u p , u 2 + 1 0 , thus

    𝒞 = { ( u , ( u 2 + 1 ) 1 ) u p } ,

    thus | 𝒞 | = p , and

    | 𝒞 | = p + 1 .

  • Suppose now that 1 p = 1 . There are exactly two values u 0 , u 0 of u such that u 2 + 1 = 0 . If u { u 0 , u 0 } , there is no v such that 0 = ( u 2 + 1 ) v = 1 . If u { u 0 , u 0 } , u 2 + 1 0 , so there is exactly one v such that ( u 2 + 1 ) v = 1 :

    𝒞 = { ( u , ( u 2 + 1 ) 1 ) u p { u 0 , u 0 } } ,

    thus | 𝒞 | = p 2 , and

    | 𝒞 | = p 1 .

In either case,

| 𝒞 | = p 1 p .

The number of solutions of the congruence x 2 + y 2 1 ( m o d p ) is

N = p 1 p .

Note: For another proof with Gauss sums and Jacobi sums, see Ireland, Rosen p. 93, 94.

User profile picture
2025-06-30 15:37
Comments