Formation and evolution of protostellar accretion discs. I.
  Angular-momentum budget, gravitational self-regulation, and numerical
  convergence
  We investigate the formation and early evolution of a protostellar disc from
a magnetized pre-stellar core using non-ideal magnetohydrodynamic (MHD)
simulations including ambipolar diffusion and Ohmic dissipation. The dynamical
contraction of the pre-stellar core ultimately leads to the formation of a
first hydrostatic core, after ambipolar diffusion decouples the magnetic field
from the predominantly neutral gas. The hydrostatic core accumulates angular
momentum from the infalling material, evolving into a rotationally supported
torus; this `first hydrostatic torus' then forms an accreting protostar and a
rotationally supported disc. The disc spreads out by gravitational instability,
reaching $\sim$30 au in diameter at $\sim$3 kyr after protostar formation. The
total mass and angular momentum of the protostar-disc system are determined
mainly by accretion of gas from an infalling pseudo-disc, which has low
specific angular momentum because of magnetic braking; their removal from the
protostar-disc system by outflow and disc magnetic braking are negligible, in
part because the magnetic field is poorly coupled there. The redistribution of
angular momentum within the protostar-disc system is facilitated mainly by
gravitational instability; this allows formation of relatively large discs even
when the specific angular momentum of infalling material is low. We argue that
such discs should remain marginally unstable as they grow (with Toomre $Q\sim
1$-$2$), an idea that is broadly consistent with recent observational estimates
for Class 0/I discs. We discuss the numerical convergence of our results, and
show that properly treating the inner boundary condition is crucial for
achieving convergence at an acceptable computational cost.
