The grid graph is the graph on [k]^{n}={0,...,k−1}^{n} in whichx=(x_{i})_{1}^{n} is joined toy=(y_{i})_{1}^{n} if for somei we have |x_{i}−y_{i}|=1 andx_{j}=y_{j} for allj≠i. In this paper we give a lower bound for the number of edges between a subset of [k]^{n} of given cardinality and its complement. The bound we obtain is essentially best possible. In particular, we show that ifA⊂[k]^{n} satisfiesk^{n}/4≤|A|≤3k^{n}/4 then there are at leastk^{n−1} edges betweenA and its complement.

Our result is apparently the first example of an isoperimetric inequality for which the extremal sets do not form a nested family.

We also give a best possible upper bound for the number of edges spanned by a subset of [k]^{n} of given cardinality. In particular, forr=1,...,k we show that ifA⊂[k]^{n} satisfies |A|≤r^{n} then the subgraph of [k]^{n} induced byA has average degree at most 2n(1−1/r).