# Johnson–Lindenstrauss lemma

In mathematics, the Johnson–Lindenstrauss lemma is a result named after William B. Johnson and Joram Lindenstrauss concerning low-distortion embeddings of points from high-dimensional into low-dimensional Euclidean space. The lemma states that a set of points in a high-dimensional space can be embedded into a space of much lower dimension in such a way that distances between the points are nearly preserved. The map used for the embedding is at least Lipschitz, and can even be taken to be an orthogonal projection.

The lemma has uses in compressed sensing, manifold learning, dimensionality reduction, and graph embedding. Much of the data stored and manipulated on computers, including text and images, can be represented as points in a high-dimensional space (see vector space model for the case of text). However, the essential algorithms for working with such data tend to become bogged down very quickly as dimension increases.[1] It is therefore desirable to reduce the dimensionality of the data in a way that preserves its relevant structure. The Johnson–Lindenstrauss lemma is a classic result in this vein.

Also, the lemma is tight up to a constant factor, i.e. there exists a set of points of size m that needs dimension

${\displaystyle \Omega \left({\frac {\log(m)}{\varepsilon ^{2}}}\right)}$

in order to preserve the distances between all pair of points.[2]

## Lemma

Given ${\displaystyle 0<\varepsilon <1}$, a set ${\displaystyle X}$ of ${\displaystyle m}$ points in ${\displaystyle \mathbb {R} ^{N}}$, and a number ${\displaystyle n>8\ln(m)/\varepsilon ^{2}}$, there is a linear map ${\displaystyle f:\mathbb {R} ^{N}\rightarrow \mathbb {R} ^{n}}$ such that

${\displaystyle (1-\varepsilon )\|u-v\|^{2}\leq \|f(u)-f(v)\|^{2}\leq (1+\varepsilon )\|u-v\|^{2}}$

for all ${\displaystyle u,v\in X}$.

The formula can be rearranged:

${\displaystyle (1+\varepsilon )^{-1}\|f(u)-f(v)\|^{2}\leq \|u-v\|^{2}\leq (1-\varepsilon )^{-1}\|f(u)-f(v)\|^{2}}$

One proof of the lemma takes ƒ to be a suitable multiple of the orthogonal projection onto a random subspace of dimension ${\displaystyle n}$ in ${\displaystyle \mathbb {R} ^{N}}$, and exploits the phenomenon of concentration of measure.

Obviously an orthogonal projection will, in general, reduce the average distance between points, but the lemma can be viewed as dealing with relative distances, which do not change under scaling. In a nutshell, you roll the dice and obtain a random projection, which will reduce the average distance, and then you scale up the distances so that the average distance returns to its previous value. If you keep rolling the dice, you will, in polynomial random time, find a projection for which the (scaled) distances satisfy the lemma.

## Alternate statement

A related lemma is the distributional JL lemma. This lemma states that for any 0 < ε, δ < 1/2 and positive integer d, there exists a distribution over Rk × d from which the matrix A is drawn such that for k = O(ε−2log(1/δ)) and for any unit-length vector xRd, the claim below holds.[3]

${\displaystyle P(|\Vert Ax\Vert _{2}^{2}-1|>\varepsilon )<\delta }$

One can obtain the JL lemma from the distributional version by setting ${\displaystyle x=(u-v)/\|u-v\|_{2}}$ and ${\displaystyle \delta <1/n^{2}}$ for some pair u,v both in X. Then the JL lemma follows by a union bound over all such pairs.

## Speeding up the JL transform

Given A, computing the matrix vector product takes O(kd) time. There has been some work in deriving distributions for which the matrix vector product can be computed in less than O(kd) time. There are two major lines of work. The first, Fast Johnson Lindenstrauss Transform (FJLT),[4] was introduced by Ailon and Chazelle in 2006. Another approach is to build a distribution supported over matrices that are sparse.[5] [6]

## Notes

1. ^ For instance, writing about nearest neighbor search in high-dimensional data sets, Jon Kleinberg writes: "The more sophisticated algorithms typically achieve a query time that is logarithmic in n at the expense of an exponential dependence on the dimension d; indeed, even the average case analysis of heuristics such as k-d trees reveal an exponential dependence on d in the query time. Kleinberg, Jon M. (1997), "Two Algorithms for Nearest-neighbor Search in High Dimensions", Proceedings of the Twenty-ninth Annual ACM Symposium on Theory of Computing, STOC '97, New York, NY, USA: ACM, pp. 599–608, doi:10.1145/258533.258653, ISBN 0-89791-888-6.
2. ^ Kasper Green Larsen; Jelani Nelson (2017). Optimality of the Johnson-Lindenstrauss Lemma. Proceedings of the 58th Annual IEEE Symposium on Foundations of Computer Science (FOCS). p. 633-638. doi:10.1109/FOCS.2017.64.
3. ^ Johnson, William B.; Lindenstrauss, Joram (1984). "Extensions of Lipschitz mappings into a Hilbert space". In Beals, Richard; Beck, Anatole; Bellow, Alexandra; et al. Conference in modern analysis and probability (New Haven, Conn., 1982). Contemporary Mathematics. 26. Providence, RI: American Mathematical Society. pp. 189–206. doi:10.1090/conm/026/737400. ISBN 0-8218-5030-X. MR 0737400.
4. ^ Ailon, Nir; Chazelle, Bernard (2006). "Approximate nearest neighbors and the fast Johnson–Lindenstrauss transform". Proceedings of the 38th Annual ACM Symposium on Theory of Computing. New York: ACM Press. pp. 557–563. doi:10.1145/1132516.1132597. ISBN 1-59593-134-1. MR 2277181.
5. ^ Kane, Daniel M.; Nelson, Jelani (2014). "Sparser Johnson-Lindenstrauss Transforms". Journal of the ACM. 61 (1): 1. arXiv:1012.1577. doi:10.1145/2559902. MR 3167920.
6. ^ Kane, Daniel M.; Nelson, Jelani (2012). "Sparser Johnson-Lindenstrauss Transforms". Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms,. New York: Association for Computing Machinery (ACM). pp. 1195–1203. ISBN 978-1-611972-11-5. MR 3205284.