Full Idea
Leibniz's definition is as follows: Things are the same as each other, of which one can be substituted for the other without loss of truth ('salva veritate').
Gist of Idea
Things are the same if one can be substituted for the other without loss of truth
Source
Gottfried Leibniz (works [1690]), quoted by Gottlob Frege - Grundlagen der Arithmetik (Foundations) §65
Book Reference
Frege,Gottlob: 'The Foundations of Arithmetic (Austin)', ed/tr. Austin,J.L. [Blackwell 1980], p.76
A Reaction
Frege doesn't give a reference. (Anyone know it?). This famous definition is impressive, but has problems when the items being substituted appear in contexts of belief. 'Oedipus believes Jocasta (his mother!) would make a good wife'.