I'm sorry, your first statement is a little weird. If there are actually only enough resources to produce 1 hammer, yes, of course you're depriving your neighbor of a hammer and it'd be better for both of you to share it.
The rest of your argument is obviously fine, just the first part doesn't make sense.