Rinse the lentils and simmer in plenty of water for 20 minutes until tender. Drain and set aside.
Meanwhile, boil the sweet potato cubes for 15 minutes until soft. Drain, then mash with the butter and milk. Set aside.
Heat the olive oil in a frying pan. Add the onion and carrots and cook for 8 minutes until soft.
Add the garlic, tomato puree, rosemary and thyme. Cook for 1 minute.
Stir in the cooked lentils and vegetable stock. Simmer for 5 minutes until the liquid thickens.
Transfer the lentil mixture to an ovenproof dish. Spread the sweet potato mash on top.
Bake at 200C for 20 minutes until the top is golden and the filling is bubbling.