Driven periodic elastic systems such as charge-density waves (CDWs) pinned by impurities show a nontrivial, glassy dynamical critical behavior. Their proper theoretical description requires the functional renormalization group. We show that their critical behavior close to the depinning transition is related to a much simpler model, O(n) symmetric ϕ^{4} theory in the unusual limit of n→-2. We demonstrate that both theories yield identical results to four-loop order and give both a perturbative and a nonperturbative proof of their equivalence. As we show, both theories can be used to describe loop-erased random walks (LERWs), the trace of a random walk where loops are erased as soon as they are formed. Remarkably, two famous models of non-self-intersecting random walks, self-avoiding walks and LERWs, can both be mapped onto ϕ^{4} theory, taken with formally n=0 and n→-2 components. This mapping allows us to compute the dynamic critical exponent of CDWs at the depinning transition and the fractal dimension of LERWs in d=3 with unprecedented accuracy, z(d=3)=1.6243±0.001, in excellent agreement with the estimate z=1.62400±0.00005 of numerical simulations.