Slice the aubergines into rounds and lightly brush them with olive oil. Roast them in a preheated oven until soft and slightly golden. This step removes bitterness and gives a silky texture.
If using dried lentils, cook them in water until tender but not mushy. Drain well and set aside. Keeping them slightly firm helps maintain structure in the dish.
Heat oil in a pan and sauté onion, garlic, carrot, and celery until softened. Add tomatoes, tomato paste, herbs, and cooked lentils. Simmer until thick and rich in flavor.
Start with a layer of lentil sauce, followed by aubergine slices. Repeat the layers until everything is used up. Finish with a generous topping of mozzarella and parmesan.
Place the dish in the oven and bake until the cheese is melted and golden. Let it rest for a few minutes before serving so the layers set properly.