  In a note published in 1925, G. H. Hardy stated the inequality
\begin{equation*} \sum_{n=1}^\infty \left(\frac{1}{n}\sum_{k=1}^n a_k \right)^p
\leq \left(\frac{p}{p-1}\right)^p \sum_{n=1}^\infty a_n^p, \end{equation*} for
any non-negative sequence $\{a_n\}_{n \geq 1}$, and $p>1$. This inequality is
known in the literature as the classical discrete Hardy inequality. It has been
widely studied and several applications and new versions have been shown.
  In this work, we use a characterization of a weighted version of this
inequality to exhibit a sufficient condition for the existence of solutions of
the differential equation ${\rm div}\,{\bf u}=f$ in weighted Sobolev spaces
over a certain plane irregular domain. The solvability of this equation is
fundamental for the analysis of the Stokes equations.
  The proof follows from a local-to-global argument based on a certain
decomposition of functions which is also of interest for its applications to
other inequalities or related results in Sobolev spaces, such as the Korn
inequality.
