What is $gcd(0,0)$?











up vote
64
down vote

favorite
21












What is the greatest common divisor of $0$ and $0$?
On the one hand, Wolfram Alpha says that it is $0$;
on the other hand, it also claims that $100$ divides $0$,
so $100$ should be a greater common divisor of $0$ and $0$ than $0$.










share|cite|improve this question




















  • 3




    It is typically not defined.
    – copper.hat
    Sep 16 '13 at 4:58










  • Relevant: en.wikipedia.org/wiki/Partially_ordered_set
    – anon
    Sep 16 '13 at 5:23















up vote
64
down vote

favorite
21












What is the greatest common divisor of $0$ and $0$?
On the one hand, Wolfram Alpha says that it is $0$;
on the other hand, it also claims that $100$ divides $0$,
so $100$ should be a greater common divisor of $0$ and $0$ than $0$.










share|cite|improve this question




















  • 3




    It is typically not defined.
    – copper.hat
    Sep 16 '13 at 4:58










  • Relevant: en.wikipedia.org/wiki/Partially_ordered_set
    – anon
    Sep 16 '13 at 5:23













up vote
64
down vote

favorite
21









up vote
64
down vote

favorite
21






21





What is the greatest common divisor of $0$ and $0$?
On the one hand, Wolfram Alpha says that it is $0$;
on the other hand, it also claims that $100$ divides $0$,
so $100$ should be a greater common divisor of $0$ and $0$ than $0$.










share|cite|improve this question















What is the greatest common divisor of $0$ and $0$?
On the one hand, Wolfram Alpha says that it is $0$;
on the other hand, it also claims that $100$ divides $0$,
so $100$ should be a greater common divisor of $0$ and $0$ than $0$.







elementary-number-theory discrete-mathematics divisibility greatest-common-divisor






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Oct 18 '15 at 8:12









Martin Sleziak

44.3k7115266




44.3k7115266










asked Sep 16 '13 at 4:53









Konstantin Weitz

5102510




5102510








  • 3




    It is typically not defined.
    – copper.hat
    Sep 16 '13 at 4:58










  • Relevant: en.wikipedia.org/wiki/Partially_ordered_set
    – anon
    Sep 16 '13 at 5:23














  • 3




    It is typically not defined.
    – copper.hat
    Sep 16 '13 at 4:58










  • Relevant: en.wikipedia.org/wiki/Partially_ordered_set
    – anon
    Sep 16 '13 at 5:23








3




3




It is typically not defined.
– copper.hat
Sep 16 '13 at 4:58




It is typically not defined.
– copper.hat
Sep 16 '13 at 4:58












Relevant: en.wikipedia.org/wiki/Partially_ordered_set
– anon
Sep 16 '13 at 5:23




Relevant: en.wikipedia.org/wiki/Partially_ordered_set
– anon
Sep 16 '13 at 5:23










8 Answers
8






active

oldest

votes

















up vote
99
down vote



accepted










The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.



Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $gcd(0,0)=0$.






share|cite|improve this answer



















  • 7




    Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
    – anon
    Sep 16 '13 at 5:22






  • 18




    Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
    – Konstantin Weitz
    Sep 16 '13 at 6:55






  • 5




    For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
    – John Gowers
    Sep 16 '13 at 11:55








  • 2




    Euclid, I mean....
    – John Gowers
    Sep 16 '13 at 14:50






  • 2




    @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
    – BarbaraKwarc
    Mar 20 '17 at 6:26


















up vote
29
down vote













I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."



The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).






share|cite|improve this answer























  • You lost the race to William.
    – dfeuer
    Sep 16 '13 at 5:05










  • we all lost to him :)
    – DanielY
    Sep 16 '13 at 5:06






  • 4




    @dfeuer Well, I had answered the question already at MO. I wasn't racing.
    – user43208
    Sep 16 '13 at 5:06






  • 8




    Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
    – Jordan Gray
    Sep 16 '13 at 11:00


















up vote
9
down vote













Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $langle a, b rangle$. So in this case, $langle 0 ,0 rangle$ is just the $0$ ideal so the gcd is $0$.






share|cite|improve this answer




























    up vote
    8
    down vote













    Simply said - this depends on your definition.



    Clearly, if $d=gcd(a,b)$, you require $dmid a$, $dmid b$, i.e., it is a common divisor.



    But there are two possibilities how to express that it is greatest common divisor.



    One of them is to require
    $$cmid a land c mid b Rightarrow cle d$$
    and the other one is
    $$cmid a land c mid b Rightarrow cmid d.$$



    Clearly, if you use the first definition, $gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(mathbb N,mid)$.)



    As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)



    I would say that for students not knowing that $mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.






    share|cite|improve this answer























    • This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
      – rampion
      Apr 8 '15 at 0:46










    • What's an ideal, in simple terms?
      – BarbaraKwarc
      Mar 20 '17 at 8:30










    • @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
      – Martin Sleziak
      Mar 20 '17 at 9:01










    • @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
      – BarbaraKwarc
      Mar 20 '17 at 9:08












    • I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
      – Martin Sleziak
      Mar 20 '17 at 9:15




















    up vote
    5
    down vote













    Defining $gcd(a,b)$ for $defZ{mathbf Z}a,binZ$, to be the non-negative generator of the ideal $aZ+bZ$ gives $gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $deflcm{operatorname{lcm}}lcm(a,b)$ to be the non-negative generator of the ideal $aZcap bZ$, which gives $lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).



    Adding these cases to the usual definitions of the $gcd$ and $lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $gcd(xy,xz)=|x|gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $gcd(0,0)=0$.



    On the other hand, I don't think it is absolutely vital for mathematics to have $gcd(0,0)$ defined, in the same way as $0+0$, $0times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$xneq0$" if one wants to leave $gcd(0,0)$ undefined; other rules like $gcd(a,b)=gcd(a,a-b)$ do not seem to equate $gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.






    share|cite|improve this answer






























      up vote
      3
      down vote













      In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $cin R$ satisfying:




      • $c$ divides both $a$ and $b$, that is, there are $x,yin R$ such that $a=cx$ and $b=cy$.

      • If $din R$ divides both $a$ and $b$, then $d$ divides $c$.


      We write $c=gcd(a,b)$ in this case. The definition implies that if $c,c^prime=gcd(a,b)$, then $c$ and $c^prime$ are associates, that is $c=uc^prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^prime$ are the same. Therefore a non-ambiguous definition is as follows:



      "$gcd(a,b)$ is $ $ any minimal$ $ the minimum element in the family $mathcal F={Rd: Rdsupseteq Ra+Rb}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."



      Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $gcd$ of $0$ and $0$.



      In general you cannot guarantee that $gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).






      share|cite|improve this answer























      • Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
        – dfeuer
        Sep 16 '13 at 5:11










      • I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
        – dfeuer
        Sep 16 '13 at 5:11










      • @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
        – Matemáticos Chibchas
        Sep 16 '13 at 5:12












      • Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
        – dfeuer
        Sep 16 '13 at 5:16








      • 4




        anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
        – Hammerite
        Sep 16 '13 at 9:21


















      up vote
      3
      down vote













      If we take Euclid's algorithm:



      $text{gcd}(a, b) = left{
      begin{array}{l l}
      a & quad text{if $b = 0$}\
      text{gcd($b$, $a$ mod $b$)} & quad text{otherwise}
      end{array} right.$



      as the definition of GCD, then $text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately. If $a = 0$, then we get $text{gcd}(0, 0) = 0$.



      So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return. But it does fortunately coincide with William's “partial order of divisibility” explanation.






      share|cite|improve this answer




























        up vote
        2
        down vote













        From Wikipedia:




        The greatest common divisor of $a$ and $b$ is well-defined, except for the
        case $a=b=0$, when every natural number divides them.







        share|cite|improve this answer



















        • 3




          Well, this isn't really the right answer, is it? William got it right.
          – user43208
          Sep 16 '13 at 5:22






        • 1




          All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
          – user43208
          Sep 16 '13 at 5:32










        • The guy got his answer, that's the most important :)
          – DanielY
          Sep 16 '13 at 5:33











        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',
        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%2f495119%2fwhat-is-gcd0-0%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        8 Answers
        8






        active

        oldest

        votes








        8 Answers
        8






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        99
        down vote



        accepted










        The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.



        Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $gcd(0,0)=0$.






        share|cite|improve this answer



















        • 7




          Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
          – anon
          Sep 16 '13 at 5:22






        • 18




          Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
          – Konstantin Weitz
          Sep 16 '13 at 6:55






        • 5




          For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
          – John Gowers
          Sep 16 '13 at 11:55








        • 2




          Euclid, I mean....
          – John Gowers
          Sep 16 '13 at 14:50






        • 2




          @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
          – BarbaraKwarc
          Mar 20 '17 at 6:26















        up vote
        99
        down vote



        accepted










        The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.



        Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $gcd(0,0)=0$.






        share|cite|improve this answer



















        • 7




          Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
          – anon
          Sep 16 '13 at 5:22






        • 18




          Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
          – Konstantin Weitz
          Sep 16 '13 at 6:55






        • 5




          For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
          – John Gowers
          Sep 16 '13 at 11:55








        • 2




          Euclid, I mean....
          – John Gowers
          Sep 16 '13 at 14:50






        • 2




          @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
          – BarbaraKwarc
          Mar 20 '17 at 6:26













        up vote
        99
        down vote



        accepted







        up vote
        99
        down vote



        accepted






        The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.



        Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $gcd(0,0)=0$.






        share|cite|improve this answer














        The word "greatest" in "Greatest Common Divisor" does not refer to being largest in the usual ordering of the natural numbers, but to being largest in the partial order of divisibility on the natural numbers, where we consider $a$ to be larger than $b$ only when $b$ divides evenly into $a$. Most of the time, these two orderings agree whenever the second is defined. However, while, under the usual order, $0$ is the smallest natural number, under the divisibility order, $0$ is the greatest natural number, because every number divides $0$.



        Therefore, since every natural number is a common divisor of $0$ and $0$, and $0$ is the greatest (in divisibility) of the natural numbers, $gcd(0,0)=0$.







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Sep 16 '13 at 5:14









        dfeuer

        7,63432458




        7,63432458










        answered Sep 16 '13 at 5:02









        William Ballinger

        2,9831122




        2,9831122








        • 7




          Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
          – anon
          Sep 16 '13 at 5:22






        • 18




          Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
          – Konstantin Weitz
          Sep 16 '13 at 6:55






        • 5




          For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
          – John Gowers
          Sep 16 '13 at 11:55








        • 2




          Euclid, I mean....
          – John Gowers
          Sep 16 '13 at 14:50






        • 2




          @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
          – BarbaraKwarc
          Mar 20 '17 at 6:26














        • 7




          Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
          – anon
          Sep 16 '13 at 5:22






        • 18




          Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
          – Konstantin Weitz
          Sep 16 '13 at 6:55






        • 5




          For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
          – John Gowers
          Sep 16 '13 at 11:55








        • 2




          Euclid, I mean....
          – John Gowers
          Sep 16 '13 at 14:50






        • 2




          @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
          – BarbaraKwarc
          Mar 20 '17 at 6:26








        7




        7




        Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
        – anon
        Sep 16 '13 at 5:22




        Similarly $gcd(0,n)=n$ for all $ninBbb N$ (including $n=0$).
        – anon
        Sep 16 '13 at 5:22




        18




        18




        Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
        – Konstantin Weitz
        Sep 16 '13 at 6:55




        Thanks, great answer! How did you figure this out? Where do mathematicians store such commonly agreed on, but not completely obvious definitions? When did people start defining gcd this way, I assume they didn't when Euclidean algorithm was invented 300BC?
        – Konstantin Weitz
        Sep 16 '13 at 6:55




        5




        5




        For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
        – John Gowers
        Sep 16 '13 at 11:55






        For the most part, the partial order of divisibility coincides with the usual ordering wherever it is defined. So if $le$ represents the usual ordering and $vert$ represents the partial order of divisibility, then $xvert yRightarrow xle y$, except if $y=0$. Moreover, if $x$ is a common divisor of two non-zero natural numbers $a$ and $b$, then $xlegcd(a,b)Rightarrow xvertgcd(a,b)$. So in most cases, you can define $gcd(a,b)$ to be the greatest common divisor of $a$ and $b$, where 'greatest' refers to the usual ordering. That's what Euler did (and left $gcd(0,0)$ undefined).
        – John Gowers
        Sep 16 '13 at 11:55






        2




        2




        Euclid, I mean....
        – John Gowers
        Sep 16 '13 at 14:50




        Euclid, I mean....
        – John Gowers
        Sep 16 '13 at 14:50




        2




        2




        @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
        – BarbaraKwarc
        Mar 20 '17 at 6:26




        @KonstantinWeitz I wish such an Official Book of All Mathematical Definitions existed. It would end every dispute, because one could simply refer to that book and consult the definition and case closed. But guess what: I asked many mathematicians and none could point out any such book :P I'm starting to believe that they're all making things up :P They seem to be able to pull any definition they please up their butt and claim that "because Mathematics says so, so shut up and calculate" ;q Once I was looking for a definition of an angle, and I found over 9 of them, all of them different :P
        – BarbaraKwarc
        Mar 20 '17 at 6:26










        up vote
        29
        down vote













        I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."



        The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).






        share|cite|improve this answer























        • You lost the race to William.
          – dfeuer
          Sep 16 '13 at 5:05










        • we all lost to him :)
          – DanielY
          Sep 16 '13 at 5:06






        • 4




          @dfeuer Well, I had answered the question already at MO. I wasn't racing.
          – user43208
          Sep 16 '13 at 5:06






        • 8




          Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
          – Jordan Gray
          Sep 16 '13 at 11:00















        up vote
        29
        down vote













        I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."



        The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).






        share|cite|improve this answer























        • You lost the race to William.
          – dfeuer
          Sep 16 '13 at 5:05










        • we all lost to him :)
          – DanielY
          Sep 16 '13 at 5:06






        • 4




          @dfeuer Well, I had answered the question already at MO. I wasn't racing.
          – user43208
          Sep 16 '13 at 5:06






        • 8




          Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
          – Jordan Gray
          Sep 16 '13 at 11:00













        up vote
        29
        down vote










        up vote
        29
        down vote









        I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."



        The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).






        share|cite|improve this answer














        I answered this already in a comment at MO: "The best way to think about this is that the "gcd" of two natural numbers is the meet of them in the lattice of natural numbers ordered by divisibility. Note that $0$ is the top element in the divisibility order. The meet of the top element with itself is itself. So $0 = gcd(0, 0)$ is the answer. 'Greatest' is an unfortunate misnomer in this case."



        The book Mathematics Made Difficult has a nice little section on this. It should perhaps better be called "highest common factor" (hcf).







        share|cite|improve this answer














        share|cite|improve this answer



        share|cite|improve this answer








        edited Sep 16 '13 at 14:20









        Martin Sleziak

        44.3k7115266




        44.3k7115266










        answered Sep 16 '13 at 5:04









        user43208

        5,9081832




        5,9081832












        • You lost the race to William.
          – dfeuer
          Sep 16 '13 at 5:05










        • we all lost to him :)
          – DanielY
          Sep 16 '13 at 5:06






        • 4




          @dfeuer Well, I had answered the question already at MO. I wasn't racing.
          – user43208
          Sep 16 '13 at 5:06






        • 8




          Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
          – Jordan Gray
          Sep 16 '13 at 11:00


















        • You lost the race to William.
          – dfeuer
          Sep 16 '13 at 5:05










        • we all lost to him :)
          – DanielY
          Sep 16 '13 at 5:06






        • 4




          @dfeuer Well, I had answered the question already at MO. I wasn't racing.
          – user43208
          Sep 16 '13 at 5:06






        • 8




          Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
          – Jordan Gray
          Sep 16 '13 at 11:00
















        You lost the race to William.
        – dfeuer
        Sep 16 '13 at 5:05




        You lost the race to William.
        – dfeuer
        Sep 16 '13 at 5:05












        we all lost to him :)
        – DanielY
        Sep 16 '13 at 5:06




        we all lost to him :)
        – DanielY
        Sep 16 '13 at 5:06




        4




        4




        @dfeuer Well, I had answered the question already at MO. I wasn't racing.
        – user43208
        Sep 16 '13 at 5:06




        @dfeuer Well, I had answered the question already at MO. I wasn't racing.
        – user43208
        Sep 16 '13 at 5:06




        8




        8




        Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
        – Jordan Gray
        Sep 16 '13 at 11:00




        Win or lose, "the meet of [two numbers] in the lattice of natural numbers ordered by divisibility" is a definition of delightful pithiness.
        – Jordan Gray
        Sep 16 '13 at 11:00










        up vote
        9
        down vote













        Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $langle a, b rangle$. So in this case, $langle 0 ,0 rangle$ is just the $0$ ideal so the gcd is $0$.






        share|cite|improve this answer

























          up vote
          9
          down vote













          Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $langle a, b rangle$. So in this case, $langle 0 ,0 rangle$ is just the $0$ ideal so the gcd is $0$.






          share|cite|improve this answer























            up vote
            9
            down vote










            up vote
            9
            down vote









            Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $langle a, b rangle$. So in this case, $langle 0 ,0 rangle$ is just the $0$ ideal so the gcd is $0$.






            share|cite|improve this answer












            Another way to think about this is ideals. The gcd of two natural numbers $a, b$ is the unique non-negative natural number that generates the ideal $langle a, b rangle$. So in this case, $langle 0 ,0 rangle$ is just the $0$ ideal so the gcd is $0$.







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Sep 16 '13 at 14:24









            Alexander

            2,9141028




            2,9141028






















                up vote
                8
                down vote













                Simply said - this depends on your definition.



                Clearly, if $d=gcd(a,b)$, you require $dmid a$, $dmid b$, i.e., it is a common divisor.



                But there are two possibilities how to express that it is greatest common divisor.



                One of them is to require
                $$cmid a land c mid b Rightarrow cle d$$
                and the other one is
                $$cmid a land c mid b Rightarrow cmid d.$$



                Clearly, if you use the first definition, $gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(mathbb N,mid)$.)



                As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)



                I would say that for students not knowing that $mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.






                share|cite|improve this answer























                • This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                  – rampion
                  Apr 8 '15 at 0:46










                • What's an ideal, in simple terms?
                  – BarbaraKwarc
                  Mar 20 '17 at 8:30










                • @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                  – Martin Sleziak
                  Mar 20 '17 at 9:01










                • @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                  – BarbaraKwarc
                  Mar 20 '17 at 9:08












                • I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                  – Martin Sleziak
                  Mar 20 '17 at 9:15

















                up vote
                8
                down vote













                Simply said - this depends on your definition.



                Clearly, if $d=gcd(a,b)$, you require $dmid a$, $dmid b$, i.e., it is a common divisor.



                But there are two possibilities how to express that it is greatest common divisor.



                One of them is to require
                $$cmid a land c mid b Rightarrow cle d$$
                and the other one is
                $$cmid a land c mid b Rightarrow cmid d.$$



                Clearly, if you use the first definition, $gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(mathbb N,mid)$.)



                As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)



                I would say that for students not knowing that $mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.






                share|cite|improve this answer























                • This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                  – rampion
                  Apr 8 '15 at 0:46










                • What's an ideal, in simple terms?
                  – BarbaraKwarc
                  Mar 20 '17 at 8:30










                • @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                  – Martin Sleziak
                  Mar 20 '17 at 9:01










                • @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                  – BarbaraKwarc
                  Mar 20 '17 at 9:08












                • I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                  – Martin Sleziak
                  Mar 20 '17 at 9:15















                up vote
                8
                down vote










                up vote
                8
                down vote









                Simply said - this depends on your definition.



                Clearly, if $d=gcd(a,b)$, you require $dmid a$, $dmid b$, i.e., it is a common divisor.



                But there are two possibilities how to express that it is greatest common divisor.



                One of them is to require
                $$cmid a land c mid b Rightarrow cle d$$
                and the other one is
                $$cmid a land c mid b Rightarrow cmid d.$$



                Clearly, if you use the first definition, $gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(mathbb N,mid)$.)



                As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)



                I would say that for students not knowing that $mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.






                share|cite|improve this answer














                Simply said - this depends on your definition.



                Clearly, if $d=gcd(a,b)$, you require $dmid a$, $dmid b$, i.e., it is a common divisor.



                But there are two possibilities how to express that it is greatest common divisor.



                One of them is to require
                $$cmid a land c mid b Rightarrow cle d$$
                and the other one is
                $$cmid a land c mid b Rightarrow cmid d.$$



                Clearly, if you use the first definition, $gcd(0,0)$ would be the largest integer, so it does not exists. If you use the second one, you get $gcd(0,0)=0$. (Notice that $0$ is the largest element of the partially ordered set $(mathbb N,mid)$.)



                As far as I can say, the first definition appears in some text which are "for beginners"; for example here. (It was one of the first results from Google Books when searching for "gcd(0,0)".)



                I would say that for students not knowing that $mid$ is in fact a partial order, the first definition might feel more natural. But once you want to use this in connection with more advanced stuff (for example, g.c.d. as generator of an ideal generated by $a$ and $b$), then the second definition is better.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited yesterday

























                answered Sep 16 '13 at 14:30









                Martin Sleziak

                44.3k7115266




                44.3k7115266












                • This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                  – rampion
                  Apr 8 '15 at 0:46










                • What's an ideal, in simple terms?
                  – BarbaraKwarc
                  Mar 20 '17 at 8:30










                • @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                  – Martin Sleziak
                  Mar 20 '17 at 9:01










                • @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                  – BarbaraKwarc
                  Mar 20 '17 at 9:08












                • I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                  – Martin Sleziak
                  Mar 20 '17 at 9:15




















                • This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                  – rampion
                  Apr 8 '15 at 0:46










                • What's an ideal, in simple terms?
                  – BarbaraKwarc
                  Mar 20 '17 at 8:30










                • @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                  – Martin Sleziak
                  Mar 20 '17 at 9:01










                • @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                  – BarbaraKwarc
                  Mar 20 '17 at 9:08












                • I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                  – Martin Sleziak
                  Mar 20 '17 at 9:15


















                This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                – rampion
                Apr 8 '15 at 0:46




                This helped. I still feel a little icky about (ℕ,∣) as a partial order, because 0∣0 feels weird to me, and this whole argument requires that reflexivity.
                – rampion
                Apr 8 '15 at 0:46












                What's an ideal, in simple terms?
                – BarbaraKwarc
                Mar 20 '17 at 8:30




                What's an ideal, in simple terms?
                – BarbaraKwarc
                Mar 20 '17 at 8:30












                @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                – Martin Sleziak
                Mar 20 '17 at 9:01




                @BarbaraKwarc You can have a look at Wikipedia article. Or perhaps this question: Intuition behind “ideal”.
                – Martin Sleziak
                Mar 20 '17 at 9:01












                @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                – BarbaraKwarc
                Mar 20 '17 at 9:08






                @MartinSleziak If one seeks for understanding of a new subject, Wikipedia is usually the worst place to go to :q And it turns out that it is the case this time as well. The more I read that article, the more confused I am :/
                – BarbaraKwarc
                Mar 20 '17 at 9:08














                I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                – Martin Sleziak
                Mar 20 '17 at 9:15






                I doubt that I would be able to give some explanation in the few characters allowed in a comment. If you wish, you can try to ask in chat (the main chat room or abstract algebra chat room seem to be reasonable for this). And I am not sure to which extent the notion of ideal can be useful for you, unless you plan to learn more about rings.
                – Martin Sleziak
                Mar 20 '17 at 9:15












                up vote
                5
                down vote













                Defining $gcd(a,b)$ for $defZ{mathbf Z}a,binZ$, to be the non-negative generator of the ideal $aZ+bZ$ gives $gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $deflcm{operatorname{lcm}}lcm(a,b)$ to be the non-negative generator of the ideal $aZcap bZ$, which gives $lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).



                Adding these cases to the usual definitions of the $gcd$ and $lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $gcd(xy,xz)=|x|gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $gcd(0,0)=0$.



                On the other hand, I don't think it is absolutely vital for mathematics to have $gcd(0,0)$ defined, in the same way as $0+0$, $0times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$xneq0$" if one wants to leave $gcd(0,0)$ undefined; other rules like $gcd(a,b)=gcd(a,a-b)$ do not seem to equate $gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.






                share|cite|improve this answer



























                  up vote
                  5
                  down vote













                  Defining $gcd(a,b)$ for $defZ{mathbf Z}a,binZ$, to be the non-negative generator of the ideal $aZ+bZ$ gives $gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $deflcm{operatorname{lcm}}lcm(a,b)$ to be the non-negative generator of the ideal $aZcap bZ$, which gives $lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).



                  Adding these cases to the usual definitions of the $gcd$ and $lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $gcd(xy,xz)=|x|gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $gcd(0,0)=0$.



                  On the other hand, I don't think it is absolutely vital for mathematics to have $gcd(0,0)$ defined, in the same way as $0+0$, $0times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$xneq0$" if one wants to leave $gcd(0,0)$ undefined; other rules like $gcd(a,b)=gcd(a,a-b)$ do not seem to equate $gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.






                  share|cite|improve this answer

























                    up vote
                    5
                    down vote










                    up vote
                    5
                    down vote









                    Defining $gcd(a,b)$ for $defZ{mathbf Z}a,binZ$, to be the non-negative generator of the ideal $aZ+bZ$ gives $gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $deflcm{operatorname{lcm}}lcm(a,b)$ to be the non-negative generator of the ideal $aZcap bZ$, which gives $lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).



                    Adding these cases to the usual definitions of the $gcd$ and $lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $gcd(xy,xz)=|x|gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $gcd(0,0)=0$.



                    On the other hand, I don't think it is absolutely vital for mathematics to have $gcd(0,0)$ defined, in the same way as $0+0$, $0times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$xneq0$" if one wants to leave $gcd(0,0)$ undefined; other rules like $gcd(a,b)=gcd(a,a-b)$ do not seem to equate $gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.






                    share|cite|improve this answer














                    Defining $gcd(a,b)$ for $defZ{mathbf Z}a,binZ$, to be the non-negative generator of the ideal $aZ+bZ$ gives $gcd(a,0)=|a|$ for all $a$, including for $a=0$. Similarly one can define $deflcm{operatorname{lcm}}lcm(a,b)$ to be the non-negative generator of the ideal $aZcap bZ$, which gives $lcm(a,0)=0$ for all$~a$ (note that since this is the only common multiple in this case, it is unlikely to provoke much discussion).



                    Adding these cases to the usual definitions of the $gcd$ and $lcm$ for nonzero integers causes no problems; all usual formulas remain valid. In fact, if one wants the rule $gcd(xy,xz)=|x|gcd(y,z)$ to hold for all integers $x,y,z$, one is forced to put $gcd(0,0)=0$.



                    On the other hand, I don't think it is absolutely vital for mathematics to have $gcd(0,0)$ defined, in the same way as $0+0$, $0times0$ and $0^0$ need to be defined (and $0/0$ needs to be undefined) in order for the usual rules of algebra that one uses all the time to be valid. I think it would suffice to qualify the rule I cited by "$xneq0$" if one wants to leave $gcd(0,0)$ undefined; other rules like $gcd(a,b)=gcd(a,a-b)$ do not seem to equate $gcd(0,0)$ with something else. The reason that leaving it undefined is not so dramatic is that when considering divisibility, $0$ is often excluded anyway; for instance it has to be put aside in the theorem of Unique Factorisation.







                    share|cite|improve this answer














                    share|cite|improve this answer



                    share|cite|improve this answer








                    edited Oct 13 '13 at 15:29

























                    answered Sep 16 '13 at 14:19









                    Marc van Leeuwen

                    85.8k5105215




                    85.8k5105215






















                        up vote
                        3
                        down vote













                        In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $cin R$ satisfying:




                        • $c$ divides both $a$ and $b$, that is, there are $x,yin R$ such that $a=cx$ and $b=cy$.

                        • If $din R$ divides both $a$ and $b$, then $d$ divides $c$.


                        We write $c=gcd(a,b)$ in this case. The definition implies that if $c,c^prime=gcd(a,b)$, then $c$ and $c^prime$ are associates, that is $c=uc^prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^prime$ are the same. Therefore a non-ambiguous definition is as follows:



                        "$gcd(a,b)$ is $ $ any minimal$ $ the minimum element in the family $mathcal F={Rd: Rdsupseteq Ra+Rb}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."



                        Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $gcd$ of $0$ and $0$.



                        In general you cannot guarantee that $gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).






                        share|cite|improve this answer























                        • Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                          – Matemáticos Chibchas
                          Sep 16 '13 at 5:12












                        • Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                          – dfeuer
                          Sep 16 '13 at 5:16








                        • 4




                          anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                          – Hammerite
                          Sep 16 '13 at 9:21















                        up vote
                        3
                        down vote













                        In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $cin R$ satisfying:




                        • $c$ divides both $a$ and $b$, that is, there are $x,yin R$ such that $a=cx$ and $b=cy$.

                        • If $din R$ divides both $a$ and $b$, then $d$ divides $c$.


                        We write $c=gcd(a,b)$ in this case. The definition implies that if $c,c^prime=gcd(a,b)$, then $c$ and $c^prime$ are associates, that is $c=uc^prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^prime$ are the same. Therefore a non-ambiguous definition is as follows:



                        "$gcd(a,b)$ is $ $ any minimal$ $ the minimum element in the family $mathcal F={Rd: Rdsupseteq Ra+Rb}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."



                        Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $gcd$ of $0$ and $0$.



                        In general you cannot guarantee that $gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).






                        share|cite|improve this answer























                        • Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                          – Matemáticos Chibchas
                          Sep 16 '13 at 5:12












                        • Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                          – dfeuer
                          Sep 16 '13 at 5:16








                        • 4




                          anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                          – Hammerite
                          Sep 16 '13 at 9:21













                        up vote
                        3
                        down vote










                        up vote
                        3
                        down vote









                        In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $cin R$ satisfying:




                        • $c$ divides both $a$ and $b$, that is, there are $x,yin R$ such that $a=cx$ and $b=cy$.

                        • If $din R$ divides both $a$ and $b$, then $d$ divides $c$.


                        We write $c=gcd(a,b)$ in this case. The definition implies that if $c,c^prime=gcd(a,b)$, then $c$ and $c^prime$ are associates, that is $c=uc^prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^prime$ are the same. Therefore a non-ambiguous definition is as follows:



                        "$gcd(a,b)$ is $ $ any minimal$ $ the minimum element in the family $mathcal F={Rd: Rdsupseteq Ra+Rb}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."



                        Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $gcd$ of $0$ and $0$.



                        In general you cannot guarantee that $gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).






                        share|cite|improve this answer














                        In the general framework of integral domains (commutative rings with unity, without nontrivial zero-divisors), we define a greatest common divisor of two elements $a,b$ of an integral domain $R$ as any element $cin R$ satisfying:




                        • $c$ divides both $a$ and $b$, that is, there are $x,yin R$ such that $a=cx$ and $b=cy$.

                        • If $din R$ divides both $a$ and $b$, then $d$ divides $c$.


                        We write $c=gcd(a,b)$ in this case. The definition implies that if $c,c^prime=gcd(a,b)$, then $c$ and $c^prime$ are associates, that is $c=uc^prime$ for some invertible element $u$ in $R$. This is equivalent to say that the principal ideals generated by $c$ and $c^prime$ are the same. Therefore a non-ambiguous definition is as follows:



                        "$gcd(a,b)$ is $ $ any minimal$ $ the minimum element in the family $mathcal F={Rd: Rdsupseteq Ra+Rb}$ of principal ideals containing $a$ and $b$, ordered by inclusion, wherever such minimum ideal exists."



                        Since $R0+R0=R0$, we see that $R0=0$, the trivial ideal of $R$, is the $gcd$ of $0$ and $0$.



                        In general you cannot guarantee that $gcd$s exist. A sufficient condition is your integral domain $R$ to be a UFD (Unique Factorization Domain).







                        share|cite|improve this answer














                        share|cite|improve this answer



                        share|cite|improve this answer








                        edited Sep 16 '13 at 6:05

























                        answered Sep 16 '13 at 5:05









                        Matemáticos Chibchas

                        5,33622040




                        5,33622040












                        • Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                          – Matemáticos Chibchas
                          Sep 16 '13 at 5:12












                        • Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                          – dfeuer
                          Sep 16 '13 at 5:16








                        • 4




                          anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                          – Hammerite
                          Sep 16 '13 at 9:21


















                        • Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                          – dfeuer
                          Sep 16 '13 at 5:11










                        • @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                          – Matemáticos Chibchas
                          Sep 16 '13 at 5:12












                        • Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                          – dfeuer
                          Sep 16 '13 at 5:16








                        • 4




                          anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                          – Hammerite
                          Sep 16 '13 at 9:21
















                        Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                        – dfeuer
                        Sep 16 '13 at 5:11




                        Use gcd instead of $GCD$. Also, ^prime can be abbreviated all the way down to '.
                        – dfeuer
                        Sep 16 '13 at 5:11












                        I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                        – dfeuer
                        Sep 16 '13 at 5:11




                        I've tried editing it myself, but you've interrupted me twice, so I'll let you do it.
                        – dfeuer
                        Sep 16 '13 at 5:11












                        @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                        – Matemáticos Chibchas
                        Sep 16 '13 at 5:12






                        @dfeuer Thanks for the suggestion. By the way, that ' shortcut works in ordinary $LaTeX$?
                        – Matemáticos Chibchas
                        Sep 16 '13 at 5:12














                        Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                        – dfeuer
                        Sep 16 '13 at 5:16






                        Yep! It even works in Plain $TeX$! $x'''$ just takes four keystrokes (six if you count dollar signs).
                        – dfeuer
                        Sep 16 '13 at 5:16






                        4




                        4




                        anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                        – Hammerite
                        Sep 16 '13 at 9:21




                        anon- Not on my keyboard. On my keyboard, backtick is the key to the left of 1, and tilde is obtained by holding shift and pressing the hash key (which is next to Enter). In general, the location of punctuation characters varies in keyboards used in different countries.
                        – Hammerite
                        Sep 16 '13 at 9:21










                        up vote
                        3
                        down vote













                        If we take Euclid's algorithm:



                        $text{gcd}(a, b) = left{
                        begin{array}{l l}
                        a & quad text{if $b = 0$}\
                        text{gcd($b$, $a$ mod $b$)} & quad text{otherwise}
                        end{array} right.$



                        as the definition of GCD, then $text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately. If $a = 0$, then we get $text{gcd}(0, 0) = 0$.



                        So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return. But it does fortunately coincide with William's “partial order of divisibility” explanation.






                        share|cite|improve this answer

























                          up vote
                          3
                          down vote













                          If we take Euclid's algorithm:



                          $text{gcd}(a, b) = left{
                          begin{array}{l l}
                          a & quad text{if $b = 0$}\
                          text{gcd($b$, $a$ mod $b$)} & quad text{otherwise}
                          end{array} right.$



                          as the definition of GCD, then $text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately. If $a = 0$, then we get $text{gcd}(0, 0) = 0$.



                          So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return. But it does fortunately coincide with William's “partial order of divisibility” explanation.






                          share|cite|improve this answer























                            up vote
                            3
                            down vote










                            up vote
                            3
                            down vote









                            If we take Euclid's algorithm:



                            $text{gcd}(a, b) = left{
                            begin{array}{l l}
                            a & quad text{if $b = 0$}\
                            text{gcd($b$, $a$ mod $b$)} & quad text{otherwise}
                            end{array} right.$



                            as the definition of GCD, then $text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately. If $a = 0$, then we get $text{gcd}(0, 0) = 0$.



                            So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return. But it does fortunately coincide with William's “partial order of divisibility” explanation.






                            share|cite|improve this answer












                            If we take Euclid's algorithm:



                            $text{gcd}(a, b) = left{
                            begin{array}{l l}
                            a & quad text{if $b = 0$}\
                            text{gcd($b$, $a$ mod $b$)} & quad text{otherwise}
                            end{array} right.$



                            as the definition of GCD, then $text{gcd}(a, 0) = 0$ for any $a$, because the stopping case of $b = 0$ is reached immediately. If $a = 0$, then we get $text{gcd}(0, 0) = 0$.



                            So, it's possible that Wolfram Alpha obtains its result as a side effect of using Euclid's algorithm rather than deliberate thought as to what gcd(0, 0) should return. But it does fortunately coincide with William's “partial order of divisibility” explanation.







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Sep 16 '13 at 13:12









                            Dan

                            4,11511416




                            4,11511416






















                                up vote
                                2
                                down vote













                                From Wikipedia:




                                The greatest common divisor of $a$ and $b$ is well-defined, except for the
                                case $a=b=0$, when every natural number divides them.







                                share|cite|improve this answer



















                                • 3




                                  Well, this isn't really the right answer, is it? William got it right.
                                  – user43208
                                  Sep 16 '13 at 5:22






                                • 1




                                  All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                  – user43208
                                  Sep 16 '13 at 5:32










                                • The guy got his answer, that's the most important :)
                                  – DanielY
                                  Sep 16 '13 at 5:33















                                up vote
                                2
                                down vote













                                From Wikipedia:




                                The greatest common divisor of $a$ and $b$ is well-defined, except for the
                                case $a=b=0$, when every natural number divides them.







                                share|cite|improve this answer



















                                • 3




                                  Well, this isn't really the right answer, is it? William got it right.
                                  – user43208
                                  Sep 16 '13 at 5:22






                                • 1




                                  All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                  – user43208
                                  Sep 16 '13 at 5:32










                                • The guy got his answer, that's the most important :)
                                  – DanielY
                                  Sep 16 '13 at 5:33













                                up vote
                                2
                                down vote










                                up vote
                                2
                                down vote









                                From Wikipedia:




                                The greatest common divisor of $a$ and $b$ is well-defined, except for the
                                case $a=b=0$, when every natural number divides them.







                                share|cite|improve this answer














                                From Wikipedia:




                                The greatest common divisor of $a$ and $b$ is well-defined, except for the
                                case $a=b=0$, when every natural number divides them.








                                share|cite|improve this answer














                                share|cite|improve this answer



                                share|cite|improve this answer








                                edited Sep 16 '13 at 14:14









                                Git Gud

                                28.6k104899




                                28.6k104899










                                answered Sep 16 '13 at 4:59









                                DanielY

                                868923




                                868923








                                • 3




                                  Well, this isn't really the right answer, is it? William got it right.
                                  – user43208
                                  Sep 16 '13 at 5:22






                                • 1




                                  All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                  – user43208
                                  Sep 16 '13 at 5:32










                                • The guy got his answer, that's the most important :)
                                  – DanielY
                                  Sep 16 '13 at 5:33














                                • 3




                                  Well, this isn't really the right answer, is it? William got it right.
                                  – user43208
                                  Sep 16 '13 at 5:22






                                • 1




                                  All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                  – user43208
                                  Sep 16 '13 at 5:32










                                • The guy got his answer, that's the most important :)
                                  – DanielY
                                  Sep 16 '13 at 5:33








                                3




                                3




                                Well, this isn't really the right answer, is it? William got it right.
                                – user43208
                                Sep 16 '13 at 5:22




                                Well, this isn't really the right answer, is it? William got it right.
                                – user43208
                                Sep 16 '13 at 5:22




                                1




                                1




                                All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                – user43208
                                Sep 16 '13 at 5:32




                                All I'm saying is that Wikipedia got it wrong in this case (or at least it's misleading to suggest that $gcd(0, 0)$ is not well-defined, because as has been clearly explained, it's perfectly well-defined and indeed it's $0$).
                                – user43208
                                Sep 16 '13 at 5:32












                                The guy got his answer, that's the most important :)
                                – DanielY
                                Sep 16 '13 at 5:33




                                The guy got his answer, that's the most important :)
                                – DanielY
                                Sep 16 '13 at 5:33


















                                 

                                draft saved


                                draft discarded



















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f495119%2fwhat-is-gcd0-0%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