In a local model, for each value of λ define the local expectation values
αx(λ)=a∑apA(a∣x,λ),βy(λ)=b∑bpB(b∣y,λ),
which lie in [−1,1]. Because the responses are independent given λ,
⟨AxBy⟩=∫q(λ)αx(λ)βy(λ)dλ,
and therefore S=∫q(λ)s(λ)dλ with
s=α0(β0+β1)+α1(β0−β1).
For fixed λ, s is an affine function of each of α0,α1,β0,β1
separately, so its maximum and minimum over the cube [−1,1]4 are attained at
corners, where all four numbers are ±1. At a corner one of β0+β1 and
β0−β1 is 0 and the other is ±2, so s=±2. Hence
∣s(λ)∣≤2 for every λ, and
∣S∣≤∫q(λ)∣s(λ)∣dλ≤2.
The step from the model to S=∫qs is where the two assumptions enter: the
distribution q is the same for all four pairs of inputs (independence of the hidden
variable from the settings), and αx does not depend on y nor βy on x
(locality).