# The Duality of Similarity and Metric Spaces
## 5 Duality of Similarity and Metric Space
From this equation one can deduce that  
\[\mu(x\cup y)=\frac{s(x,x)+s(y,y)+d(x,y)}{2}.\]  
We can again return from a normalized similarity metric to a normalized similarity distance. **Theorem 11** (Generalized Rozinek Normalized Distance). : _Generalized Rozinek normalized distance is the following normalized distance metric_  
\[R_{GD_{n}}=\frac{2d(x,y)}{s(x,x)+s(y,y)+d(x,y)}, \tag{15}\]  
**Proof. ** Appendix A.14. \(\qed\)  
**Theorem 12** (Generalized Rozinek distance). : _Generalized Rozinek distance is the distance metric_  
\[R_{GD}(x,y)=\frac{s(x,x)+s(y,y)-s(x,x)s(x,y)-s(y,y)s(x,y)}{s(x,y)+1}, \tag{16}\]  
**Proof. ** Appendix A.15. \(\qed\)  
**6. Applications of Similarity Spaces**  
We will show how this is connected to some already well-known coefficients from previous developments of similarity space theory. **Theorem 13** (Jaccard Similarity). : _Jaccard similarity is a normalized similarity metric_  
\[J_{S}(x,y)=\frac{\mu(x\cap y)}{\mu(x\cup y)}, \tag{17}\]  
**Proof. ** Appendix A.16. \(\qed\)  
The Jaccard similarity is a fundamental similarity measure on sets. Whenever it is used, it is called mainly an index or a coefficient, but it is never called a proper similarity metric. Note that the nonexistence of a mathematical foundation on similarity metrics imposes the necessity of transforming the Jaccard index into the Jaccard distance \(J_{D}(x,y)=1-J_{S}(x,y)\) and then verifying the triangle inequality \(J_{D}(x,z)\leq J_{D}(x,y)+J_{D}(y,z)\) for that distance [14]. **Theorem 14** (Jaccard Distance). : _The Jaccard distance is a normalized distance metric_  
\[J_{D}(x,y)=1-\frac{\mu(x\cap y)}{\mu(x\cup y)}=\frac{\mu(x\triangle y)}{\mu( x\cup y)} \tag{18}\]  
**Proof.**[14]. \(\qed\)  
**Theorem 15** (Tanimoto Coefficient). : _The Tanimoto coefficient is a generalized Rozinek similarity_  
\[R_{GS}(x,y)=S(x,y)=\frac{s(x,y)}{s(x,x)+s(y,y)-s(x,y)}, \tag{19}\]  
**Proof. ** Appendix A.17. \(\qed\)  
**Theorem 16** (Steinhaus Distance [17]). : _Steinhaus distance is a generalized Rozinek normalized distance_  
\[R_{GS}(x,y)=\sigma_{\mu}(f,g)=\frac{\int|f(x)-g(x)|d\mu(x)}{\int\max\{|f(x)|, |g(x)|,|f(x)-g(x)|\}d\mu(x)}, \tag{20}\]  
**Proof. ** Appendix A.18. \(\qed\)  
**Theorem 17** (Ruzicka Similarity). : _Ruzicka similarity [3] (generalized Jaccard similarity [18]) is a generalized Rozinek similarity_  
\[R_{GS}(x,y)=J_{G}(x,y)=\frac{\sum_{k}\min\{x_{k},y_{k}\}}{\sum_{k}\max\{x_{k}, y_{k}\}}, \tag{21}\]  
**Proof. ** Appendix A.19. The distance derived from the Ruzicka similarity \(d_{n}(x,y)=1-J_{G}(x,y)\) is known by the name 'Soergel distance' [3]. **Theorem 18** (Gaussian Similarity). : _Gaussian similarity is a similarity metric_  
\[R_{GS}(x,y)=\frac{s(x,x)+s(y,y)-d(x,y)}{s(x,x)+s(y,y)+d(x,y)}, \tag{14}\]0  
Proof. : Appendix A.20. Gaussian similarity is relevant to the natural human and animal perception of similarity based on psychological research [19], where it is shown that a stimulus decays exponentially with the distance. Numerous experiments have provided empirical observations of learned responses to some measure of different stimuli. As the independent variable of a physical measure of the difference between two stimuli, there have been chosen, for example, the difference in wavelengths of light, frequencies of tones or angular orientations of shapes. **Theorem 19** (Rozinek Natural Distance). : _The Rozinek natural distance is a distance metric_  
\[R_{GS}(x,y)=\frac{s(x,x)+s(y,y)-d(x,y)}{s(x,x)+s(y,y)+d(x,y)}, \tag{14}\]1  
Proof. : Expressing \(d(x,y)\) from Theorem 18. This distance is derived from Gaussian similarity and describes an inverse problem of how human and animal perception treats a distance depending on the similarity. In addition, there is a limit \(\lim_{s(x,y)\to 0^{+}}R_{ND}(x,y)=+\infty\). In cases where the similarity measurement is only dependent on the distance and Jaccard-like similarities cannot be used directly, for example, for an edit distance--also called the \(k\)_difference problem_[20]--our similarity metric is very appropriate.