0

I can understand that since $p$ is prime, it does not have factors (apart from $1$). Since, $(p-1)!$ does not contain any factor of $p$ or $p$ itself, $p$ cannot divide $(p-1)!$

But I am unable to write a formal proof of it. Help would be appreciated.

  • 1
    There are two common definitions of "prime numbers". One is the property you've referenced. The other is "$p>1$ is prime if and only if for every $a,b$, $p \mid ab$ implies $p \mid a$ or $p\mid b$." That one gives you a nice, simple proof. – Brian Moehring May 17 '23 at 05:34
  • If you prefer not to change your definition of a prime, you can refer to Brian Moehring's result above as Euclid's lemma. – Arthur May 17 '23 at 05:41
  • 1
    @Brian , I think the Euclid's lemma would be good to solve the problem ! Thanks ! – Pratyush Biswas May 17 '23 at 05:57
  • 1
    Wilson s Theorem. – Safal Das Biswas May 17 '23 at 06:03
  • 1
    To add on to that, there is a nice theorem called Wilson's Theorem that directly proves this result, and the theorem states that $(p-1)! \equiv -1 (mod p)$. – IamYammy May 17 '23 at 06:03
  • 1
    I'm sorry, @dxiv! I read the thing too fast, I guess; I don't know what I was thinking. It's very early in the morning here. – Shaun May 17 '23 at 06:54
  • 3
    I wish people were more mindful before casting all those down/close votes. The OP asked a clear and honest question, with all the context and own work they could show for it. Yes, some may deem it a naive question, but that's not a reason to dismiss it offhand on MSE last I checked. – dxiv May 17 '23 at 06:58
  • It's an immediate consequence of Euclid's Lemma: $p\mid 2\cdot 3\cdots p-1\Rightarrow p\mid 2,$ or $,p\mid 3,$ or $\ldots p\mid p-1,,$ which is false since $p\mid k>0\Rightarrow p\le k\ \ $ – Bill Dubuque May 19 '23 at 06:33

1 Answers1

3

It is known that for a prime number p, and a positive interger $i<p$, we have $gcd(i,p)=1$.

So $gcd(i,p)=1, i=1,2,...,p-1$.

Multiply them all, we have $gcd((p-1)!,p)∣gcd(1,p)⋅gcd(2,p)⋅⋅⋅gcd(p-1,p)$

So $gcd((p-1)!,p)=1$, and p is a prime number. Done!

(In fact, by Wilson's Theorem, we know that for a prime number n>1, ${\displaystyle (n-1)!\ \equiv \;-1{\pmod {n}}}$.)

Itoz Darbien
  • 466
  • 16
  • Thank you for your correction. Here is the link to Wilson's Theorem – Itoz Darbien May 17 '23 at 06:34
  • 4
    Note that "Multiply them all" carries the argument, but I'm not sure how exactly you're using it. It seems like you're either using "$p \nmid a$ and $p\nmid b$ implies $p\nmid ab$" (i.e. Euclid's lemma in disguise) or you're using "$\gcd(ab,c) \mid \gcd(a,c)\cdot\gcd(b,c)$" (coincidentally, I can't think of a proof of this at the moment that doesn't use the sledgehammer of the fundamental theorem of arithmetic). Can you clarify? – Brian Moehring May 17 '23 at 06:42
  • I think this question can help you. – Itoz Darbien May 17 '23 at 07:14
  • 1
    Ah, yes. I had actually written out that same expression and yet missed the conclusion. The tools then that underpin that are just the extended Euclidean algorithm. Also, I take it by your responding indirectly with that link that you were using the form given by $\gcd(ab,c) \mid \gcd(a,c)\cdot \gcd(b,c)$. – Brian Moehring May 17 '23 at 07:27
  • I see. I edited this step into my answer. – Itoz Darbien May 17 '23 at 07:33
  • @Itoz I couldn't understand the step where you're "multiplying them all" – Pratyush Biswas May 17 '23 at 10:03
  • This is because "gcd(ab,c)∣gcd(a,c)⋅gcd(b,c)", and we can use it repeatly. By the way, by using Euclid's lemma, we have "p∤a and p∤b implies p∤ab", we can also solve this problem. – Itoz Darbien May 18 '23 at 00:03
  • @Brian Integers coprime to $p$ are closed under product - seer the linked dupe. – Bill Dubuque May 19 '23 at 17:10
  • Please strive not to post more (dupe) answers to dupes of FAQs, cf. recent site policy announcement here. – Bill Dubuque May 19 '23 at 17:11
  • @Bill I'm well-aware of this theorem, but seeing a linked dupe tells me nothing about how someone else's argument goes. Perhaps you're also mostly responding to my parenthetical brain-fart in my first comment, but that should have been considered secondary to my point of clarification. – Brian Moehring May 19 '23 at 20:36