Proof that Legendre symbol $Big(frac{a}{p}Big)$ is $a^{frac{p-1}{2}}$












1












$begingroup$


When $p$ is a prime, we know that Legendre symbol of $a$ is $$left(frac{a}{p}right) = a^{({p-1})/{2}}$$
Suppose $a$ is a square, then $a = x^2$ for some $x$. Therefore, $a^{frac{p-1}{2}} = x^{p-1} = 1$ by Fermat's little theorem. But if $a$ is not a square, then how to prove that $a^{frac{p-1}{2}} = -1$?










share|cite|improve this question











$endgroup$



migrated from crypto.stackexchange.com Dec 12 '18 at 19:03


This question came from our site for software developers, mathematicians and others interested in cryptography.














  • 2




    $begingroup$
    This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:49






  • 1




    $begingroup$
    In any case, you might find the Wikipedia page on Euler's criterion useful.
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:55










  • $begingroup$
    @IlmariKaronen That solves my question. Thank you!
    $endgroup$
    – satya
    Dec 12 '18 at 13:08
















1












$begingroup$


When $p$ is a prime, we know that Legendre symbol of $a$ is $$left(frac{a}{p}right) = a^{({p-1})/{2}}$$
Suppose $a$ is a square, then $a = x^2$ for some $x$. Therefore, $a^{frac{p-1}{2}} = x^{p-1} = 1$ by Fermat's little theorem. But if $a$ is not a square, then how to prove that $a^{frac{p-1}{2}} = -1$?










share|cite|improve this question











$endgroup$



migrated from crypto.stackexchange.com Dec 12 '18 at 19:03


This question came from our site for software developers, mathematicians and others interested in cryptography.














  • 2




    $begingroup$
    This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:49






  • 1




    $begingroup$
    In any case, you might find the Wikipedia page on Euler's criterion useful.
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:55










  • $begingroup$
    @IlmariKaronen That solves my question. Thank you!
    $endgroup$
    – satya
    Dec 12 '18 at 13:08














1












1








1





$begingroup$


When $p$ is a prime, we know that Legendre symbol of $a$ is $$left(frac{a}{p}right) = a^{({p-1})/{2}}$$
Suppose $a$ is a square, then $a = x^2$ for some $x$. Therefore, $a^{frac{p-1}{2}} = x^{p-1} = 1$ by Fermat's little theorem. But if $a$ is not a square, then how to prove that $a^{frac{p-1}{2}} = -1$?










share|cite|improve this question











$endgroup$




When $p$ is a prime, we know that Legendre symbol of $a$ is $$left(frac{a}{p}right) = a^{({p-1})/{2}}$$
Suppose $a$ is a square, then $a = x^2$ for some $x$. Therefore, $a^{frac{p-1}{2}} = x^{p-1} = 1$ by Fermat's little theorem. But if $a$ is not a square, then how to prove that $a^{frac{p-1}{2}} = -1$?







legendre-symbol






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 12 '18 at 19:13









Lorenzo B.

1,8402520




1,8402520










asked Dec 12 '18 at 12:16









satyasatya

857




857




migrated from crypto.stackexchange.com Dec 12 '18 at 19:03


This question came from our site for software developers, mathematicians and others interested in cryptography.









migrated from crypto.stackexchange.com Dec 12 '18 at 19:03


This question came from our site for software developers, mathematicians and others interested in cryptography.










  • 2




    $begingroup$
    This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:49






  • 1




    $begingroup$
    In any case, you might find the Wikipedia page on Euler's criterion useful.
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:55










  • $begingroup$
    @IlmariKaronen That solves my question. Thank you!
    $endgroup$
    – satya
    Dec 12 '18 at 13:08














  • 2




    $begingroup$
    This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:49






  • 1




    $begingroup$
    In any case, you might find the Wikipedia page on Euler's criterion useful.
    $endgroup$
    – Ilmari Karonen
    Dec 12 '18 at 12:55










  • $begingroup$
    @IlmariKaronen That solves my question. Thank you!
    $endgroup$
    – satya
    Dec 12 '18 at 13:08








2




2




$begingroup$
This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
$endgroup$
– Ilmari Karonen
Dec 12 '18 at 12:49




$begingroup$
This reads more like a question for Mathematics to me. Also, it's not clear to me exactly what it is that you're having difficulty proving: that $left( frac ap right) = a^{frac{p-1}2} bmod p$ (which is often taken as a definition anyway), that $a^{frac{p-1}2} bmod p in {-1, 0, 1}$, or that $a^{frac{p-1}2} notequiv 1 pmod p$ if $a$ is not a square modulo $p$?
$endgroup$
– Ilmari Karonen
Dec 12 '18 at 12:49




1




1




$begingroup$
In any case, you might find the Wikipedia page on Euler's criterion useful.
$endgroup$
– Ilmari Karonen
Dec 12 '18 at 12:55




$begingroup$
In any case, you might find the Wikipedia page on Euler's criterion useful.
$endgroup$
– Ilmari Karonen
Dec 12 '18 at 12:55












$begingroup$
@IlmariKaronen That solves my question. Thank you!
$endgroup$
– satya
Dec 12 '18 at 13:08




$begingroup$
@IlmariKaronen That solves my question. Thank you!
$endgroup$
– satya
Dec 12 '18 at 13:08










1 Answer
1






active

oldest

votes


















3












$begingroup$

First of all, there are two commonly used definitions of the Legendre symbol $left( frac ap right)$. One is simply that $$left( frac ap right) equiv a^tfrac{p-1}{2} pmod p$$ for any integer $a$ and any odd prime $p$. Of course, this congruence only defines $left( frac ap right)$ modulo $p$, but by convention (and for convenience) we normally choose the solution closest to zero.



The other definition is that $$
left( frac ap right) = begin{cases}
phantom+ 0 & text{if } a equiv 0 pmod p, \
phantom+ 1 & text{if } a notequiv 0 pmod p text{ and } a equiv b^2 pmod p text{ for some } b, text{ and} \
-1 & text{otherwise.}
end{cases}$$



By Euler's criterion, these two definitions are equivalent, which I assume is what you're trying to prove. The Wikipedia page I just linked to already gives a pretty good description of how to prove this, so let me just essentially recap it here:





The case when $a equiv 0 pmod p$ is trivial, since it's an elementary result of modular arithmetic that $a^n equiv 0^n equiv 0 pmod p$ for any positive exponent $n$ in this case.



By Fermat's little theorem, we know that $a^p equiv a pmod p$. If $a notequiv 0 pmod p$, then it directly follows that $a^{p-1} equiv 1 pmod p$. Rewriting this as $a^{p-1}-1 equiv 0 pmod p$ and factoring (using the fact that $p$ is odd by definition, and thus $p-1$ is even) gives $$left( a^frac{p-1}{2} + 1 right)left( a^frac{p-1}{2} - 1 right) equiv 0 pmod p.$$ Since the integers modulo a prime $p$ have no zero divisors, one of the factors on the left hand side must be congruent to zero for this congruence to hold, and thus $a^{(p-1) mathop/ 2} equiv pm1 pmod p$ for all $a notequiv 0 pmod p$. To complete the proof, all we need to do is figure out which case holds for each non-zero $a$.



If $a equiv b^2 pmod p$ for some integer $b$, then $a^{(p-1) mathop/ 2} equiv (b^2)^{(p-1) mathop/ 2} = b^{,p-1} equiv 1 pmod p,$ where the last congruence again follows from Fermat's little theorem. Thus, $a^{(p-1) mathop/ 2} equiv 1 pmod p$ for all quadratic residues $a$ modulo $p$.



Finally, to show that $a^{(p-1) mathop/ 2} equiv -1 pmod p$ for all quadratic non-residues, we can apply Lagrange's theorem to show that:





  • $a^{(p-1) mathop/ 2} equiv 1$ has at most $(p-1) mathop/ 2$ solutions modulo $p$, and


  • $b^2 equiv a$ can have at most two solutions modulo $p$ for each $a$.


Thus, since there are $p-1$ non-zero integers $b$ modulo $p$, then by the pigeonhole principle there must be at least $(p-1) mathop/ 2$ non-zero integers $a$ modulo $p$ for which $b^2 equiv a pmod p$ has a solution (and which thus are quadratic residues). Combining this with the earlier results above, we can see that there must be exactly $(p-1) mathop/ 2$ non-zero quadratic residues modulo $p$, and that those must be the only solutions to $a^{(p-1) mathop/ 2} equiv 1 pmod p$. Thus, for all other non-zero $a$, we must have $a^{(p-1) mathop/ 2} equiv -1 pmod p$, since we have already proved that those are the only possible options.






share|cite|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3037091%2fproof-that-legendre-symbol-big-fracap-big-is-a-fracp-12%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3












    $begingroup$

    First of all, there are two commonly used definitions of the Legendre symbol $left( frac ap right)$. One is simply that $$left( frac ap right) equiv a^tfrac{p-1}{2} pmod p$$ for any integer $a$ and any odd prime $p$. Of course, this congruence only defines $left( frac ap right)$ modulo $p$, but by convention (and for convenience) we normally choose the solution closest to zero.



    The other definition is that $$
    left( frac ap right) = begin{cases}
    phantom+ 0 & text{if } a equiv 0 pmod p, \
    phantom+ 1 & text{if } a notequiv 0 pmod p text{ and } a equiv b^2 pmod p text{ for some } b, text{ and} \
    -1 & text{otherwise.}
    end{cases}$$



    By Euler's criterion, these two definitions are equivalent, which I assume is what you're trying to prove. The Wikipedia page I just linked to already gives a pretty good description of how to prove this, so let me just essentially recap it here:





    The case when $a equiv 0 pmod p$ is trivial, since it's an elementary result of modular arithmetic that $a^n equiv 0^n equiv 0 pmod p$ for any positive exponent $n$ in this case.



    By Fermat's little theorem, we know that $a^p equiv a pmod p$. If $a notequiv 0 pmod p$, then it directly follows that $a^{p-1} equiv 1 pmod p$. Rewriting this as $a^{p-1}-1 equiv 0 pmod p$ and factoring (using the fact that $p$ is odd by definition, and thus $p-1$ is even) gives $$left( a^frac{p-1}{2} + 1 right)left( a^frac{p-1}{2} - 1 right) equiv 0 pmod p.$$ Since the integers modulo a prime $p$ have no zero divisors, one of the factors on the left hand side must be congruent to zero for this congruence to hold, and thus $a^{(p-1) mathop/ 2} equiv pm1 pmod p$ for all $a notequiv 0 pmod p$. To complete the proof, all we need to do is figure out which case holds for each non-zero $a$.



    If $a equiv b^2 pmod p$ for some integer $b$, then $a^{(p-1) mathop/ 2} equiv (b^2)^{(p-1) mathop/ 2} = b^{,p-1} equiv 1 pmod p,$ where the last congruence again follows from Fermat's little theorem. Thus, $a^{(p-1) mathop/ 2} equiv 1 pmod p$ for all quadratic residues $a$ modulo $p$.



    Finally, to show that $a^{(p-1) mathop/ 2} equiv -1 pmod p$ for all quadratic non-residues, we can apply Lagrange's theorem to show that:





    • $a^{(p-1) mathop/ 2} equiv 1$ has at most $(p-1) mathop/ 2$ solutions modulo $p$, and


    • $b^2 equiv a$ can have at most two solutions modulo $p$ for each $a$.


    Thus, since there are $p-1$ non-zero integers $b$ modulo $p$, then by the pigeonhole principle there must be at least $(p-1) mathop/ 2$ non-zero integers $a$ modulo $p$ for which $b^2 equiv a pmod p$ has a solution (and which thus are quadratic residues). Combining this with the earlier results above, we can see that there must be exactly $(p-1) mathop/ 2$ non-zero quadratic residues modulo $p$, and that those must be the only solutions to $a^{(p-1) mathop/ 2} equiv 1 pmod p$. Thus, for all other non-zero $a$, we must have $a^{(p-1) mathop/ 2} equiv -1 pmod p$, since we have already proved that those are the only possible options.






    share|cite|improve this answer









    $endgroup$


















      3












      $begingroup$

      First of all, there are two commonly used definitions of the Legendre symbol $left( frac ap right)$. One is simply that $$left( frac ap right) equiv a^tfrac{p-1}{2} pmod p$$ for any integer $a$ and any odd prime $p$. Of course, this congruence only defines $left( frac ap right)$ modulo $p$, but by convention (and for convenience) we normally choose the solution closest to zero.



      The other definition is that $$
      left( frac ap right) = begin{cases}
      phantom+ 0 & text{if } a equiv 0 pmod p, \
      phantom+ 1 & text{if } a notequiv 0 pmod p text{ and } a equiv b^2 pmod p text{ for some } b, text{ and} \
      -1 & text{otherwise.}
      end{cases}$$



      By Euler's criterion, these two definitions are equivalent, which I assume is what you're trying to prove. The Wikipedia page I just linked to already gives a pretty good description of how to prove this, so let me just essentially recap it here:





      The case when $a equiv 0 pmod p$ is trivial, since it's an elementary result of modular arithmetic that $a^n equiv 0^n equiv 0 pmod p$ for any positive exponent $n$ in this case.



      By Fermat's little theorem, we know that $a^p equiv a pmod p$. If $a notequiv 0 pmod p$, then it directly follows that $a^{p-1} equiv 1 pmod p$. Rewriting this as $a^{p-1}-1 equiv 0 pmod p$ and factoring (using the fact that $p$ is odd by definition, and thus $p-1$ is even) gives $$left( a^frac{p-1}{2} + 1 right)left( a^frac{p-1}{2} - 1 right) equiv 0 pmod p.$$ Since the integers modulo a prime $p$ have no zero divisors, one of the factors on the left hand side must be congruent to zero for this congruence to hold, and thus $a^{(p-1) mathop/ 2} equiv pm1 pmod p$ for all $a notequiv 0 pmod p$. To complete the proof, all we need to do is figure out which case holds for each non-zero $a$.



      If $a equiv b^2 pmod p$ for some integer $b$, then $a^{(p-1) mathop/ 2} equiv (b^2)^{(p-1) mathop/ 2} = b^{,p-1} equiv 1 pmod p,$ where the last congruence again follows from Fermat's little theorem. Thus, $a^{(p-1) mathop/ 2} equiv 1 pmod p$ for all quadratic residues $a$ modulo $p$.



      Finally, to show that $a^{(p-1) mathop/ 2} equiv -1 pmod p$ for all quadratic non-residues, we can apply Lagrange's theorem to show that:





      • $a^{(p-1) mathop/ 2} equiv 1$ has at most $(p-1) mathop/ 2$ solutions modulo $p$, and


      • $b^2 equiv a$ can have at most two solutions modulo $p$ for each $a$.


      Thus, since there are $p-1$ non-zero integers $b$ modulo $p$, then by the pigeonhole principle there must be at least $(p-1) mathop/ 2$ non-zero integers $a$ modulo $p$ for which $b^2 equiv a pmod p$ has a solution (and which thus are quadratic residues). Combining this with the earlier results above, we can see that there must be exactly $(p-1) mathop/ 2$ non-zero quadratic residues modulo $p$, and that those must be the only solutions to $a^{(p-1) mathop/ 2} equiv 1 pmod p$. Thus, for all other non-zero $a$, we must have $a^{(p-1) mathop/ 2} equiv -1 pmod p$, since we have already proved that those are the only possible options.






      share|cite|improve this answer









      $endgroup$
















        3












        3








        3





        $begingroup$

        First of all, there are two commonly used definitions of the Legendre symbol $left( frac ap right)$. One is simply that $$left( frac ap right) equiv a^tfrac{p-1}{2} pmod p$$ for any integer $a$ and any odd prime $p$. Of course, this congruence only defines $left( frac ap right)$ modulo $p$, but by convention (and for convenience) we normally choose the solution closest to zero.



        The other definition is that $$
        left( frac ap right) = begin{cases}
        phantom+ 0 & text{if } a equiv 0 pmod p, \
        phantom+ 1 & text{if } a notequiv 0 pmod p text{ and } a equiv b^2 pmod p text{ for some } b, text{ and} \
        -1 & text{otherwise.}
        end{cases}$$



        By Euler's criterion, these two definitions are equivalent, which I assume is what you're trying to prove. The Wikipedia page I just linked to already gives a pretty good description of how to prove this, so let me just essentially recap it here:





        The case when $a equiv 0 pmod p$ is trivial, since it's an elementary result of modular arithmetic that $a^n equiv 0^n equiv 0 pmod p$ for any positive exponent $n$ in this case.



        By Fermat's little theorem, we know that $a^p equiv a pmod p$. If $a notequiv 0 pmod p$, then it directly follows that $a^{p-1} equiv 1 pmod p$. Rewriting this as $a^{p-1}-1 equiv 0 pmod p$ and factoring (using the fact that $p$ is odd by definition, and thus $p-1$ is even) gives $$left( a^frac{p-1}{2} + 1 right)left( a^frac{p-1}{2} - 1 right) equiv 0 pmod p.$$ Since the integers modulo a prime $p$ have no zero divisors, one of the factors on the left hand side must be congruent to zero for this congruence to hold, and thus $a^{(p-1) mathop/ 2} equiv pm1 pmod p$ for all $a notequiv 0 pmod p$. To complete the proof, all we need to do is figure out which case holds for each non-zero $a$.



        If $a equiv b^2 pmod p$ for some integer $b$, then $a^{(p-1) mathop/ 2} equiv (b^2)^{(p-1) mathop/ 2} = b^{,p-1} equiv 1 pmod p,$ where the last congruence again follows from Fermat's little theorem. Thus, $a^{(p-1) mathop/ 2} equiv 1 pmod p$ for all quadratic residues $a$ modulo $p$.



        Finally, to show that $a^{(p-1) mathop/ 2} equiv -1 pmod p$ for all quadratic non-residues, we can apply Lagrange's theorem to show that:





        • $a^{(p-1) mathop/ 2} equiv 1$ has at most $(p-1) mathop/ 2$ solutions modulo $p$, and


        • $b^2 equiv a$ can have at most two solutions modulo $p$ for each $a$.


        Thus, since there are $p-1$ non-zero integers $b$ modulo $p$, then by the pigeonhole principle there must be at least $(p-1) mathop/ 2$ non-zero integers $a$ modulo $p$ for which $b^2 equiv a pmod p$ has a solution (and which thus are quadratic residues). Combining this with the earlier results above, we can see that there must be exactly $(p-1) mathop/ 2$ non-zero quadratic residues modulo $p$, and that those must be the only solutions to $a^{(p-1) mathop/ 2} equiv 1 pmod p$. Thus, for all other non-zero $a$, we must have $a^{(p-1) mathop/ 2} equiv -1 pmod p$, since we have already proved that those are the only possible options.






        share|cite|improve this answer









        $endgroup$



        First of all, there are two commonly used definitions of the Legendre symbol $left( frac ap right)$. One is simply that $$left( frac ap right) equiv a^tfrac{p-1}{2} pmod p$$ for any integer $a$ and any odd prime $p$. Of course, this congruence only defines $left( frac ap right)$ modulo $p$, but by convention (and for convenience) we normally choose the solution closest to zero.



        The other definition is that $$
        left( frac ap right) = begin{cases}
        phantom+ 0 & text{if } a equiv 0 pmod p, \
        phantom+ 1 & text{if } a notequiv 0 pmod p text{ and } a equiv b^2 pmod p text{ for some } b, text{ and} \
        -1 & text{otherwise.}
        end{cases}$$



        By Euler's criterion, these two definitions are equivalent, which I assume is what you're trying to prove. The Wikipedia page I just linked to already gives a pretty good description of how to prove this, so let me just essentially recap it here:





        The case when $a equiv 0 pmod p$ is trivial, since it's an elementary result of modular arithmetic that $a^n equiv 0^n equiv 0 pmod p$ for any positive exponent $n$ in this case.



        By Fermat's little theorem, we know that $a^p equiv a pmod p$. If $a notequiv 0 pmod p$, then it directly follows that $a^{p-1} equiv 1 pmod p$. Rewriting this as $a^{p-1}-1 equiv 0 pmod p$ and factoring (using the fact that $p$ is odd by definition, and thus $p-1$ is even) gives $$left( a^frac{p-1}{2} + 1 right)left( a^frac{p-1}{2} - 1 right) equiv 0 pmod p.$$ Since the integers modulo a prime $p$ have no zero divisors, one of the factors on the left hand side must be congruent to zero for this congruence to hold, and thus $a^{(p-1) mathop/ 2} equiv pm1 pmod p$ for all $a notequiv 0 pmod p$. To complete the proof, all we need to do is figure out which case holds for each non-zero $a$.



        If $a equiv b^2 pmod p$ for some integer $b$, then $a^{(p-1) mathop/ 2} equiv (b^2)^{(p-1) mathop/ 2} = b^{,p-1} equiv 1 pmod p,$ where the last congruence again follows from Fermat's little theorem. Thus, $a^{(p-1) mathop/ 2} equiv 1 pmod p$ for all quadratic residues $a$ modulo $p$.



        Finally, to show that $a^{(p-1) mathop/ 2} equiv -1 pmod p$ for all quadratic non-residues, we can apply Lagrange's theorem to show that:





        • $a^{(p-1) mathop/ 2} equiv 1$ has at most $(p-1) mathop/ 2$ solutions modulo $p$, and


        • $b^2 equiv a$ can have at most two solutions modulo $p$ for each $a$.


        Thus, since there are $p-1$ non-zero integers $b$ modulo $p$, then by the pigeonhole principle there must be at least $(p-1) mathop/ 2$ non-zero integers $a$ modulo $p$ for which $b^2 equiv a pmod p$ has a solution (and which thus are quadratic residues). Combining this with the earlier results above, we can see that there must be exactly $(p-1) mathop/ 2$ non-zero quadratic residues modulo $p$, and that those must be the only solutions to $a^{(p-1) mathop/ 2} equiv 1 pmod p$. Thus, for all other non-zero $a$, we must have $a^{(p-1) mathop/ 2} equiv -1 pmod p$, since we have already proved that those are the only possible options.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Dec 12 '18 at 14:48









        Ilmari KaronenIlmari Karonen

        19.8k25186




        19.8k25186






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3037091%2fproof-that-legendre-symbol-big-fracap-big-is-a-fracp-12%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Quarter-circle Tiles

            build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

            Mont Emei