  A central result in the foundations of quantum mechanics is the
Kochen-Specker theorem. In short, it states that quantum mechanics cannot be
reconciled with classical models that are noncontextual for ideal measurements.
The first explicit derivation by Kochen and Specker was rather complex, but
considerable simplifications have been achieved thereafter. We propose a
systematic approach to find minimal Hardy-type and
Greenberger-Horne-Zeilinger-type (GHZ-type) proofs of the Kochen-Specker
theorem, these are characterized by the fact that the predictions of classical
models are opposite to the predictions of quantum mechanics. Based on our
results, we show that the Kochen-Specker set with 18 vectors from Cabello et
al. [A. Cabello et al., Phys. Lett. A 212, 183 (1996)] is the minimal set for
any dimension, verifying a longstanding conjecture by Peres. Our results allow
to identify minimal contextuality scenarios and to study their usefulness for
information processing.
