  In this paper we prove off-diagonal, limited range, multilinear,
vector-valued, and two-weight versions of the Rubio de Francia extrapolation
theorem in general quasi-Banach function spaces. We prove mapping properties of
the generalization of the Hardy-Littlewood maximal operator to very general
bases that includes a method to obtain self-improvement results that are sharp
with respect to its operator norm. Furthermore, we prove bounds for the
Hardy-Littlewood maximal operator in weighted Lorentz, variable Lebesgue, and
Morrey spaces, and recover and extend several extrapolation theorems in the
literature. Finally, we provide an application of our results to the Riesz
potential and the Bilinear Hilbert transform.
