  We establish algebraicity criteria for formal germs of curves in algebraic
varieties over number fields and apply them to derive a rationality criterion
for formal germs of functions, which extends the classical rationality theorems
of Borel-Dwork and P\'olya-Bertrandias valid over the projective line to
arbitrary algebraic curves over a number field.
  The formulation and the proof of these criteria involve some basic notions in
Arakelov geometry, combined with complex and rigid analytic geometry (notably,
potential theory over complex and $p$-adic curves). We also discuss geometric
analogues, pertaining to the algebraic geometry of projective surfaces, of
these arithmetic criteria.
