Pre-heat your oven to 375.
Rub the garlic clove on the inside of a 9x12 baking dish. Generously rub butter on the bottom and sides of the dish.
Cut the ham into 1 inch dice so that you have about 1 cup. If you use Canadian bacon, which tends to have a stronger, smokier flavor, use only about ¾ cup. Set it aside.
Grate the Gruyere and set it aside.
Prepare the leek by cutting it length wise so you can wash out any grit or dirt lodge between the layers. Slice the two halves into ⅛ inch half-moons. Saute the leeks on medium/low heat in 2 tbsp of butter being careful not to let them brown. Salt and pepper to taste and continue cooking until they have softened. Set the leeks aside.
Do not peel the potatoes, since there are flavor and nutrients that will be lost. Slice the potatoes into ⅛ inch thick rounds with a mandoline, if you have one. If not, cut the potatoes lengthwise in half. Place the cut side down on the cutting board and slice the halves into ⅛ inch thick half-moons. Place the potatoes, milk and cream, thyme leaves, grated nutmeg, and garlic into a 2-3 quart pan. Bring the mixture to a boil and turn down immediately, and let simmer for a couple of minutes. You don't want to let the potatoes cook through because that will fall apart and not retaiin their shape in the final gratin. Turn off the heat and let sit to cool for about 10 minutes.
With a large spoon, carefully spread ⅓ of the potatoes in the dish. Sprinkle ⅓ of the leeks, ⅓ of the cheese, and ⅓ of the ham over the potatoes. Spread another ⅓ of the potatoes, the leeks, cheese, and ham. Then, spread the last of the potatoes, leeks, cheese, and ham and pour the remaining milk and cream over the whole.
Cover the dish with a piece of parchment paper and place a piece of foil over that and tuck in around the dish. Place into the oven and let cook for 35-45 minutes. It will be nearly done when a butter knife or fork go into the center of the dish with almost no resistance. Uncover the potatoes and place under the broiler for a few minutes until the top of the casserole is golden brown. Remove from the oven and let sit covered with the foil you used earlier, for about 15 minutes.