Let , with . Then exactly when , and the sum becomes
This is when and otherwise. Summing over yields
Taking the complement of the case gives the inclusion-exclusion principle
If are the distinct prime divisors of , inclusion-exclusion removes their multiples from and gives
For the stated squarefree and , Fermat's theorem gives . Since , every divides ; their product does too. Thus is a Carmichael number.
The inclusion-exclusion principle states that for finite sets ,
For each prime , exclude pairs whose two coordinates are divisible by . For a set of distinct prime divisors , exactly pairs have both coordinates divisible by their product. Inclusion-exclusion therefore gives
For events , the probabilistic inclusion-exclusion principle is
To prove it, fix an outcome lying in exactly events. Its total coefficient on the right is
by the binomial theorem; outcomes in no event contribute zero. Taking expectations of this pointwise indicator identity proves the formula. Truncating after the pair terms gives the Bonferroni inequalities
For the final bound, let and . The intersection assumption gives
The Cauchy-Schwarz inequality applied to yields . Therefore
so the required universal constant may be taken as . This is a second moment method estimate.
The inclusion-exclusion principle says that the size of a finite union is the alternating sum of the sizes of all nonempty intersections of its constituent sets.
For each prime number , let consist of the tuples for which divides every . Exactly tuples lie in , and for distinct primes , exactly lie in their intersection. A tuple has greatest common divisor greater than one with exactly when it belongs to some . Inclusion-exclusion therefore gives the Jordan totient function