Metamath Proof Explorer


Theorem lgsfcl

Description: Closure of the function F which defines the Legendre symbol at the primes. (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Hypothesis lgsval.1
|- F = ( n e. NN |-> if ( n e. Prime , ( if ( n = 2 , if ( 2 || A , 0 , if ( ( A mod 8 ) e. { 1 , 7 } , 1 , -u 1 ) ) , ( ( ( ( A ^ ( ( n - 1 ) / 2 ) ) + 1 ) mod n ) - 1 ) ) ^ ( n pCnt N ) ) , 1 ) )
Assertion lgsfcl
|- ( ( A e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> F : NN --> ZZ )

Proof

Step Hyp Ref Expression
1 lgsval.1
 |-  F = ( n e. NN |-> if ( n e. Prime , ( if ( n = 2 , if ( 2 || A , 0 , if ( ( A mod 8 ) e. { 1 , 7 } , 1 , -u 1 ) ) , ( ( ( ( A ^ ( ( n - 1 ) / 2 ) ) + 1 ) mod n ) - 1 ) ) ^ ( n pCnt N ) ) , 1 ) )
2 eqid
 |-  { x e. ZZ | ( abs ` x ) <_ 1 } = { x e. ZZ | ( abs ` x ) <_ 1 }
3 1 2 lgsfcl2
 |-  ( ( A e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> F : NN --> { x e. ZZ | ( abs ` x ) <_ 1 } )
4 ssrab2
 |-  { x e. ZZ | ( abs ` x ) <_ 1 } C_ ZZ
5 fss
 |-  ( ( F : NN --> { x e. ZZ | ( abs ` x ) <_ 1 } /\ { x e. ZZ | ( abs ` x ) <_ 1 } C_ ZZ ) -> F : NN --> ZZ )
6 3 4 5 sylancl
 |-  ( ( A e. ZZ /\ N e. ZZ /\ N =/= 0 ) -> F : NN --> ZZ )