  Many geometric and analytic properties of sets hinge on the properties of
harmonic measure, notoriously missing for sets of higher co-dimension. The aim
of this manuscript is to develop a version of elliptic theory, associated to a
linear PDE, which ultimately yields a notion analogous to that of the harmonic
measure, for sets of codimension higher than 1.
  To this end, we turn to degenerate elliptic equations. Let $\Gamma \subset
\mathbb R^n$ be an Ahlfors regular set of dimension $d<n-1$ (not necessarily
integer) and $\Omega = \mathbb R^n \setminus \Gamma$. Let $L = - {\rm div}
A\nabla$ be a degenerate elliptic operator with measurable coefficients such
that the ellipticity constants of the matrix $A$ are bounded from above and
below by a multiple of ${\rm dist}(\cdot, \Gamma)^{d+1-n}$. We define weak
solutions; prove trace and extension theorems in suitable weighted Sobolev
spaces; establish the maximum principle, De Giorgi-Nash-Moser estimates, the
Harnack inequality, the H\"older continuity of solutions (inside and at the
boundary). We define the Green function and provide the basic set of pointwise
and/or $L^p$ estimates for the Green function and for its gradient. With this
at hand, we define harmonic measure associated to $L$, establish its doubling
property, non-degeneracy, change-of-the-pole formulas, and, finally, the
comparison principle for local solutions.
  In another article to appear, we will prove that when $\Gamma$ is the graph
of a Lipschitz function with small Lipschitz constant, we can find an elliptic
operator $L$ for which the harmonic measure given here is absolutely continuous
with respect to the $d$-Hausdorff measure on $\Gamma$ and vice versa. It thus
extends Dahlberg's theorem to some sets of codimension higher than 1.
