Special equipment: a mandoline
Preheat the oven to 375 degrees F. Butter a 9-by-13-inch baking dish and set aside.
Heat the cream, milk, garlic, 1 teaspoon salt and 1/4 teaspoon pepper in a small saucepan over medium heat until simmering. Reduce the heat to low and simmer until the liquid has reduced slightly, about 10 minutes. Turn off the heat.
Peel the potatoes and slice into thin (about 1/8-inch thick) medallions on a mandoline. (If you do not have a mandoline, use a sharp knife to slice the potatoes as thinly as you can.)
Layer one-third of the potato slices, overlapping slightly, in the baking dish and sprinkle one-third of the cheese on top. Repeat with the potatoes and cheese until you have three layers of potatoes. Sprinkle the remaining cheese and the rosemary on top. Pour over the cream mixture.
Bake until the cheese is golden brown and the liquid is bubbling around the edges, 50 to 60 minutes. If the top isn't golden brown after 60 minutes, broil for a few minutes to color and crisp the cheese. Cover with foil and let stand for 5 to 10 minutes before serving.
This dish is best assembled and baked the same day.