  We consider the task of locally correcting, and locally list-correcting,
multivariate linear functions over the domain $\{0,1\}^n$ over arbitrary fields
and more generally Abelian groups. Such functions form error-correcting codes
of relative distance $1/2$ and we give local-correction algorithms correcting
up to nearly $1/4$-fraction errors making $\widetilde{\mathcal{O}}(\log n)$
queries. This query complexity is optimal up to $\mathrm{poly}(\log\log n)$
factors. We also give local list-correcting algorithms correcting $(1/2 -
\varepsilon)$-fraction errors with $\widetilde{\mathcal{O}}_{\varepsilon}(\log
n)$ queries.
  These results may be viewed as natural generalizations of the classical work
of Goldreich and Levin whose work addresses the special case where the
underlying group is $\mathbb{Z}_2$. By extending to the case where the
underlying group is, say, the reals, we give the first non-trivial locally
correctable codes (LCCs) over the reals (with query complexity being sublinear
in the dimension (also known as message length)).
  The central challenge in constructing the local corrector is constructing
"nearly balanced vectors" over $\{-1,1\}^n$ that span $1^n$ -- we show how to
construct $\mathcal{O}(\log n)$ vectors that do so, with entries in each vector
summing to $\pm1$. The challenge to the local-list-correction algorithms, given
the local corrector, is principally combinatorial, i.e., in proving that the
number of linear functions within any Hamming ball of radius
$(1/2-\varepsilon)$ is $\mathcal{O}_{\varepsilon}(1)$. Getting this general
result covering every Abelian group requires integrating a variety of known
methods with some new combinatorial ingredients analyzing the structural
properties of codewords that lie within small Hamming balls.
