Vegetable is a culinary category but not a botanical one. Fruit is a botanical and a culinary category and the two categories overlap but are not identical. Tomatoes are fruits (botanically) and vegetables (culinarily) but not fruits (culinarily).
Rules:
Vegetable is a culinary category but not a botanical one. Fruit is a botanical and a culinary category and the two categories overlap but are not identical. Tomatoes are fruits (botanically) and vegetables (culinarily) but not fruits (culinarily).