0

I tried to understand this answer.

However, I do not understand how the sets $A(d) = \{k \in S :(k,n) = d\}$, $S = \{1,2,...,n\}$ are disjoint and that their cardinality sums up exactly to $n$, since for example $n = 8$, then the divisors are ${8,4,2,1}$, so:

$$A(8) =\{8\}$$ $$A(4)=\{4\}$$ $$A(2)=\{6,2\}$$ $$A(1)=\{1,3,5,7\}$$

And we easily see that: $|A(8)| + |A(4)| + |A(2)| + |A(1)| = 8$.

However how to show this for a general number ?

(I know that some proofs are with cyclic generators, but In classes we didn't take that subject).

Is there a more elementary way to show this ?

user26857
  • 53,190
VLC
  • 2,543
  • Well, each number $k\in S$ belongs to exactly one of the sets $A(d)$ - namely to the set where $d=\gcd(k, n)$. Does that help? –  Dec 30 '21 at 17:45
  • @StinkingBishop I understand that, I just dont understand how they sum up to $n$, if we look at it like a set. – VLC Dec 30 '21 at 18:52
  • @StinkingBishop So why do $A(d_1) + A(d_2)+...+A(d_n) = n$, if $d_1, d_2,..., d_n$ are all the divisors of $n$ – VLC Dec 30 '21 at 18:53
  • 1
    They do because $S$ has $n$ elements. The sets $A(d)$ make up a partition of $S$ - which is another way to say that every element of $S$ belongs to exactly one of $A(d)$'s. –  Dec 30 '21 at 18:53
  • @StinkingBishop I also understand the partition part, it just isnt obvious to me that the partitions add up to whole $S$ – VLC Dec 30 '21 at 18:54
  • @StinkingBishop Or in other words: why does: $\bigcup_{d|n} A(d)=[n]$ – VLC Dec 30 '21 at 18:56
  • Because, as I said, pick any $k\in S$ and then $k$ will be in one of $A(d)$'s, namely $k\in A(\gcd(n,k))$. Notice $d=\gcd(n,k)$ is one of the divisors of $n$. –  Dec 30 '21 at 18:57
  • @StinkingBishop Is there a way to show that all the partitions are $S$ ?

    I understand what every element of $A(d)$ is, but why does it cover all $S$ ?

    – VLC Dec 30 '21 at 18:59
  • 1
    I don't quite understand - do you doubt that $A(d)$ make up a partition of $S$, or that the the sizes of the individual sets in a partition add up to the size of the total set? I hope I've explained the first part, and the second part should be intuitively obvious (while the proof would be probably very low-level and tedious). –  Dec 30 '21 at 19:00
  • @StinkingBishop I thought about the second part. Ok, if it should be intuitive, then I will just add it to my memory as a fact. – VLC Dec 30 '21 at 19:24
  • It's like asking "There are 10 fruits in the bowl - 3 apples, 3 pears and 4 oranges. Why is 3+3+4=10?" –  Dec 30 '21 at 19:29
  • @StinkingBishop Or maybe this question: Why is $gcd(a,b) = d$ such a function that it forms a disjoint set. – VLC Dec 30 '21 at 19:31
  • 1
    Any function on $S$ partitions the set. This is why: if $f:S\to T$ is a function, then $x\equiv y\iff f(x)=f(y)$ is an equivalence relation and it splits the set $S$ into equivalence classes. $k\mapsto \gcd(n,k)$ is nothing special in that respect, it has $\gcd$ because ... it is useful in resolving that other question (that you linked to) and for no other reason. –  Dec 30 '21 at 19:43

1 Answers1

1

Consider the elements of $[n]=\{1,2,\ldots,n\}$. Each element $k\in [n]$, will have exactly one value of $\gcd(k,n)$. Moreover, from the definition of $\gcd$, this value will be a divisor of $n$. Hence, each element $k\in [n]$ belongs in exactly one of $A(d)$, where $d$ is a divisor of $n$. Hence the family of sets $A(d)$ where $d|n$ are all pairwise disjoint and $\bigcup_{d|n} A(d)=[n]$. Therefore, from the addition principle, it follows that $\sum_{d|n} \left|A(d)\right|=\left|[n]\right|=n$.

We can also use this result to prove a well known identity: $\sum_{d|n} \phi(d)=n$. We want the value of the sum $\sum_{d|n} |A(d)|$, where $A(d)=\{k\in [n]\mid\gcd(k,n)=d\}$. Note that if $k\in A(d)$, then $d|k$. Moreover, we require that $\gcd\left(\frac{k}{d},\frac{n}{d}\right)=1$. Since $k\leq n$, this means that there are $\phi\left(\frac{n}{d}\right)$ elements in $A(d)$.

Hence, $\sum_{d|n} \left| A(d)\right|=\sum_{d|n} \phi\left(\frac{n}{d}\right)=\sum_{d|n} \phi(d)$. In the beginning, we showed that $\sum_{d|n} \left| A(d)\right|=n$, hence our proof is complete.

Alan Abraham
  • 5,365