  A key tool in recent advances in understanding arithmetic progressions and
other patterns in subsets of the integers is certain norms or seminorms. One
example is the norms on $\Z/N\Z$ introduced by Gowers in his proof of
Szemer\'edi's Theorem, used to detect uniformity of subsets of the integers.
Another example is the seminorms on bounded functions in a measure preserving
system (associated to the averages in Furstenberg's proof of Szemer\'edi's
Theorem) defined by the authors. For each integer $k\geq 1$, we define
seminorms on $\ell^\infty(\Z)$ analogous to these norms and seminorms. We study
the correlation of these norms with certain algebraically defined sequences,
which arise from evaluating a continuous function on the homogeneous space of a
nilpotent Lie group on a orbit (the nilsequences). Using these seminorms, we
define a dual norm that acts as an upper bound for the correlation of a bounded
sequence with a nilsequence. We also prove an inverse theorem for the
seminorms, showing how a bounded sequence correlates with a nilsequence. As
applications, we derive several ergodic theoretic results, including a
nilsequence version of the Wiener-Wintner ergodic theorem, a nil version of a
corollary to the spectral theorem, and a weighted multiple ergodic convergence
theorem.

Dynamical Systems;Number Theory