  Integration over curved manifolds with higher codimension and, separately,
discrete variants of continuous operators, have been two important, yet
separate themes in harmonic analysis, discrete geometry and analytic number
theory research. Here we unite these themes to study discrete analogues of
operators involving higher (intermediate) codimensional integration. We
consider a maximal operator that averages over triangular configurations and
prove several bounds that are close to optimal. A distinct feature of our
approach is the use of multilinearity to obtain nontrivial $\ell^1$-estimates
by a rather general idea that is likely to be applicable to other problems.
