In this paper, a new type of the discrete fractional Grönwall inequality is developed, which is applied to analyze the stability and convergence of a Galerkin spectral method for a linear timefractional subdiffusion equation. Based on the temporal-spatial error splitting argument technique, the discrete fractional Grönwall inequality is also applied to prove the unconditional convergence of a semi-implicit Galerkin spectral method for a nonlinear time-fractional subdiffusion equation.1 method for the initial value problem. For example, piecewise linear interpolation yields the widely applied L1 method [22,19]. High-order interpolation can also be applied, see [3,12,30]. The FLMM [23,24,25] provides another general framework for constructing high-order methods to discretize the fractional integral and derivative operators. The FLMM inherits the stability properties of linear multistep methods for initial value problem, which greatly facilitates the analysis of the resulting numerical scheme, in a way often strikingly opposed to standard quadrature formulas [25]. Up to now, the FLMM has been widely applied to discretize the model (1.1) and its variants.It is well known that the classical discrete Grönwall inequality plays an important role in the analysis of the numerical methods for time-dependent partial differential equations (PDEs). Due to the lack of a generalized discrete Grönwall type inequality for the time-stepping methods of the time-dependent fractional differential equations (FDEs), the analysis of the numerical methods for time-dependent FDEs is more complicated. Recently, a discrete fractional Grönwall inequality has been established by Liao et al. [13,19,20,21] for interpolation methods to solve linear and nonlinear time-dependent FDEs. Jin et al. [8] proposed a criterion for showing the fractional discrete Grönwall inequality and verified it for the L1 scheme and convolution quadrature generated by backward difference formulas.Till now, there have been some works on the numerical analysis of nonlinear time-dependent FDEs. The stability and convergence of L1 finite difference methods were obtained for a timefractional nonlinear predator-prey model under the restriction LT β < 1/Γ(1 − β) in [27], where L is the Lipschitz constant of the nonlinear function, depending upon an upper bound of numerical solutions [17]. Such a condition implied that the numerical results just held locally in time and certain time step restriction condition (see, e.g., [2,7]) were also required. Similar restrictions also appear in the numerical analysis for the other fractional nonlinear equations (see, e.g. [16,15]). In order to avoid such a restriction, the temporal-spatial error splitting argument (see, e.g., [10]) is extended to the numerical analysis of the nonlinear time-dependent FDEs (see, e.g., [14,17]). Li et al. proposed unconditionally convergent L1-Galerkin finite element methods (FEMs) for nonlinear time-fractional Schödinger equations [14] and nonlinear time-fractional subdiffusion equations[17], respectively....