Heat the oven to 400°F and grease a 9-by-13-inch baking dish.
Boil the potatoes in salted water for 15 to 18 minutes, until very tender, then drain and mash them with 2 tablespoons butter, milk and 1/2 teaspoon salt.
Melt the remaining butter in a large skillet and cook the onion, carrots and mushrooms for 9 minutes, until browned and nearly dry.
Stir in the tomato paste and thyme for 1 minute, then add the lentils, broth, vegetarian sauce, remaining salt and pepper.
Simmer the filling for 8 to 10 minutes, until thick enough that a spoon drawn through it leaves a visible path.
Spread the filling in the dish and spoon the potatoes over it, roughing the surface with a fork.
Bake for 25 to 30 minutes, until the filling bubbles at the edges and the potato ridges brown.
Rest for 10 minutes before serving.