A major obstacle for the transformation to a low-carbon economy is the risk of a carbon lock-in: fossil fuel-based ('dirty') technologies dominate the market although their carbon-free ('clean') alternatives are dynamically more efficient. We study the interaction of learning-by-doing spillovers and the substitution elasticity between the clean and the dirty sector in an intertemporal general equilibrium model. We find that the substitution possibilities between the two sectors have an ambivalent effect: although a high substitution elasticity requires less aggressive mitigation policies than a low one, it creates a greater lock-in in the absence of regulation. The optimal policy response consists of a permanent carbon tax as well as a learning subsidy for clean technologies. A single policy instrument can also avoid high welfare losses, but a more stringent mitigation target can only be achieved at painful costs. We demonstrate that the policy implication of [Acemoglu et al. 2012] is limited in scope. Our numerical results also highlight that infrastructure provision is crucial to facilitate the low-carbon transformation.