By a {\em Riemann function} we mean a function f:ZnβZ such that f(d)=f(d1β,β¦,dnβ) is equals 0 for
deg(d)=d1β+β―+dnβ sufficiently small, and equals
d1β+β―+dnβ+C for a constant, C -- the {\em offset of f} -- for deg(d) sufficiently large. By adding 1 to the Baker-Norine rank
function of a graph, one gets an equivalent Riemann function, and similarly for
related rank functions. For such an f, for any KβZn
there is a unique Riemann function fKβ§β such that for all dβZn we have f(d)βfKβ§β(Kβd)=deg(d)+C which we call a {\em generalized Riemann-Roch formula}.
We show that any such equation can be viewed as an Euler charactersitic
equation of sheaves of a particular simple type that we call {\em diagrams}.
This article does not assume any prior knowledge of sheaf theory.
To certain Riemann functions f:Z2βZ there is a
simple family of diagrams {MW,dβ}dβZ2β such that f(d)=b0(MW,dβ) and
fKβ§β(Kβd)=b1(MW,dβ).
Furthermore we give a canonical isomorphism H1(MW,dβ)ββH0(MWβ²,Kβdβ) where Wβ² is the weight of
fKβ§β.
General Riemann functions f:Z2βZ are similarly
modeled with formal differences of diagrams. Riemann functions ZnβZ are modeled using their restrictions to two of their
variables. These constructions involve some ad hoc choices, although the
equivalence class of virtual diagram obtained is independent of the ad hoc
choices