Fermat Theorem Combinatorics Proof

Revision en42, by Ashwanth.K, 2024-08-14 07:15:35

Hello everyone,

I did like to give a brief overview of Fermat's theorem and its proof. There are various methods to prove Fermat's Little theorem, but I found the combinatorial approach to be the most straightforward and easy to understand. I'd like to discuss Fermat's theorem and its proof using combinatorics.

Fermat's Little Theorem

It states that if $$$p$$$ is a prime and $$$a$$$ is any integer not divisible by $$$p$$$, then $$$a^{p−1} − 1$$$ is divisible by $$$p$$$

Example:

Say a = 2 , p = 5.
$$$a^{p-1} $$$
$$$ = 2^{5-1}$$$
$$$ = 2^4 = 16$$$
$$$ \equiv 1 \pmod{5}$$$

Proof (Combinatorics Approach)

The concept behind this proof is to approach it through a combinatorial problem and discover its solution, which indirectly verifies the theorem. Let's explore this straightforward combinatorial problem.

Problem

Consider a Necklace chain consisting of beads. There are $$$p$$$ beads in this chain. You are allowed to color each bead with $$$a$$$ possible colors available. The colors are available in infinite amounts, there is no other restriction on coloring. Find the number of ways to color these beads.

It can be easily shown that there are $$$a^p$$$ ways to color the beads to get different necklaces. (considering cyclic rotations as distinct). Every bead has $$$a$$$ options to be colored.

Consider a small variation to this problem, Among all possible $$$a^p$$$ permutations, Let's try to group them based on similar cyclic rotations. Two permutations are said to be equivalent if any of them can be generated from the cyclic rotation of the other.

For example, consider $$$a = 2, p = 3$$$. Let X and Y be the 2 possible colors available. Let's try to group these $$$2^3 = 8$$$ strings (all permutations) based on similar cyclic rotations. We get:

  • Group 1: XXX
  • Group 2: YYY
  • Group 3: XXY, XYX, YXX
  • Group 4: XYY, YYX, YXY

Here we get 4 different groups of sizes 1,1,3,3 each. Let's try to analyze these group sizes in-depth.

Periodicity of a String:

The periodicity of a string refers to the smallest length of a substring that, when repeated, forms the entire string. In other words, it's the minimum length of a substring that can be repeated periodically to recreate the original string.

Example
  • ABCABC has periodicity = 3 (ABC)
  • ABABAB has periodicity = 2 (AB)
Claim 1

The periodicity of a string is the same as its group size of similar cyclic rotations.

Explanation and Proof
Claim 2

The periodicity of a string, as well as its group size, are factors of the string's total length.

Explanation

From the above 2 claims, we can conclude that for the original problem (filling $$$p$$$ beads with $$$a$$$ colors) we get $$$a^p$$$ strings, and these strings have periodicity as $$$1$$$ or $$$p$$$. ($$$1$$$ and $$$p$$$ are the only factors of $$$p$$$ (prime)).

Example $$$a = 2, p = 3$$$
  • Group 1: XXX Periodicity = 1
  • Group 2: YYY Periodicity = 1
  • Group 3: XXY, XYX, YXX Periodicity = 3
  • Group 4: XYY, YYX, YXY Periodicity = 3

It can also be shown that among $$$a^p$$$ strings, there are only $$$a$$$ strings with periodicity as $$$1$$$. (Same color applied to all beads Example: Group 1: XXX, Group 2: YYY)

From the above statements we can conclude that the remaining strings $$$a^p - a$$$ have periodicity as $$$p$$$, which says that we can separate the remaining $$$a^p - a$$$ strings into groups of sizes $$$p$$$. This concludes that $$$a^p - a$$$ is a multiple of $$$p$$$. So

$$$a^p - a \equiv 0 \pmod{p}$$$
$$$a^p \equiv a \pmod{p}$$$
$$$a^{-1}*a^p \equiv a^{-1}*a \pmod{p}$$$
$$$a^{p-1} \equiv 1 \pmod{p}$$$

This completes the proof. My main motivation for exploring such proofs is the belief that visualizing a problem from different perspectives can simplify the process, making the proofs more intuitive and accessible, rather than relying solely on rigorous mathematical approaches.

References:

1) Wikepedia

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en42 English Ashwanth.K 2024-08-14 07:15:35 6 Tiny change: ' \n\nThus, this comple' -> ' \n\nThis comple'
en41 English Ashwanth.K 2024-08-14 07:15:05 110 Tiny change: 'ime and $a$ is any i' -> 'ime and $a > 1$ is any i'
en40 English Ashwanth.K 2024-08-14 07:10:21 47 Tiny change: 'ons. \n\n<spoiler' -> 'ons. \n![ ](https://ibb.co/DrMDhmJ)\n<spoiler'
en39 English Ashwanth.K 2024-08-14 00:55:29 258
en38 English Ashwanth.K 2024-08-14 00:51:19 0 Tiny change: ' characters are repea' -> ' character are repea' (published)
en37 English Ashwanth.K 2024-08-14 00:47:12 5 Tiny change: ' \n######References' -> ' \n##### References'
en36 English Ashwanth.K 2024-08-14 00:43:01 18
en35 English Ashwanth.K 2024-08-14 00:40:07 33 Tiny change: ' \n\nReferenc' -> ' \n\nThus, completing the proof. \nReferenc'
en34 English Ashwanth.K 2024-08-14 00:39:37 1091 Tiny change: 'xplanation and Proof">\nLet's ' -> 'xplanation">\nLet's '
en33 English Ashwanth.K 2024-08-14 00:20:03 1135 Tiny change: 'inal form.`\n######Pr' -> 'inal form.\n######Pr'
en32 English Ashwanth.K 2024-08-14 00:09:51 866
en31 English Ashwanth.K 2024-08-13 23:06:19 223
en30 English Ashwanth.K 2024-08-13 23:03:50 90
en29 English Ashwanth.K 2024-08-13 23:01:52 327 Tiny change: 'YYX, YXY \n- \n\n\nRefere' -> 'YYX, YXY \n\nRefere'
en28 English Ashwanth.K 2024-08-13 22:43:22 139
en27 English Ashwanth.K 2024-08-13 22:41:17 4 Tiny change: 'consider $A = 2, P = 3$ ' -> 'consider $a = 2, p = 3$ '
en26 English Ashwanth.K 2024-08-13 22:40:58 264
en25 English Ashwanth.K 2024-08-13 22:35:30 74
en24 English Ashwanth.K 2024-08-13 22:31:20 45
en23 English Ashwanth.K 2024-08-13 22:30:11 15
en22 English Ashwanth.K 2024-08-13 22:28:39 416 Tiny change: ' $ = 2^4$ \n $ = 16$ ' -> ' $ = 2^4 = 16$ '
en21 English Ashwanth.K 2024-08-13 22:19:00 8 Tiny change: 'mple:\n Say a =' -> 'mple:\n Say a ='
en20 English Ashwanth.K 2024-08-13 22:18:44 9
en19 English Ashwanth.K 2024-08-13 22:18:19 101
en18 English Ashwanth.K 2024-08-13 22:16:33 13 Tiny change: 'e Theorem:\n- States that' -> 'e Theorem: \n It states that'
en17 English Ashwanth.K 2024-08-13 22:16:12 3
en16 English Ashwanth.K 2024-08-13 22:16:00 44
en15 English Ashwanth.K 2024-08-13 22:15:40 48
en14 English Ashwanth.K 2024-08-13 22:15:24 38
en13 English Ashwanth.K 2024-08-13 22:15:00 346
en12 English Ashwanth.K 2024-08-13 22:09:27 2 Tiny change: 'v 1 \pmod{n}$ \n\n' -> 'v 1 \pmod{p}$ \n\n'
en11 English Ashwanth.K 2024-08-13 22:09:16 11 Tiny change: ' \equiv 1 mod p$ \n\n\' -> ' \equiv 1 \pmod{n}$ \n\n\'
en10 English Ashwanth.K 2024-08-13 22:08:23 8 Tiny change: ' $a^{p-1} = 1 mod ' -> ' $a^{p-1} \equiv 1 mod '
en9 English Ashwanth.K 2024-08-13 22:07:51 4 Tiny change: '{p-1} = 1 mod p$ \n\' -> '{p-1} = 1 mod p$ \n\'
en8 English Ashwanth.K 2024-08-13 22:07:38 10
en7 English Ashwanth.K 2024-08-13 22:07:05 9 Tiny change: 'orem: \n &mdash; States th' -> 'orem: \n- States th'
en6 English Ashwanth.K 2024-08-13 22:06:55 0 Tiny change: 'rem: \n &mdash; States th' -> 'rem: \n - States th'
en5 English Ashwanth.K 2024-08-13 22:06:41 8 Tiny change: 'rem: \n States th' -> 'rem: \n - States th'
en4 English Ashwanth.K 2024-08-13 22:06:24 136
en3 English Ashwanth.K 2024-08-13 22:04:56 10
en2 English Ashwanth.K 2024-08-13 22:04:27 287
en1 English Ashwanth.K 2024-08-13 22:00:23 307 Initial revision (saved to drafts)