We give a proof of the Nirenberg-Treves conjecture: that local solvability of principal-type pseudo-differential operators is equivalent to condition ($\Psi$). This condition rules out sign changes from $-$ to $+$ of the imaginary part of the principal symbol along the oriented bicharacteristics of the real part. We obtain local solvability by proving a localizable a priori estimate for the adjoint operator with a loss of two derivatives (compared with the elliptic case).
The proof involves a new metric in the Weyl (or Beals-Fefferman) calculus which makes it possible to reduce to the case when the gradient of the imaginary part is nonvanishing, so that the zeroes form a smooth submanifold. The estimate uses a new type of weight, which measures the changes of the distance to the zeroes of the imaginary part along the bicharacteristics of the real part between the minima of the curvature of the zeroes. By using condition ($\Psi$) and the weight, we can construct a multiplier giving the estimate.