  We study the structure of gauge and gravitational anomalies in 2d N=(0,2)
theories obtained by compactification of F-theory on elliptically fibered
Calabi-Yau 5-folds. Abelian gauge anomalies, induced at 1-loop in perturbation
theory, are cancelled by a generalized Green-Schwarz mechanism operating at the
level of chiral scalar fields in the 2d supergravity theory. We derive closed
expressions for the gravitational and the non-abelian and abelian gauge
anomalies including the Green-Schwarz counterterms. These expressions involve
topological invariants of the underlying elliptic fibration and the gauge
background thereon. Cancellation of anomalies in the effective theory predicts
intricate topological identities which must hold on every elliptically fibered
Calabi-Yau 5-fold. We verify these relations in a non-trivial example, but
their proof from a purely mathematical perspective remains as an interesting
open problem. Some of the identities we find on elliptic 5-folds are related in
an intriguing way to previously studied topological identities governing the
structure of anomalies in 6d N=(1,0) and 4d N=1 theories obtained from
F-theory.
