I liked this question so much, I made it the subject of my blog on June 4, 2013 . Thanks for the great question!
Big cases are easy to find. For example:
a = 1073741823; b = 134217727; c = 134217727;
because b * c overflows to a negative number.
I would add that the fact that in proven arithmetic the difference between a / (b * c) and (a / b) / c may be the difference between a program that works and a program that crashes. If the product of b and c overflows the bounds of an integer, then the first will fail in a verified context.
For small positive integers, say small enough to fit short, identification must be supported.
Timothy Shields has just published a proof; I present here an alternative evidence. Suppose all the numbers here are non-negative integers and none of the overflow operations.
Integer division x / y finds a value q such that q * y + r == x , where 0 <= r < y .
So, the division a / (b * c) finds the value q1 such that
q1 * b * c + r1 == a
where 0 <= r1 < b * c
division ( a / b ) / c first finds a qt such that
qt * b + r3 == a
and then finds a q2 value such that
q2 * c + r2 == qt
So, replace that for qt and get:
q2 * b * c + b * r2 + r3 == a
where 0 <= r2 < c and 0 <= r3 < b .
Two identical things are equal to each other, so we have
q1 * b * c + r1 == q2 * b * c + b * r2 + r3
Suppose q1 == q2 + x for some integer x . Replace this and solve for x :
q2 * b * c + x * b * c + r1 = q2 * b * c + b * r2 + r3 x = (b * r2 + r3 - r1) / (b * c)
Where
0 <= r1 < b * c 0 <= r2 < c 0 <= r3 < b
Could x be greater than zero? No. We have the inequalities:
b * r2 + r3 - r1 <= b * r2 + r3 <= b * (c - 1) + r3 < b * (c - 1) + b == b * c
So, the numerator of this fraction is always less than b * c , so x cannot be greater than zero.
Could x be less than zero? No, for a similar argument, left to the reader.
Therefore, the integer x is equal to zero, and therefore q1 == q2 .