Step 1Heat the oven to 350 degrees. Butter a medium (about 12-inch-by-9-inch) gratin dish. If using whole celery bunches, remove the tough outer stalks and trim the dark, dried out parts of the base, leaving enough of the base that the stalks will hold together. Trim the tops so the bunch is about 5 to 6 inches long; set the trimmed tops aside for another use.
Step 2Blanch the celery hearts in a big pot of simmering, well-salted water for 10 minutes. Don't let the water boil too hard, or the celery will start to break apart.
Step 3Cut the leek in quarters lengthwise, leaving it attached at the base, and rinse away any sand under cold running water. Slice the leek finely into crosswise strips and scatter across the bottom of a well-buttered gratin dish.
Step 4When the celery hearts are cool enough to handle, cut each bunch in half lengthwise and arrange in the gratin dish. Pour over the stock. If necessary to thoroughly moisten the leeks add a little more stock or water (the leeks should be moist but not swimming in liquid; the celery should be mostly above the liquid). Season with three-fourths teaspoon salt, or to taste.
Step 5Cover the dish tightly with aluminum foil and bake until the celery is meltingly tender, about 1 to 1 1/2 hours.
Step 6When the celery is done, remove the foil and carefully pour the broth through a strainer into a small saucepan and add the grated cheese. Place the saucepan over high heat to reduce the broth to a glaze, about 5 minutes. Pour this over the celery and serve.