  We present a general framework for the rigorous numerical analysis of
time-fractional nonlinear parabolic partial differential equations, with a
fractional derivative of order $\alpha\in(0,1)$ in time. The framework relies
on three technical tools: a fractional version of the discrete Gr\"onwall-type
inequality, discrete maximal regularity, and regularity theory of nonlinear
equations. We establish a general criterion for showing the fractional discrete
Gr\"onwall inequality, and verify it for the L1 scheme and convolution
quadrature generated by BDFs. Further, we provide a complete solution theory,
e.g., existence, uniqueness and regularity, for a time-fractional diffusion
equation with a Lipschitz nonlinear source term. Together with the known
results of discrete maximal regularity, we derive pointwise $L^2(\Omega)$ norm
error estimates for semidiscrete Galerkin finite element solutions and fully
discrete solutions, which are of order $O(h^2)$ (up to a logarithmic factor)
and $O(\tau^\alpha)$, respectively, without any extra regularity assumption on
the solution or compatibility condition on the problem data. The sharpness of
the convergence rates is supported by the numerical experiments.
