Remove the papery covering of the garlic heads but do not peel and do not separate the cloves
Wrap well in foil and put them in the oven
Put the onions on a double sheet of foil but do not wrap them; put them in the oven
Pierce the potatoes in several places with a thin skewer or the tines of a fork
Place them directly on the oven rack
Bake the garlic for one hour and the onions and the potatoes for an hour and a half at 425F degrees
After an hour pull out the garlic heads unwrap and let cool for 5 minutes
Separate the cloves and squeeze them over a bowl so the softened garlic pops out into the bowl
After 1 1/4 hours pull out the onions and potatoes
If the onions are not very soft almost collapsed put them back in for a few minutes
Perforate the potatoes lengthwise and crosswise with the tines of a fork and squeeze
Scoop the potato flesh into a bowl and mash it with a potato masher
With a sharp knife cut off the stem and root ends of the onions
Remove the skin and the first layer
Put the onions in a food processor and puree
Combine the potatoes garlic onion 1/4 cup of cream and salt and pepper in the bowl of a mixer
Beat with the paddle blade until smooth and blended then scrape the mixture into a large gratin bowl
Sprinkle the top with cheese
The recipe can be made ahead to this point and kept in the refrigerator covered for a day or so Bring to room temperature before proceeding Reduce the oven temperature to 350 degrees F
Pour the remaining cream over the mixture
Bake uncovered for 40-50 minutes or until the top is browned and bubbly and the cream has cooked down to a very thick suace-like consistency
Try to arrange to have some leftovers; this is very good when it is cold