Let and apply the Itô formula to for . The heat equation cancels the drift, so the stopped process is a bounded martingale. The optional sampling theorem for a supermartingale gives . On the three mutually exclusive terminal events, the initial and Dirichlet boundary conditions identify this value as
This is the probabilistic representation of the heat equation with time-dependent Dirichlet data.