This proves the theorem for d=4 (two qubits) and then for every d≥4. The case d=3 needs a
different construction and is proved by Kochen and Specker.
Product rule. If A and B commute, they have a common eigenbasis, so there is a Hermitian C (with
distinct eigenvalues on that basis) and functions f,g with A=f(C), B=g(C), and AB=(fg)(C).
Condition 2 gives v(AB)=f(v(C))g(v(C))=v(A)v(B). By induction the same holds for any number of
mutually commuting operators.
The square.
X⊗II⊗Z−X⊗ZI⊗XZ⊗I−Z⊗XX⊗XZ⊗ZY⊗Y
Every entry has eigenvalues ±1. The three entries of each row commute, as do those of each column,
and using XZ=−iY, ZX=iY one checks that each row multiplies to +I and each column to −I
(for example the third row gives (XZ⊗ZX)(Y⊗Y)=(−iY2)⊗(iY2)=I, and the third
column XZY⊗XZY=(−i)2I=−I).
Contradiction. Suppose v exists and let vrc∈{±1} be the value of the entry in row r,
column c. By the product rule and v(±I)=±1, ∏cvrc=+1 for each row and
∏rvrc=−1 for each column. Multiplying all three row equations gives
∏r,cvrc=+1; multiplying all three column equations gives ∏r,cvrc=−1. Each
vrc is the value of one fixed operator, the same in its row and its column — this is where
noncontextuality enters — so both products are the same number. Contradiction.
Larger dimensions. The two forms of the theorem are equivalent: a valuation of observables gives
{0,1} values to projectors with ∑iv(Pi)=v(∑iPi)=v(I)=1 (the Pi are functions of
C=∑iiPi), and conversely a projector valuation defines v(A) as the eigenvalue whose spectral
projector has value 1. Now let d>4 and suppose a projector valuation v exists on H. In any
orthonormal basis exactly one vector e has v(∣e⟩⟨e∣)=1; let K be spanned by e and three
other vectors of that basis, with projector PK, so v(PK)=1 (complete with the remaining
basis vectors, all of value 0). For any orthogonal projectors Q1,…,Qk on K summing to
PK, completing the family with I−PK, which has value 0, gives ∑iv(Qi)=1. So v
restricts to a projector valuation on the four-dimensional space K, which the square has ruled out.