This tasty British classic isn't really a pie (in my book, that involves pastry), but the savoury minced lamb base topped with creamy mashed potato and cheese is certainly delicious. If you want to use beef instead of lamb, that's called Cottage Pie, and I'd suggest using parsley instead of rosemary, and beef stock instead of chicken stock.
For the meat sauce
Chop the onion and fry in a little vegetable oil until soft, then add the lamb. Break up the lamb and stir frequently around until it is brown all over. Chop the carrots into small dice (about 1cm / .5 inch), and the celery quite a bit smaller. Add to the pan and stir to get them all coated in the liquid that will have been released by the lamb. Add the stock, pepper and rosemary and bring to the boil, then reduce to a simmer. and cook for aabout 25 minutes. You should end up with a dry-ish sauce, not too much liquid. Place the meat sauce in a single layer in a casserole dish, and then put it in the fridge for half an hour. This allows the sauce to set a little so that it can support the weight of the potato topping.
For the potato topping
Peel the potatoes and cut into chunks. Boil in salted water until tender - about 20 minutes. Drain the potatoes and mash in the butter, milk, salt, pepper and chives. Grate the cheese.
Assemble and Bake
Preheat the oven to 200℃ (390℉). Carefully spread the potato in a single layer on top of the sauce - I find a wide spatula is good for doing this. Smooth the top, making sure the potato is in contact with the dish all around the edge. Make any kind of pattern you like on the surface of the potato - the idea is to form ridges of potato which will catch the heat and brown slightly. Sprinkle the grated cheese all over in a single layer.
Put the pie in the oven and bake for 30 minutes. Allow to cool slightly before serving.