In mathematics, a cofinite subset of a set X {\displaystyle X} is a subset A {\displaystyle A} whose complement in X {\displaystyle X} is a finite set. In other words, A {\displaystyle A} contains all but finitely many elements of X . {\displaystyle X.} If the complement is not finite, but is countable, then one says the set is cocountable.
These arise naturally when generalizing structures on finite sets to infinite sets, particularly on infinite products, as in the product topology or direct sum.
This use of the prefix "co" to describe a property possessed by a set's complement is consistent with its use in other terms such as "comeagre set".