Last night at dinner, this old topic came up (tomato is really a fruit, corn is really a grain), and we told our son that it was indeed true, but we couldn't tell him why. What's the actual definition of fruit, grain, and vegetable? Linda has the answer: grains are seeds, fruit is anything that carries seeds, and vegetables are everything else.
Want more fruit and seed knowledge? Try Fruit and Seed Anatomy. Of course, as you get into the real details, things get complicated. As with any attempt to classify nature, the actual diversity conflicts with our desire for straightforward categories.
For example, Fruit Types and Classification of Fruits says both, "what constitutes a fruit is straightforward" and, "a few 'vegetables' are difficult; broccoli and cauliflower are inflorescence buds".
And remember the simple taxonomy of kingdom, phylum, class, order, etc? At the top were the plant kingdom and the animal kingdom, with animals divided into vertebrates and invertebrates? The Tree of Life says you're wrong.