Bring a large pot of water to a boil; add salt. Add florets, and cook until just tender, about 6 minutes. Drain in a colander, and rinse under cold running water until cool. Let dry on paper towels.
Preheat oven to 400 degrees. Finely chop stems to make 1 1/2 cups. Melt butter in a large skillet over medium heat; add stems, shallots, and garlic. Season with salt and pepper. Cook, stirring occasionally, until pale golden brown, about 4 minutes. Add wine, stock, and cream. Simmer, stirring occasionally, until liquid has reduced by about half, 10 to 12 minutes. Let cool slightly. Stir in horseradish, and season with salt, pepper, and nutmeg. Puree mixture in a blender until smooth. Stir in thyme.
Spread florets and chestnuts in a 9-by-12-inch oval gratin dish. Season with salt and pepper. Pour puree on top, and gently stir to combine slightly. Sprinkle with cheese. Bake until bubbling and just golden brown, 30 to 35 minutes.