In a large dutch oven, sweat the onion, celery and carrot in a little olive oil over medium heat until soft and beginning to colour.
Add the garlic and cook 2 minutes.
Add the mushrooms, rosemary and stock and bring to a boil.
Boil 10 minutes or so fairly gently so the lentils have time to start absorb the stock and then turn to a simmer until the lentils are soft. If you are using canned lentils, just bring it to a boil before turning it down straight away. Simmer until there is not much water left in the pot.
Meanwhile, add the white potato and sweet potato to a pot of salted water and bring to a boil.
Boil until potatoes are soft, then drain.
Mash the potatoes with butter, milk and a little salt and pepper.
Spread the lentils out into a large baking dish and top with the mashed potato.
Sprinkle the grated cheese over, and sprinkle again with a little extra rosemary and cracked black pepper.