How much space do I give a tree in a garden?

I have a house on a pretty normal size lot, with a front and back lawn. Each lawn has a tree more or less centered in the lawn. One lawn has an oak; the other has a willow (I think, I'm not good at identifying trees). I'd like to turn the lawn that has the willow tree into a vegetable garden. However, I don't want to damage the tree; I'd like to keep it there.
How much space should I give the tree if I'm going to be digging up the ground for planting and harvesting vegetables?
What about if I use raised planting beds on top of what is currently the lawn? Does that change how much space I should leave the tree?
I've read your answer about trees and sidewalks, but digging and adding planting beds may be different. In particular, they should allow more water through than most sidewalks. But, on the other hand, the digging may directly damage the roots or the structural stability of the plant in a way that adding a sidewalk wouldn't.

Your question is not easy to answer. There are several factors.
1. trees need space to develop a wide and extensive root system as they mature. Gardening within the current and future root zone area may have detrimental effects on the tree and also be competitive for the underlying plants, for shading of vital sunlight, and uptake of water and nutrients.

2. The willow tree is a water lover, growing on the side of creeks and ponds in their native habitat. They can tolerate the lawn and frequent irrigation better than oaks. Oaks and lawns are not compatible, so if you have a choice, I would recommend sacrificing the oak to create your unobstructed gardening space, because it will likely decline due to root rot from overwatering. And the oak will be more sensitive to nutrient excess and over watering from the vegetable beds.

3. digging and cutting roots, whether for sidewalk or planting bed is never a good thing for the tree, and yes it can compromise tree health and structural integrity. Stay as far away from the tree as possible.
A guideline used in arboriculture for protection of tree roots is based on the diameter of the tree trunk. If the trunk diameter in a 20 year time-frame will be 12 to 16 inches, then you should stay 12 to 16 feet away with any root cutting or paving.