Peel the onions, leaving and washing any root strand you may find.
In a 12 to14-inch saute pan over a medium high flame, heat virgin olive oil until just smoking. Add butter and cook until foam subsides. Add onions and saute until light golden brown on all sides, about 8 to 10 minutes. Add sugar, vinegar, tomato sauce and water and bring to a boil. Cook onions uncovered, until just al dente, about 10 minutes. If liquid dissipates too quickly, add more water, a 1/4 cup at a time, realizing that it is essential not to overcook the onions. The sauce should just adhere to the onions. Remove from saute pan to an earthenware dish and hold in a warm place, or allow to cool if you are serving them later or as an antipasto.
Saute the onion and garlic in the olive oil over medium heat until translucent, but not brown (about 10 minutes). Add the thyme and carrot and cook 5 minutes more. Add the tomatoes. Bring to a boil, lower the heat to just bubbling, stirring occasionally for 30 minutes. Season with salt to taste. Serve immediately, or set aside for further use. The sauce may be refrigerated for up to one week or frozen for up to 6 months.
Recipe courtesy of Mario Batali