TITLE: 1 rectangle <= 4 squares
QUESTION [41 upvotes]: Almost 25 years ago a professor at Indiana U showed me the following problem:
given a map $\mathbb{Z}^2\rightarrow\mathbb{R}$ such that the sum inside every square (parallel to the axes) is $\leq1$ in absolute value, prove that the sum inside every rectangle (parallel to axes) is $\leq4$ in absolute value.
It's fun and not too hard to prove.
I believe that at the time I was able to show that the upper limit can be improved to 3.975 - but that was a lot harder and I can't say now that this is for sure the case.  Also, with a computer search (old TRS 80) I produced an example containing a rectangle of area $3\frac{1}{3}$.
These are some of the questions that come to mind:

can the upper limit of 4 (or 3.975?) be improved?
can the lower limit of $3\frac{1}{3}$ be improved?
any proof/conjecture about the optimal limit?
do the results extend to maps $\mathbb{R}^2\rightarrow\mathbb{R}$, provided they are "nice" enough?
are any other generalizations of this problem possible (eg. different tilings of the plane or of other manifolds, or higher dimensions)?

 Update 1 (updated 7th March 2010). See answers and comments below  for examples achieving ratios as high as 181/48 = 3.7708333...!
 Update 2. Here is a sketch of the proof that 4 is an upper limit.
A limit of 254/67=3.79104477... is now known (see answers below), but the proof for that needs to be seeded with at least some known limit.
Given a rectangle R of size AxB, with A < B, call it "thin" if $B\geq2A$ or "fat" if $B\leq2A$ (the case B=2A is irrelevant as it is the union of 2 squares).
One can draw the 4 squares on the sides of R, either facing outwards (size of envelope = (2B+A)x(2A+B)), or inwards (some spilling out on the opposite sides, size of envelope = (2B-A)xB) - call these the "big-envelope" and the "small-envelope".
Assume that R has sum 4+$\epsilon$ and that every square has sum between -1 and 1. We have 3 cases, all easy exercises to work out:
(1) for any R, the fat (2A+B)x(2B+A) big-envelope will have sum $\leq-4-3\epsilon$.
(2) for a fat R, a (2A-B)x(2B-A) sub-rectangle of the small-envelope will have sum $\leq-4-3\epsilon$;
(3) for a thin R, a thin (B-2A)x(2B-A) sub-rectangle of the small-envelope, will have sum $\geq4+3\epsilon$;
Applying any of (1)+(2), (2)+(1) or (3)+(3) produces a 3Ax3B rectangle with
sum $\geq4+9\epsilon$.  Iterating n times produces a $3^{n}A \times 3^{n}B$ rectangle with sum $4+9^{n}\epsilon$.  Such rectangle is made of no more than AxB squares (each of size $3^{n} \times 3^{n}$) and therefore, for large enough n, one of the squares will have sum >1. $\square$
 Reformulation . Given an abelian group G and a map
f: GxGxGxG -> $\mathbb{R}$  such that 
1) -1<=f(a,b,c,d)<=1  if d*a=c*b
(boundedness of squares),
2) f(a,b,c,d)+f(c,b,e,d)=f(a,b,e,d)  for all a, b, c, d, e in G
(horizontal additivity of rectangles),
3) f(a,b,c,d)+f(a,d,c,e)=f(a,b,c,e)  for all a, b, c, d, e in G
(vertical additivity of rectangles),
can we find a universal best bound b(G) such that -b(G) <= f <= b(G)?
All the previous work on this question amounts to the result:
181/48 <= b($\mathbb{Z}$) <= b($\mathbb{Z}x\mathbb{Z}$) <= 254/67
For non-abelian groups one could perhaps generalize the notion of "square"
by lifting it from G/[G,G].

REPLY [3 votes]: There is a new upper bound of 254/67 (= 3.79104477...).
Define 6 sets of cardinality 4:
X1={-B+A, 0, A, B}
Y1={0, A, B-A, B}
X2={-B, -B+3A, B-2A, B+A}
Y2={-2B+A, -A, B+A, 3B-A}
X3={-6B+2A, -2B-2A, 2B+3A, 6B-A}
Y3={-2B-2A, -B+6A, 2B-6A, 3B+2A}
then we already know that in the in the grid
X1 x Y1
if the sum in the central
AxB is $4+\epsilon$
the sum in the surrounding
(2B-A)x(B-2A) is $\geq4+3\epsilon$,
similarly in the in the grid
(X1 $\cup$ X2) x (Y1 $\cup$ Y2)
if the sum in the central
AxB is $19/5+\epsilon$
then the sum in the surrounding
(2B-5A)x(5B-2A) is $\leq-19/5-21\epsilon$,
last, in the in the grid
(X1 $\cup$ X2 $\cup$ X3) x (Y1 $\cup$ Y2 $\cup$ Y3)
if the sum in the central
AxB is $254/67+\epsilon$
then the sum in the surrounding
(12B-3A)x(3B-12A) is $\geq254/67+135\epsilon$.
All of the above claims are easily verifiable with the tools already described in the previous answers and comments. I wonder if one can find sets X4 and Y4 (with 4 elements each?) to further improve the bound and maybe spot a general pattern.