Quantum contextuality is a feature of quantum mechanics whereby measurements of quantum observables cannot simply be thought of as revealing pre-existing values. Any attempt to do so leads to values that are dependent upon which other measurements are being performed (the measurement context). More formally, the measurement result of a quantum observable is dependent upon which other commuting observables are within the same measurement set.Simon B. Kochen and Ernst Specker, and separately John Bell, constructed proofs that quantum mechanics is contextual for systems of Hilbert space dimension three and greater. The Kochen–Specker theorem proves that noncontextual hidden variable theories cannot reproduce the empirical predictions of quantum mechanics. Such a theory would suppose the following.The sheaf-theoretic, or Abramsky–Brandenburger, approach to contextuality initiated by Samson Abramsky and Adam Brandenburger is theory-independent and can be applied beyond quantum theory to any situation in which empirical data arises in contexts. As well as being used to study forms of contextuality arising in quantum theory and other physical theories, it has also been used to study formally equivalent phenomena in logic, relational databases, natural language processing, and constraint satisfaction.The Kochen–Specker theorem proves that quantum mechanics is incompatible with noncontextual hidden variable models. On the other hand Bell's theorem proves that quantum mechanics is incompatible with factorisable hidden variable models in an experiment in which measurements are performed at distinct spacelike separated locations. Arthur Fine showed that in the experimental scenario in which the famous CHSH inequalities and proof of nonlocality apply, a factorisable hidden variable model exists if and only if an noncontextual hidden variable model exists. This equivalence was proven to hold more generally in any experimental scenario by Samson Abramsky and Adam Brandenburger. It is for this reason that we may consider nonlocality to be a special case of contextuality.A number of methods exist for quantifying contextuality. One approach is by measuring the degree to which some particular noncontextuality inequality is violated, e.g. the KCBS inequality, the Yu–Oh inequality, or some Bell inequality. A more general measure of contextuality is the contextual fraction.Recently, quantum contextuality has been investigated as a source of quantum advantage and computational speedups in quantum computing.