Preheat the oven to 200°C/fan 180°C/gas mark 6. In a large pan, heat 1 tbsp oil over a medium heat and sweat the onion, carrot and celery for 10 minutes until very soft and starting to caramelise. Add the sliced garlic and rosemary and continue to cook for 1 minute before adding the tomato purée. Cook for 2-3 minutes.
Add the fresh and dried mushrooms to the pan with the flour, reserving the liquid. Fry for 2-3 minutes, then add the mushroom liquid, stock, tinned tomatoes and balsamic. Bring to the boil, then reduce the heat and simmer for 15 minutes or until the liquid is starting to reduce.
Add the lentils and continue to simmer for 10 minutes, or until the sauce is thick and glossy.
Meanwhile, blanch the potatoes for 4-5 minutes, until just tender. Transfer the lentils to a large pie dish. Arrange the potatoes on top so they overlap in circles. Mix the crushed garlic with the remaining oil and brush over the potato. Bake in the oven for 35-40 minutes or until the potatoes are crisp and golden.