# The Duality of Similarity and Metric Spaces
## 4 Similarity Space Revisited  
Especially in the last two decades, the research and development of a formal definition of similarity metric (or similarity space) has begun. The new applications and the purpose of this article call for a general consensus and search for well-defined axiomatic systems and theoretical foundations instead of using a non-intuitive duality with the distance. Based on [1,4] we introduce a modified axiomatic system for a similarity metric, which is in agreement with the current notions but simplified so as to be a minimal axiomatic system. **Definition 3** (Similarity Space). : _Given a non-empty set \(\mathbf{X}\), a function \(s\colon\mathbf{X}\times\mathbf{X}\to\mathbb{R}\) is a similarity metric if for all subsets \(x,y,z\in\mathbf{X}\), it satisfies the following conditions:_  
1. \(s(x,y)=s(y,x)\) (symmetry),
2. \(s(x,z)+s(y,y)\geq s(x,y)+s(y,z)\) (triangle inequality),
3. \(s(x,x)=s(x,y)=s(y,y)\Longleftrightarrow x=y\) (identity of indiscernibles),
4. \(s(x,y)\geq 0\) (non-negativity). _A similarity space is an ordered pair \((\mathbf{X},s)\)._  
Compared to the original system, we have removed the axiom of bounded self-similarity, which can be derived from the remaining axioms. **Theorem 1** (Bounded Self-Similarity). : _A similarity metric satisfies \(s(x,y)\leq\frac{s(x,x)+s(y,y)}{2}\)._  
Proof. : Appendix A.1. A few issues require attention. The name'similarity metric' is an already proposed convention. Calling it a'metric' should be understood in the sense of monotonously decreasing convex transformation of a partial metric or a distance metric that will be shown further in the next section. By this way we avoid misunderstanding. Unlike D3, \(d(x,x)=0\), the similarity metric has an upper bound in \(\frac{s(x,x)+s(y,y)}{2}\) and allows \(s(x,x)\
eq s(y,y)\). At first sight, this may seem counter-intuitive: \(x\) is more (or less) similar to itself than \(y\). In spatial considerations of dissimilarity and distance, this does not arise since \(d(x,x)=0\) for all objects. Similarity depends on the set of common features, and the result is the possibility of non-identical self-similarities. If we interpret such common features as 'description lengths' or 'complexities', unequal self-similarities become quite natural, and if \(x\) has more features than \(y\), we have \(s(x,x)>s(y,y)\)[1]. For instance, having a German word \(x=\)'Einkommensetwearerklarung' (income tax return) and \(y=\)'Steuer' (tax), then \(s(x,x)\geq s(y,y)\) when counting common characters or q-grams. We suggest in addition having non-negativity in S4 because the similarity metric doesn't have a direction--in contrast to a vector, it is a scalar value, and so it doesn't make sense to assign to it a negative sign, similar to non-negativity in a metric space. The same principle should be valid for a similarity metric as a requirement for'symmetric measurement'. The distance between objects remains the same when we measure a distance from another direction. The second reason follows from measure theory (see Appendix A.6), where there is a non-negativity condition \(\mu(\mathbf{X})\geq 0\) for a measure \(\mu\) on the set \(\mathbf{X}\). At first glance, it is not clear how the axiom of the triangle inequality was formed, just let us refer to related Theorem 6. **Theorem 2** (Linear Transformation). : _Every positive linear transformation \(T_{L}\colon\mathbb{R}^{+}\to\mathbb{R}^{+}\) of a similarity metric is a similarity metric:_  
\[s_{L}(x,y)=T_{L}(s(x,y))=\alpha s(x,y)+\beta \tag{1}\]  
_where \(\alpha,\beta\in\mathbb{R}\) and \(\alpha>0,\beta\geq 0\)._  
Proof. : Appendix A.2. This theorem allows us to apply any linear standardization or re-scaling without any violations of the axioms. In statistics, there is very often used a standard score  
\[X^{\prime}=\frac{X-\mu_{s}}{\sigma_{s}}, \tag{2}\]  
where \(\mu_{s}\) is the mean and \(\sigma_{s}\) is the standard deviation.