Pre-heat oven to 190°C (170°C fan-forced). Heat oil in a large frying pan. Add onion and garlic, cooking for several minutes until tender. Add carrot, celery and tomato paste. Cook a further minute.
Add stock, lentils, sauce and thyme to pan, bring to the boil, reduce heat and simmer for 20 minutes until lentils are just tender. Stir in peas and parsley, season well.
Meanwhile, place sweet potato in a large saucepan covered with water. Boil until tender and drain well. Mash sweet potato with butter and add milk and seasonings, mixing until smooth.
Pour lentil mixture into a 6 cup capacity baking dish. Top with sweet potato mixture and sprinkle with cheese. Bake for 25 minutes.