How is average precision related to the precision-recall curve?
Let $p(r)$ be the best precision which can be achieved at recall $r$. The average precision is
$$ p_{avg} = \int_0^1 p(r) \, dr. $$
Let $r(p)$ be the best recall which can be achieved at precision $p$. The average recall is
$$ r_{avg} = \int_0^1 r(p) \, dp. $$
Notice that the functions $p(r)$ and $r(p)$ are inverses of one another.

We can express these quantities using the function $\chi(p,r)$, which is 1 if precision $p$ and recall $r$ are achievable at the same time, and 0 otherwise.
We have $p(r) = \int_0^1 \chi(p,r) \, dp$, and so
$$ p_{avg} = \int_0^1 \int_0^1 \chi(p,r) \, dp dr. $$
Similarly, $r(p) = \int_0^1 \chi(p,r) \, dr$, and so
$$ r_{avg} = \int_0^1 \int_0^1 \chi(p,r) \, dr dp. $$
As a consequence, $p_{avg} = r_{avg}$.

Yet another interpretation of this common quantity is the area below the precision–recall curve. It is also the area below the ROC curve.