Cut fennel in half lenghways and slice each half thinly. Peel and slice the red onion thinly.
Heat the olive oil in a pan and cook the onion until softened. Add 2 of the minced garlic cloves and mix.
Add the sliced fennel and cook, stirring regularly, until soft and lightly golden.
Score a cross in the top of each tomato and plunge into boiling water for a minute. Drain and peel the skin off, then chop them roughly and add to the fennel. Cook, stirring regularly, until tomato is softened.
Season the mixture well and spread in a greased gratin dish.
Mix together the breadcrumbs, final minced garlic clove, parmesan and lemon zest. Spread over the fennel mixture. If you want the gratin to be extra-cheesy, at this point sprinkel the grated gruyere over the top of the breadcrumbs.