CLIQUE ∈ ⟹ IS ∈
Suppose , i.e. some of size is a clique in . Let be distinct; then , hence , so is independent in . Thus .
— the very same reduction, passing to the complement, works in the reverse direction too.
On input with a graph: return .
The key to correctness is that complementation is an involution:
Suppose , i.e. some of size is a clique in . Let be distinct; then , hence , so is independent in . Thus .
Suppose , i.e. some of size is independent in . Let be distinct; then , hence , so is a clique in . Thus .
Identical to the other direction — it is the same construction.
. This is the cleanest case of two equivalent problems: not merely reductions in both directions, but literally the same function.
does not imply . Here it happens to hold, thanks to the involution; that is a property of this particular construction, not a general rule.