For finite sets , the inclusion-exclusion principle is
To prove it, fix an element occurring in exactly of these sets. Its coefficient on the right is , by the binomial theorem applied to . An element occurring in none has coefficient zero. Summing these elementwise coefficients proves the formula.
Write the prime factorization with distinct primes and positive exponents. In let be the multiples of . A number is coprime to exactly when it is outside their union. For a nonempty index set , the intersection has elements, since that product divides . Applying inclusion-exclusion to the complement therefore gives
For , the empty product gives . If positive integers are coprime, their prime factors are disjoint, so the product separates and proves the multiplicativity of the Euler totient function:
For a positive divisor , write the exponent of a prime in as , allowing . Its contribution to is if , and if . Every contribution is an integer; multiplying proves totient divisibility along divisors:
Finally suppose . If the required form is immediate. If were odd, some odd prime would divide it, and the even factor in would make an even number divide an odd number, impossible. Thus write with odd primes and . Counting powers of two in the totient formula gives
where is the -adic P-adic valuation. Every term in the sum is at least one, so there is at most one odd prime and, if present, . Moreover . Since is coprime to , and has no prime factors other than , the integer must be a power of two. Its exponent is one, hence and . This proves
More precisely, the integers whose totient divides them are and with , ; substitution in the product formula proves the converse. A positive power of alone does not satisfy the divisibility condition.