Importance of complete and bi-continuous invariants for ML on data with real valuesThis paper formalizes practically important conditions for application-driven ML on real objects with ambiguous representations and develops new canonical representations satisfying these conditions for any clouds (finite sets) of unordered points in Euclidean space R n . Such a cloud is the most basic form of a real object from cars to molecules (Wang & Solomon, 2019), e.g. a set of corners or atoms.Many objects are rigid in the sense that their shape and properties are preserved under rigid motion composed of translations and rotations in R n (Atz et al., 2021), which form the group SE(n). The slightly weaker relation is by isometries (distance-preserving transformations), which form the group E(n). The practical cases are dimensions n ≤ 3 and larger numbers m (hundreds) of unordered points without outliers (Shi et al., 2021) because atoms have stable nuclei.. Correspondence to: Anonymous Author <anon.email@domain.com>.Preliminary work. Under review by the International Conference on Machine Learning (ICML). Do not distribute.Any rigid cloud has infinitely many representations, e.g. lists of point coordinates, but the shape and properties of an object should be independent of a coordinate system. Points are usually unordered and even simple molecules have many indistinguishable atoms. Hence predictions should not depend on point ordering. On another hand, different rigid classes of chemically identical molecules can have different functional properties such as solubility and hence therapeutic effectiveness. If not all rigid classes are distinguished, drugs can become useless, implying human suffering and financial losses for manufacturers (Morissette et al., 2003).A repeated scan or measurement of the same object can produce a slightly different cloud that cannot be exactly matched with the original one by rigid motion, also due to atomic vibrations (Feynman, 1971). If noise is ignored up to any threshold ε > 0, sufficiently many tiny perturbations make all clouds equivalent by the transitivity axiom: if A ∼ B and B ∼ C, then A ∼ C (Brink et al., 1997).Since all small deviations between rigid classes of point clouds should be distinguished, all these classes live in a continuous space of rigid clouds, see Fig. 1 (left). This space was continuously parametrized only in dimension n = 1 or for m = 3 points or Fig. 1   Machine learning previously focused on discrete classifications or success measures for finite datasets, which can be considered discrete samples (of measure 0) in continuous spaces. For generalizability to all real data outside finite datasets, application-driven ML needs new conditions formalized in Problem 1.1 below. (Li et al., 2021;Dym & Gortler, 2024;Maennel et al., 2024;Nigam et al., 2024) studied complete invariants without realizability and Lipschitz bi-continuity (Morris et al., 2024;Cahill et al., 2024).Problem 1.1. Find a complete and bi-continuous invariant I : {clouds of unordered points in R n } → a space X with a distance d such that all the conditions below hold. (c) Lipschitz continuity: there is a constant λ such that if each point of a cloud A ⊂ R n is perturbed up to Euclidean distance ε, then I(A) changes by at most λε in the metric d.(d) Realizability: the image {I(A) | clouds A ⊂ R n of unordered points} is parametrized so that one can reconstruct A up to rigid motion from any realizable value of I.(e) Point matching: there is a constant µ that guarantees for any clouds A, B a rigid motion matching all points of A, B up to Euclidean distance µd(I(A), I(B)).(f) Computability: for a fixed dimension n, the invariant I, the metric d, and all constructions in (d) and (e) are computable in polynomial time of the number of points.Clouds and rigid motion can be replaced with any data (graphs, meshes) and equivalences (also allowing reflections or uniform scaling), respectively, so Problem 1.1 makes sense for any real data with ambiguous representations.The completeness (or injectivity) in 1.1(a) fully answers the question "same or different?" A complete invariant I has the ultimate expressive power and always distinguishes all clouds A ̸ ∼ = B (not only from a finite dataset) that cannot be matched by rigid motion, so I is a descriptor with no false negatives and no false positives. The universal approximation aims for the completeness of infinite-size invariants (Maron et al., 2019;Keriven & Peyré, 2019;Yarotsky, 2022), so polynomial time in 1.1(f) makes all conditions harder.A complete invariant can give a discontinuous metric, say d(A, B) = 1 for all non-equivalent clouds without quantifying the similarity of near-duplicates. The continuity in 1.1(c) is necessary for smoothness and hence for any gradient-based optimisation Due to the first axiom in 1.1(b), any metric d detects rigidly equivalent clouds by checking if d(A, B) = 0. Without the first axiom, many more distances including the zero d ≡ 0 satisfy the other axioms and are called pseudo-metrics (Brécheteau, 2019). If the third axiom in 1.1(b) fails with any additive error ε > 0, results of clustering may not be trustworthy (Rass et al., 2024).The realizability in 1.1(d) implies that the invariant I is an invertible 1-1 map from the complicated Cloud Rigid Space CRS(R n ; m) of classes of clouds under rigid motion to the explicitly parametrized space I(CRS(R n ; m)) of realizable values. Then with 100% certainty, we can sample any value in I(CRS(R n ; m)) and reconstruct its cloud A ⊂ R n .The 1-1 point matching in 1.1(e) can be interpreted as the Lipschitz continuity of the inverse map I -1 so that any close values I(A), I(B) guarantee the closeness of A, B under rigid motion. Conditions 1.1(c,e) mean that I is bi-Lipschitz: ε/µ ≤ d(I(A), I(B)) ≤ λε, where ε is the minimum perturbation needed to match all points of A, B.A partial matching, e.g. ignoring outliers, is harder to formalize. Indeed, if any clouds sharing all points except one are called equivalent, the transitivity axiom allows us to build a chain of equivalences A 1 ∼ • • • ∼ A k changing one point at a time, which can make all clouds equivalent.One can define metrics satisfying 1.1(a,b,c) by minimizing or deviations of unordered points over infinitely many transformations but polynomial time in 1.1(f) makes Problem 1.1 notoriously hard, previously solved only for m = 3 points.Conditions 1.1(a,b,c,f) and 1.1(d,e,f) formalize the discriminative and generative goals, respectively. A full solution to Problem 1.1 will imply that the rigid classes of clouds can be efficiently visualized in the moduli space I(CRS(R n ; m)) replacing any latent space of non-invariants or incomplete (or discontinuous or non-realizable) invariants. Geographically, I(CRS(R n ; m)) can be compared with Earth's map, where any location can be reconstructed with all properties (altitude, precipitation, images, ...) from the latitude and longitude coordinates in known (realizable) ranges.Contributions. Problem 1.1 formalizes the necessary conditions for any application-driven ML on real objects. The new invariant Nested Distributed Projection solves Problem 1.1 for all clouds of m unordered points in dimension n = 2. Any cloud A ⊂ R n can be reconstructed from a small part of the invariant (a vector in R n(m-(n+1)/2) ) whose realizability in 1.1(d) is guaranteed by explicitly written inequalities. Hence coordinates of this vector can be chosen in known ranges like latitude and longitude on Earth maps. The appendices cover all dimensions n > 2. The Python/C++ code is in the supplementary materials.
Past work on continuous metrics for cloudsOrdered points. Kendall's shape theory (Kendall et al., 2009) studies m ordered points p 1 , . . . , p m ∈ R n under isometries from E(n). In this case, a complete invariant is the distance matrix (Schoenberg, 1935;Kruskal & Wish, 1978) or the Gram matrix of scalar products p i • p j , see chapter 2.9 in (Weyl, 1946), (Villar et al., 2021). A bruteforce extension to m unordered points requires m! matrices due to m! permutations, which is ruled out by 1.1(f).Point cloud registration for unordered points samples rotations (Lin et al., 1986;Yang et al., 2020) and uses scaleinvariant features (Lowe, 1999;2004;Huang et al., 2006) to approximately match clouds. If approximately matched clouds are called equivalent, sufficiently many gradual perturbations make all clouds equivalent due to the transitivity axiom. Hence all rigid classes should be distinguished by a distance d that becomes zero only on rigidly equivalent clouds. Trying to sort points along a fixed direction or in a clockwise order around their center of mass leads to discontinuities because distant points can have equal projections to a line or a circle. A basis (say, of principal directions) of a cloud (Spezialetti et al., 2019;Zhu et al., 2022;Kurlin, 2024) is similarly unstable under perturbations of points in cases of high symmetry, e.g. when eigenvalues become equal, which often happens for real molecules in our main application. Converting a cloud by using extra parameters into a more complex object such as a continuous field R 3 → R (Chauvin et al., 2022) or the persistent homology transform leads to the harder analog of Problem 1.1 for continuous surfaces instead of discrete clouds (Turner et al., 2014).Neural networks (Bronstein et al., 2021) can guarantee invariance or equivariance (Thomas et al., 2018;Kondor & Trivedi, 2018;Cohen et al., 2019;Fuchs et al., 2020;Deng et al., 2021). An equivariant descriptor E satisfies the weaker condition E(f (A)) = T f (E(A)) for any rigid motion f of a cloud A, where T f may not be the identity as required for invariants (Satorras et al., 2021;Chen et al., 2021;Aronsson, 2022;Assaad et al., 2023;Xu et al., 2022;Su et al., 2022). Any linear combination of points such as the center of mass is equivariant but cannot distinguish clouds under translation. Equivariants were used for predicting forces acting on atoms to move them to a more optimal configuration. These time-dependent clouds A t can be studied directly by their invariant values I(A t ) without intermediate forces. So neural networks optimize millions of parameters, see Table 4 in (Goyal et al., 2021), to improve accuracies (Dong et al., 2018;Akhtar & Mian, 2018;Laidlaw & Feizi, 2019;Guo et al., 2019;Colbrook et al., 2022) but need re-training any for new data and will have better generalizability if their inputs are invariants satisfying the conditions of Problem 1.1 for all possible clouds in R n .General metrics between fixed clouds extend to their rigid classes by minimization over infinitely many rigid motions (Huttenlocher et al., 1993;Chew & Kedem, 1992;Chew et al., 1999). In R 2 , the time O(m 5 log m) (Chew et al., 1997) for the Hausdorff distance (Hausdorff, 1919) will be improved in Theorem 5.3 to O(m 3.5 log m) for a new metric, see approximations in (Goodrich et al., 1999). The Gromov-Hausdorff and Gromov-Wasserstein metrics (Mémoli, 2011) are defined for metric-measure spaces also by minimizing over infinitely many correspondences between points, but cannot be approximated with a factor less than 3 in polynomial time unless P=NP, see Corollary 3.8 in (Schmiedl, 2017) and polynomial algorithms for partial cases in (Majhi et al., 2024). Also, computing a metric between rigid classes of clouds is only a small part of Problem 1.1. Indeed, to efficiently navigate on a real planet, in addition to distances between cities, we need a satellite-type view of the whole planet and hence a realizable bi-continuous invariant I, which can be considered an analog of the latitude and longitude coordinates on Earth.Can we 'sense' a shape? Problem 1.1 asks the questions 'same or different clouds, and how much different?' The related problem 'Can we hear the shape of a drum?' (Kac, 1966) has the negative answer in terms of 2D polygons indistinguishable by spectral invariants (Gordon et al., 1992a;b;Reuter et al., 2006;Cosmo et al., 2019;Marin et al., 2021). Problem 1.1 looks for stronger invariants that can completely 'sense' (not only 'hear') all rigid clouds in any R n .The partial cases when Problem 1.1 was solved are onlyn = 1 or m ≤ 3. In dimension n = 1, any rigid motion of R is a translation, so the Cloud Rigid Space CRS(R; m) of m points p 1 , . . . , p m ∈ R is the space R m-1 + of se- quential inter-point distances d i = p i+1 -p i > 0 for i = 1, . . . , m -1. Including reflections, the Cloud Isometry Space CIS(R; m) is the quotient of R m-1 + under the cyclic equivalence (d 1 , . . . , d m-1 ) ∼ (d m-1 , . . . , d 1 ). For clouds of m = 2 points in any dimension n ≥ 1, CRS(R n ; 2) is parametrized by a single inter-point distance d > 0.The final known case is m = 3 due to the SSS theorem saying that any triangles are congruent (isometric) if and only if they have the same side lengths. The space CIS(R n ; 3) of 3-point clouds has the geographic-style parametrization {0 < a ≤ b ≤ c ≤ a + b} by inter-point distances a, b, c so that any (a, b, c) ∈ CIS(R n ; 3) generates a uniquely triangle under isometry. Problem 1.1 asks for a similarly explicit parametrization of CRS(R n ; m) for all m ≥ 4 and n ≥ 2.Recent advances are the extensions (Delle Rose et al., 2024;Hordan et al., 2024) of the WL test (Leman & Weisfeiler, 1968), giving a binary answer (Brass & Knauer, 2000;2004) by distinguishing all non-isometric clouds but without Lipschitz continuous metrics for all clouds including degenerate ones. Attempting to extend the SSS theorem, the Sorted Distance Vector (SDV) of all m(m-1) 2 distances between m ≥ 4 unordered points distinguishes all non-isometric clouds in general position in R n (Boutin & Kemper, 2004) but not infinitely many 4-point clouds in R 2 , see Fig. 2. The SDV was strengthened (Widdowson & Kurlin, 2022) to the Pointwise Distance Distribution (PDD), which still cannot distinguish infinitely many non-isometric clouds in R 3 , see Fig. S4 in (Pozdnyakov & Ceriotti, 2022). All these counter-examples were distinguished by the Simplexwise Centered Distributions from (Widdowson & Kurlin, 2023), which satisfy 1.1(a,b,c,f) but not 1.1(d,e). Distance-based invariants do not allow easy realizability already for m = 4 points in R 2 whose 6 inter-point distances should satisfy a non-trivial polynomial equation saying that the tetrahedron on 4 points has volume 0 in R 2 . Hence random distances between m > 3 unordered points are realized by a point cloud in R 2 with probability 0 (Duxbury et al., 2016).
Complete invariants of unordered cloudsAny point p = (x 1 , . . . , x n ) ∈ R n has Euclidean norm |p| = n i=1x 2 i . Any points p and q = (y 1 , . . . , y n ) ∈ R n are also interpreted as vectors, have the Euclidean distance |p -q| and the scalar (dot) product of p • q = n i=1x i y i . Any vectors p ⊥ q are orthogonal if and only if p • q = 0.While past representations used one basis (say, of principal directions of a given cloud A ⊂ R n ), this section introduces a new representation based on variable projections that depend on n -1 ordered points in C consisting of m unordered points. For simplicity, we consider n = 2 when we have only m choices for a single point p ∈ A in Fig. 3. For any cloud A ⊂ R 2 of m unordered points, the center of mass is O(A) = 1 m p∈A p. Shift A so that O(A) is the origin 0 ∈ R 2 . For any p = (x 1 , x 2 ) ∈ A, the vector p ⊥ = (-x 2 , x 1 ) is orthogonal to p, so p • p ⊥ = 0, which holds even if p = 0. If p is not at the origin (center of mass of A), we use the orthogonal basis p, p ⊥ to represent all other points of A. Definition 3.1 makes sense for p = 0.Definition 3.1 (point-based representation PR(A; p)). Let A ⊂ R 2 be a cloud with the center of mass at the origin 0. Fix a base point p = (x, y) ∈ A, set p ⊥ = (-y, x). For any q ∈ A \ {p}, the 2 × (m -1) matrix M (A; p) has a column of the scalar products q • p, q • p ⊥ . The point-based representation of A is the pair PR(A; p) = |p| 2 , M (A; p) .We use |p| 2 and scalar products to make all components polynomial (smooth) in coordinates. The matrix M (A; p) has two rows (ordered according to p, p ⊥ ) and m -1 unordered columns, and can be considered a fixed cloud of m -1 unordered points in R 2 , not under rigid. Example 3.2 (regular polygons in R 2 ). (a) For m ≥ 2, let A m = {R exp 2πi √ -1 m } ⊂ R 2 , i = 1, . . . , m,M 1j = 0 = m-1 j=1 M 2j .In Theorem 3.3, s = |p| 2 is the squared distance from a point p ∈ A to 0 ∈ R 2 . The equations say that the sums of the scalar products (q • p) and (q • p ⊥ ) for all q ∈ A equal to 0, which is equivalent to q ∈ A = 0 meaning that the center of mass O(A) is 0. Hence s > 0 and m -2 columns of M can be considered free parameters. Under a mirror reflection, for any p ∈ A, one can assume after applying rigid motion that the basis p, p ⊥ maps to its mirror image p, -p ⊥ . The mirror image Ā has NDP( Ā) equal to NDP(A) that is obtained from NDP(A) by reversing all signs in the last row of M (A; p) for each p ∈ A.The completeness of NDP(A) Theorem 3.5 implies the completeness of the pair NDP(A), NDP(A) under isometry including reflections. Further work can simplify this pair to a smaller invariant while keeping the completeness. Since a bijection NDP(A) → NDP(B) between all (uncollapsed) PRs induces a bijection NCP(A) → NCP(B) respecting all weights of collapsed PRs, Theorem 3.5 implies the completeness of NCP under rigid motion in R 2 . Though the bottleneck distance is defined as a minimum for m! bijections A → B between m-point clouds, Theorem 6.5 in (Efrat et al., 2001)   
A metric on complete invariants of cloudsw M = BD M (A; p) R(A) , M (B; q) R(B), see Definition 4.1.We defined PRM as the maximum of 3 metrics to guarantee the metric axiom (if PRM = 0 then A ∼ = B) and the simplest Lipschitz constant λ = 2 in 1.1(d), see all proofs in appendix D. Replacing the maximum with (say) a sum gives a metric with a higher constant λ depending on m.Definition 4.3 (bottleneck matching distance BMD(Γ)).Let Γ be a complete bipartite graph with m white vertices and m black vertices so that every white vertex is connected to every black vertex by an edge e of a weight w(e) ≥ 0. A vertex matching in Γ is a set E of m disjoint edges of Γ. The weight W (E) = max e∈E w(e) is the largest weight in E. The bottleneck matching distance of the graph Γ is BMD(Γ) = min E W (E) is minimized over all vertex matchings.Because Γ is bipartite, any edge from a vertex matching E joins a white vertex with a black vertex. Then BMD(Γ) is minimized for all bijections E between all white vertices and all black vertices of Γ similar to Definition 4.       Associating every point p ∈ A to its nearest neighbor q ∈ B is justified only for fixed clouds because a rigid motion of A can change a nearest neighbor of any point p ∈ A in B.
Bi-continuity and polynomial algorithms
Experiments on large molecular databasesThe big databases of molecules with 3D conformers (embeddings in R 3 ) are QM9 (130K+ entries) (Ramakrishnan et al., 2014) and GD (GEOM drugs, 31M+ entries) containing hundreds of 3D conformers of unordered atoms for each of 61607 chemical compositions (Axelrod & Gomez-Bombarelli, 2022). The Protein Data Bank has backbones of ordered atoms classified by simpler invariants (Anosova et al., 2025). All experiments took a few hours on Ryzen 9 3950X 3.5 GHz, 64 MB of L3 cache, RAM 82GB.The ICML guide for application-driven ML says that "novel ideas that are simple to apply may be especially valuable", so we start with simpler and much faster invariants below.Definition 6.1 (invariants SRV, SDV, PDD). Let A ⊂ R n be a cloud of m unordered points with the center of mass at 0 ∈ R n . The Sorted Radial Vector SRV(A) has m radial distances |p| in decreasing order for all p ∈ A. The Sorted Distance Vector SDV(A) is the vector of m(m-1)2 pairwise distances |p -q| in decreasing order for distinct p, q ∈ A. For any point p ∈ A, let d 1 (p) ≤ • • • ≤ d m-1 (p)be Euclidean distances from p to all other points q ∈ A \ {p} in increasing order. These distance lists become rows of the m × (m -1) matrix D(S; k). Any l > 1 identical rows are collapsed into a single row with the weight l/m. The final matrix with at most m unordered weighted rows and m -1 ordered columns is the Pointwise Distance Distribution.For a PDD on m points, we sort m distance lists in time O(m 2 log m). Then PDDs are compared by the Earth Mover's Distance EMD (Rubner et al., 2000) in time O(m 3 ). Table 2 emphasizes that most clouds should be first distinguished by simpler and faster invariants SRV, SDV, PDD. The complete NDP is needed only in rare cases but is still essential because any incomplete invariant I has no chance to predict different properties on false positives that are molecules A ̸ ∼ = B with I(A) = I(B).Table 2. Invariants and metrics on cloud A ⊂ R 2 with m unordered points: from the fastest (linear-time) to complete.INVARIANT TIME METRIC TIME SRV O(m log m) L∞ O(m) SDV O(m 2 ) L∞ O(m 2 ) PDD O(m 2 log m) EMD O(m 3 ) NDP O(m 2 ) NBM O(m 3.5 log m)For a fixed atom p ∈ A and k < m, the first k distances to neighbors in the row of p in PDD(A) is an atomwise version of SRV(A). This vector D(A, p; k) of k distances was the only input for predicting the chemical element of p. A default network in TensorFlow was trained on clouds with the 80/20 split and achieved 98% accuracy for k = 4 in Table 4 despite the unbalanced counts of frequent elements in Table 3. Appendix A has all implementation details. All past attempts by both ML and non-ML in chemistry achieved only 86% on similar size data, see Table 7 summarized in (Vasylenko et al., 2025), because the underlying descriptors were not invariant, e.g. under permutations of atoms, which creates exponentially many representations of the same molecule, incomplete, or their similarities failed the triangle axiom, e.g. see (Steck et al., 2024).  For each of 31M+ entries (3D conformers) in the much larger database GD, we took the cloud A of all atoms without chemical elements and computed SRV(A; k) of up to k = 10 largest distances (rounded to 3 decimal places) from the center of mass of A to all atoms. Similar to QM9, cascade comparisons confirmed that SRV(A; 7) distinguishes all chemically different molecules, while only four pairs have equal SRV(A; 6) rounded to 3 decimal places. This transparent reconstruction of a full chemical composition from precise enough geometry gives hope to explain other molecular properties in terms of geometric invariants.  The experiments imply that mapping any molecule to (the rigid class of) its cloud of atomic centers is injective without losing any chemical information, so all chemical elements can be reconstructed from pure geometry. This result confirms our physical intuition that replacing atoms should perturb geometry at least slightly, which was impossible to establish without complete and Lipschitz continuous invariants. Hence all molecules of m atoms live at different locations in the common Cloud Rigid Space CRS(R 3 ; m) of SE(3)-classes of all clouds of m unordered points.Most significantly, a molecular structure can now be defined not as a huge collection of vectors under rotations and atom permutations, see Fig. 1 in (Lang et al., 2024), but as a rigid (class of a) cloud of atomic centers (without chemical elements), which is uniquely determined by an efficient hierarchy of invariants from the fastest (linear-time) SRV to the new complete invariant NDP solving Problem 1.1.
Impact StatementThis paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
Introduction to appendicesThe main contribution is the roadmap for any data challenge through well-motivated Problem 1.1, where clouds and rigid motion can be replaced with any objects and equivalences. The conditions of completeness and Lipschitz continuity of an invariant I cover the discriminative challenge. After these conditions 1.1(a,b,e) are satisfied, the invariant I can be inverted in principle and opens the generative challenge of its realizability and inverse continuity in 1.1(c,d,e).Problem 1.1 was stated for unordered clouds under rigid motion but was also solved for isometry and compositions of these equivalences with uniform scaling in R n . For m = 4 points, plane quadrilaterals were previously classified in discrete classes in Fig. 1 (right), while appendix C shows the first continuous maps of the invariant space CRS(R 2 ; 4). The completeness and bi-Lipschitz continuity of the proposed invariants enabled the new experiments on 130K+ real molecules in section 6, which were not previously possible because all past invariants did not satisfy all conditions of Problem 1.1, especially the realizability condition that provides geographic-style maps on cloud spaces.The full solution to Problem 1.1 for n = 2 is justified by Theorem 3.5 and Lemmas 3.3, 5.1, 5.2, 5.3. Theorem 3.3 enables a visualization of cloud spaces, which were unknown even for m = 4 unordered points in R 2 .• The Cloud Isometry Space CIS(R n ; m) of clouds of m unordered points under isometry in R n .• The Cloud Rigid Space CRS(R n ; m) of clouds of m unordered points under rigid motion in R n .• The Cloud Similarity Space CSS(R n ; m) of clouds of m unordered points under geometric similarity, which is a composition of isometry and uniform scaling in R n .• The Cloud Dilation Space DCS(R n ; m) of clouds of m unordered points under orientation-preserving geometric similarity (rigid motion and uniform scaling) in R n .Here is a summary of the supplementary materials.• Appendix A extends section 6 with more details of new invariants and metrics computed on the QM9 database and compared with past pseudo-metrics.• Appendix C discusses parametrization of CSS(R 2 ; m) and includes Examples C.1 and C.2 computing the new invariants NDP in detail for infinitely many 4-point clouds from Example C.1.• Appendices B, D, E prove all theoretical results from sections 3, 4, 5, respectively.• The zip folder with supplementary materials includes the code for computing all invariants and metrics as well as tables with all coordinates of colorful maps of QM9 and distances.
A. Extra details of experiments in section 6The default 4-layer network from TensorFlow used a "sequential" mode, 3 epochs, and the settings in Table 6.The only difference between QM9 and GD settings was in the number N of chemical elements in tf.keras.layers.Dense(N), where N = 5 for QM9 and N = 10 for GD.The maps of QM9 in Fig. 9 are based on eigenvalues and too dense without clear separation. Even if we zoom in, these incomplete invariants will not separate molecules because 3D clouds have at most 3 eigenvalues. The complete invariants   NDP contain much more geometric information. Fig. 10 and 11 show that distances on stornger invariants have larger values and hence better separate molecules, though all these distances have the same Lipschitz constant 2.    B. Generalization of section 3 and all proofs in dimensions n ≥ 2This appendix extends all concepts from section 3 to dimensions n ≥ 2, extends Theorem 3.3 to Theorem B.7, which is proved with Theorem B.9 for any n ≥ 2.Lemma B.1 (vector p ⊥ n orthogonal to p 1 , . . . , p n-1 in R n ). Let e 1 , . . . , e n be an orthonormal basis of R n , so |e i | = 1 and e i • e j = 0 for i ̸ = j. For any n -1 vectors p 1 , . . . , p n-1 ∈ R n , there is a vector p ⊥ n that is orthogonal to all p 1 , . . . , p n-1 and has coordinates that are degree n -1 polynomials in the coordinates of p 1 , . . . , p n-1 .Proof of Lemma B.1. Below the 'unusual determinant' with the n -1 vector columns p 1 , . . . , p n-1 and the last column of the n vectors e 1 , . . . , e n is only a short notation for the following expansion by the last column:| . . . | e 1 p 1 . . . p n-1 . . . | . . . | e n = n i=1(-1) n+i det(i)e i , where det(i) is the usual (n -1) × (n -1) determinant obtained from the n -1 vector columns p 1 , . . . , p n-1 by removing the i-th row, so we setp ⊥ n = n i=1 (-1) n+i det(i)e i .For example, if n = 2 then p 1 = (x 1 , x 2 ) has the vector p ⊥ 2 =x1 e 1 x 2 e 2 = x 1 e 2 -x 2 e 1 = (-x 2 , x 1 ) ⊥ p 1 If n = 3, p 1 = (x 1 , x 2 , x 3 ) and p 2 = (y 1 , y 2 , y 3 ), then p ⊥ 3 = x 1 y 1 e 1 x 2 y 2 e 2 x 3 y 3 e 3 = x 2 y 2 x 3 y 3 e 1 - x 1 y 1 x 3 y 3 e 2 + x 1 y 1 x 2 y 2 e 3 = p 1 × p 2 is the vector product of p 1 , p 2 .To show that p ⊥ n is orthogonal to each p i , we compute the scalar productp ⊥ n • p i = n i=1 (-1) n+1 det(i)e i • p i . Since e i • p iequals the i-th coordinate of the vector p i , the last sum is the expansion of the n × n determinant obtained from the original p ⊥ n above by replacing the last column with p i . Since the resulting determinant contains two identical columns equal to p i , we conclude that p ⊥ n • p i = 0.Lemma B.1 holds when given vectors p 1 , . . . , p n-1 ∈ R n are linearly dependent, even if some p j = 0. Then p ⊥ n = 0 is orthogonal to each p j so that p ⊥ n • p j = 0. (A) = 1 m p∈A p. Shift A so that O(A) is the origin 0 ∈ R n . The radius of A is R(A) = max p∈A |p|.For any basis sequence of points p 1 , . . . , p n-1 ∈ A, the squared distance matrix SD(p 1 , . . . , p n-1 ) consists of |p i -p j | 2 for i, j = 0, . . . , n -1, where p 0 = 0. Let p ⊥ n be the vector in Lemma B.1. For any point q ∈ A \ {p 1 , . . . , p n-1 }, the n × (m -n + 1) matrix M (A; p 1 , . . . , p n-1 ) has a column of scalar products q • p 1 , . . . , q • p n . The point-based representation PR(A; p 1 , . . . , p n-1 ) is the pair SD(p 1 , . . . , p n-1 ), M (A; p 1 , . . . , p n-1 ) .The normalized representation NPR(A; p 1 , . . . , p n-1 ) is obtained by dividing all components of PR(A; p 1 , . . . , p n-1 ) by R 2 (A), except the last row of M (A; p 1 , . . . , p n-1 ), which is divided by R n (A). (b) For any orientation-reversing isometry f of R n , the representation PR(f (A); f (p 1 ), . . . , f (p n-1 ) differs from PR(A; p 1 , . . . , p n-1 ) by reversing all signs in the last row of the matrix M (A; p 1 , . . . , p n-1 ).(c) The normalized point-based representation NPR(A; p 1 , . . . , p n-1 ) in Definition B.2 is preserved by any composition of rigid motion and uniform scaling.Proof of Lemma B.3. (a) Since rigid motion preserves distances and scalar products, all components of the point-based representation PR(A; p 1 , . . . , p n-1 ) are invariant.(b) Using a composition with a suitable orientation-preserving isometry (rigid motion), one can assume that f is the mirror reflection in a linear hyperspace H containing the origin 0 and the base sequence p 1 , . . . , p n-1 of A. Since f preserves distances, R(A) and SD(A; p 1 , . . . , p n-1 ) are invariant. Then f fixes all points from H including p 1 , . . . , p n-1 , hence the vector p n from Lemma B.1. Any point q ∈ A \ p 1 , . . . , p n-1 keeps its scalar product q • p i for i = 1, . . . , n -1 and changes the sign of q • p n , because q and its mirror image f (q) have opposite projections to p n . The above arguments hold even if the base sequence p 1 , . . . , p n-1 is degenerate, not generating an (n -1)-dimensional subspace in R n . Then there are infinitely many choices of H above and p n = 0, so the last row of M (A; p 1 , . . . , p n-1 ) consists of zeros.(c) Under uniform scaling by a factor s, all squared distances and scalar products q • p i , i = 1, . . . , n -1, are multiplied by s 2 . The vector p ⊥ n from Lemma B.1 is multiplied by s n-1 , hence all scalar products q • p n in the last row of M (A; p 1 , . . . , p n-1 ) are divided by R n (A).The affine dimension 0 ≤ aff(A) ≤ n of a cloud A = {p 1 , . . . , p m } ⊂ R n is the maximum dimension of the vector space generated by all inter-point vectors p i -p j , i, j ∈ {1, . . . , m}. Then aff(A) is an isometry invariant and is independent of an order of points of A. Any cloud A of 2 distinct points has aff(A) = 1. Any cloud A of 3 points that are not in the same straight line has aff(A) = 2. Lemma B.4 provides a simple criterion for a matrix to be realizable by squared distances of a point cloud in R n .
Lemma B.4 (realization of distances). (a)A symmetric m × m matrix of s ij ≥ 0 with s ii = 0 is realizable as a matrix of squared distances between points p 0 = 0, p 1 , . . . , p m-1 ∈ R n if and only if the (m -1) × (m -1) matrixg ij = s 0i + s 0j -s ij 2has only non-negative eigenvalues.(b) If the condition in (a) holds, aff(0, p 1 , . . . , p m-1 ) equals the number k ≤ m -1 ≤ n of positive eigenvalues. Also in this case, g ij = p i • p j define the Gram matrix GM of the vectors p 1 , . . . , p m-1 ∈ R n , which are uniquely determined in time O(m 3 ) up to an orthogonal map in R n .Proof of Lemma B.4. (a) We extend Theorem 1 from (Dekster & Wilker, 1987) to the case m < n + 1 and also justify the reconstruction of p 1 , . . . , p m-1 in time O(m 3 ) uniquely in R n up to an orthogonal map from the group O(n).The part only if ⇒. Let a symmetric matrix S consist of squared distances between points p 0 = 0, p 1 , . . . , p m-1 ∈ R n . For i, j = 1, . . . , m -1, the matrix with the elementsg ij = s 0i + s 0j -s ij 2 = p 2 i + p 2 j -|p i -p j | 2 2 = p i • p jis the Gram matrix, which can be written as GM = P T P , where the columns of the n × (m -1) matrix P are the vectors p 1 , . . . , p m-1 . For any vector v ∈ R m-1 , we have0 ≤ |P v| 2 = (P v) T (P v) = v T (P T P )v = v T GMv.Since the quadratic form v T GMv ≥ 0 for any v ∈ R m-1 , the matrix GM is positive semi-definite meaning that GM has only non-negative eigenvalues, see Theorem 7.2.7 in (Horn & Johnson, 2012).The part if ⇐. For any positive semi-definite matrix GM, there is an orthogonal matrix Q such that Q T GMQ = D is the diagonal matrix, whose m -1 diagonal elements are non-negative eigenvalues of GM. The diagonal matrix √ D consists of the square roots of eigenvalues of GM.(b) The number of positive eigenvalues of GM equals the dimension k = aff({0, p 1 , . . . , p m-1 }) of the subspace in R n linearly spanned by p 1 , . . . , p m-1 . We may assume that all k ≤ n positive eigenvalues of GM correspond to the first k The new columns differ from the previously reconstructed vectors p 1 , . . . , p m-1 ∈ R n by the orthogonal map Q QT . Hence the reconstruction is unique up to O(n)-transformations. Computing eigenvectors p 1 , . . . , p m-1 needs a diagonalization of GM in time O(m 3 ), see (?)section 11.5]press2007numerical.coordinates of R n . Since Q T = Q -1 , the given matrix GM = QDQ T = (Q √ D)(Q √ D) T becomesThough Lemma B.4 gives a two-sided criterion for realizability of distances by points p 1 , . . . , p m ∈ R n , the space of distance matrices is highly singular and cannot be easily sampled. Even m = 4 points in R 2 have 6 distances that should satisfy a polynomial equation saying that the tetrahedron with these 6 edge lengths has volume 0.So a randomly sampled matrix of potential distances for m > n + 1 is unlikely to be realizable by a cloud of m ordered points in R n . Hence Lemma B.4 for m ≤ n + 1 is complemented by Theorem B.7 describing the much more practical realizabilty of a point-based representation.Chapter 3 in (Liberti & Lavor, 2017) discusses realizations of a complete graph given by a distance matrix in R n .Lemma B.5(a) and later results hold for all clouds including degenerate ones, e.g. for 3 points in a straight line.Any points p 1 , . . . , p n-1 ∈ A have aff(p 1 , . . . , p n-1 ) ≤ n -2. For example, any two distinct points in A ⊂ R 3 generate a straight line. Lemma B.5(c) proves that PR(A; p 1 , . . . , p n-1 ) suffices to reconstruct a cloud A ⊂ R n for a suitable sequence p 1 , . . . , p n-1 . In R 2 , any point p 1 ̸ = O(A) forms a suitable {p 1 }. In R 3 , one can choose any distinct points p 1 , p 2 ∈ A so that the infinite straight line via p 1 , p 2 avoids O(A).If there are no such p 1 , p 2 , then A ⊂ R 3 is contained in a straight line L, so aff(A) = 1. In this degenerate case, the stronger condition aff(O(A) ∪ {p 1 , . . . , p n-1 }) = aff(A) will help reconstruct A ⊂ L by using any point p 1 ̸ = O(A). The first step is to reconstruct any ordered sequence from its distance matrix in Lemma B.5(a).Lemma B.5 improves Lemma E.5 in (Widdowson & Kurlin, 2023)  . , p n-1 ∈ A with aff(O(A) ∪ {p 1 , . . . , p n-1 }) = aff(A). If aff(A) = n, then aff(O(A) ∪ {p 1 , . . . , p n-1 }) = n -1 suffices. Any cloud A ⊂ R n has a suitable sequence p 1 , . . . , p n-1 in all cases.Proof of Lemma B.5. (a) By translation, we can put p 1 at the origin 0 ∈ R n . Let G be the (m -1) × (m -1) matrixG ij = p 2 i + p 2 j -|p i -p j | 2 2 = p i • p j constructedfrom squared distances between p 1 = 0, . . . , p m for i, j = 2, . . . , m.By Lemma B.4 if G has k ≤ n positive eigenvalues, then p 1 = 0, . . . , p m can be uniquely determined up to isometry inR k ⊂ R n in time O(m 3). If all distances are divided by the same radius R(p{m}), the above construction guarantees uniqueness up to isometry and uniform scaling.(b) If m ≤ n, any mirror images of p{m} ⊂ R n after a suitable rigid motion in R n can be assumed to belong to an (n -1)-dimensional hyperspace H ⊂ R n , where they are matched by a mirror reflection H → H with respect to an (n -2)-dimensional subspace S ⊂ H, which is realized by the 180 • orientation-preserving rotation of R n around S.(c) We will reconstruct a cloud A ⊂ R n so that the center of mass O(A) is the origin 0 ∈ R n . If aff(A) = k < n, the cloud A ⊂ R n is contained in an affine k-dimensional subspace, which can be rigidly moved to the linear subspace R k ⊂ R n for the first k of n coordinates in R n .It suffices to reconstruct A ⊂ R k up to rigid motion in R k . Since aff(0, p 1 , . . . , p n-1 ) = k, some k vectors (say) p 1 , . . . , p k from p 1 , . . . , p n-1 form a linear basis of R k . The k points p 1 , . . . , p k are uniquely reconstructed up to rigid motion in R k by part (b). Any other point q ∈ A \ {p 1 , . . . , p k } is uniquely determined by its projections (q • p i )/|p i |, which can be found from the first k < n rows of the matrix M (A; p 1 , . . . , p n-1 ) for the point q, see Definition B.2.In the generic case aff(A) = n, the condition aff(0, p 1 , . . . , p n-1 ) = n-1 means that p 1 , . . . , p n-1 are linearly independent and hence form a linear basis of R n with the extra vector p ⊥ n from Lemma B.1. The sequence (0, p 1 , . . . , p n-1 ) of n points can be uniquely reconstructed up to rigid motion in R n by part (b). Any other point q ∈ A \ {p 1 , . . . , p n-1 } is uniquely determined by its projections q • p i |p i | to the n basis vectors p 1 , . . . , p n-1 , p ⊥ n , which can be found from the column of M (A; p 1 , . . . , p n-1 ) for q.Lemma B.5(b) for m = n = 3 implies that any triangle is determined by its sides up to rigid motion in R 3 . For example, the sides 3, 4, 5 define a right-angled triangle whose mirror images are not related by rigid motion inside a plane H ⊂ R 3 , but are matched by composing a suitable rigid motion in H and a 180 • rotation of R 3 around a line in H.Lemma B.6 (smoothness of PR). For any cloud A ⊂ R n and a base sequence p 1 , . . . , p n-1 ∈ A, all components of PR(A; p 1 , . . . , p n-1 ) have continuous partial derivatives (of any order) with respect to all (coordinates of) points of A as long as R(A) > 0, so some points of A remain distinct.Proof of Lemma B.6. The point-based representation PR(A; p{n -1}) consists of squared distances in the matrix SD(p{n -1}) and scalar products in the matrix M (A; p{n -1}) of all points q ∈ A \ p{n -1} with the vectors p 1 , . . . , p n-1 from the base sequence p{n -1} and the vector p n ⊥ p 1 , . . . , p n-1 from Lemma B.1. All these components are polynomials in the coordinates of the points of A, so have all continuous partial derivatives. Proof of Theorem B.7. The realizability of S as a matrix of squared distances between n points 0, p 1 , . . . , p n-1 from the base sequence p 1 , . . . , p n-1 follows from Lemma B.4. The orthogonal vector p ⊥ n (also denoted by p n here for uniformity) from Lemma B.1 complements p 1 , . . . , p n-1 to a linear basis of R n . By Definition B.2, every element M ij of the matrix M = M (A; p 1 , . . . , p n-1 ) equals p i • q for some q ∈ A \ {p 1 , . . . , p n-1 }, where i = 1, . . . , n.
Hencen-1 j=1 (p i • p j ) + m-n+1 j=1 M ij = 0 can be rewritten as p i • ( p∈A p) = 0 for i = 1, . . . , n. These n equations mean that O(A) = 1 m p∈A p is at the origin 0 ∈ R n .Conversely, for any M satisfying condition (2), we interpret every column (M 1j , . . . , M nj ) T as a vector of scalar products (q • p 1 , . . . , q • p n ), which determine a position of a point q ∈ A \ {p 1 , . . . , p n-1 } in the basis p 1 , . . . , p n .In Theorem B.7, condition ( 2) is equivalent to O(A) = 0 ∈ R n and implies that m -n columns of M consist of free parameters, which determine the remaining column.For n = 2, condition (1) means only that s 12 > 0, so the distance between the points p 0 = 0 and p 1 is positive.For n = 3, condition (1) about positive eigenvalues of the 2 × 2 matrix G means that 3 distances a ≤ b ≤ c between points 0, p 1 , p 2 in R 3 satisfy a > 0 and a + b > c, so the triangle on 0, p 1 , p 2 is non-degenerate. By the cosine theoremp 1 • p 2 = 1 2 (a 2 + b 2 -c 2 ), so the matrix G = a 2 1 2 (a 2 + b 2 -c 2 ) 1 2 (a 2 + b 2 -c 2 ) b 2has a 2 > 0 and a positive determinant:4 det G = 4a 2 b 2 -(a 2 + b 2 -c 2 ) 2 = (c 2 -(a 2 -2ab + b 2 ))((a 2 + 2ab + b 2 ) -c 2 ) = (c 2 -(a -b) 2 )((a + b) 2 -c 2 ) > 0.Assuming that 0 < a ≤ b ≤ c, the last inequality is equivalent to one triangle inequality a + b > c.Now we extend a point-based representation from Definition B.2 to a complete invariant of a point cloud A under rigid motion in R n . In applications, A can have distinguished points, for example, heavy atoms in atomic clouds, which can be used to minimize choices for p 1 , . . . , p n-1 .Definition B.8 will extend Definition 3.4 to n > 2 by combining all PR(A; p 1 , . . . , p n-1 ) in a nested invariant by dropping points p 1 , . . . , p n-1 ∈ A one at a time. This invariant is needed only for comparisons (metric computations), while any cloud A can be stored in computer memory as a single PR(A; p 1 , . . . , p n-1 ) due to Theorem B.7.Definition B.8 (NDP : Nested Distributed Projection). Let A ⊂ R n be any cloud of m unordered points. For any ordered points p 1 , . . . , p n-2 ∈ A, let NDP(A; p 1 , . . . , p n-2 ) be the unordered collection of PR(A; p 1 , . . . , p n-1 ) for all points p n-1 ∈ A \ {p 1 , . . . , p n-2 }. Similarly, for any 1 ≤ k ≤ n -2, let NDP(A; p 1 , . . . , p k-1 ) be the unordered collection of NDP(A; p 1 , . . . , p k ) for all points p k ∈ A \ {p 1 , . . . , p k-1 }. For k = 1, the full Nested Distributed Projection NDP(A) depends only on A.For n = 2 and any cloud A ⊂ R 2 , the Nested Distributed Projection NDP(A) in Definition B.8 is the same as in Definition 3.4, i.e. NDP(A) is the unordered collection of point-based representations PR(A; p 1 ) for all p 1 ∈ A.For n = 3 and any A ⊂ R 3 , the Nested Distributed Projection NDP(A) is the unordered collection of NDP(A; p 1 ) for all p 1 ∈ A. Each NDP(A; p 1 ) is the unordered collection of PR(A; p 1 , p 2 ) for all p 2 ∈ A \ {p 1 }.Similarly to Definition 3.4, if a cloud A has internal symmetries as in Example 3.2, one can collapse identical objects to a single one with a weight to speed up computations. We avoid collapsing only to simplify arguments for n > 2.Lemma B.5(c) implies that any cloud A ⊂ R n of m unordered points can be reconstructed from NDP(A) uniquely up to rigid motion. Indeed, NDP(A) contains (nested) PRs depending on all possible n -1 points p 1 , . . . , p n-1 ∈ A. At least one PR(A; p 1 , . . . , p n-1 ) satisfies Lemma B.5(c) and suffices to reconstruct A uniquely up to rigid motion.In Theorem B.9 for n > 2, the equality NDP(A) = NDP(B) means a bijection β : NDP(A) → NDP(B) respecting the nested structure of all PRs in Definition B.8.In detail, for any 1 ≤ k ≤ n -1 and points p 1 , . . . , p k , the bijection β matches NDP(A; p 1 , . . . , p k ) with a unique NDP(B; q 1 , . . . , q k ) for some q 1 , . . . , q k ∈ B.If n = 3, then β matches every NDP(A; p 1 ) with a unique NDP(B; q 1 ) in the sense that this bijection NDP(A; p 1 ) → NDP(B; q 1 ) matches PR(A; p 1 , p 2 ) for every p 2 ∈ A \ {p 1 } with PR(B; q 1 , q 2 ) for a unique q 2 ∈ B -{q 1 }.Theorem B.9 (completeness of NDP). The Nested Distributed Projection is complete in the sense that any clouds A, B ⊂ R n of m unordered points are related by rigid motion in R n if and only if NDP(A) = NDP(B) so that there is a bijection NDP(A) → NDP(B) matching all PRs.Proof of Theorem B.9. The part only if : we will prove that any rigid motion f moving the cloud A to B = f (A) implies that NDP(A) = NDP(B). By Lemma B.3(a) the rigid motion f matches every PR(A; p 1 , . . . , p n-1 ) from NDP(A) with PR(B; f (p 1 ), . . . , f (p n-1 )). Then, for any 1 ≤ k ≤ n -2 and p 1 , . . . , p k ∈ A, we get a bijection NDP(A; p 1 , . . . , p k ) → NDP(B; f (p 1 ), . . . , f (p k )) Hence f induces a bijecton NCP(A) → NCP(B) between all PRs respecting the nested structure in Definition B.8.The part if : NDP(A) = NDP(B) will guarantee a rigid motion f moving the cloud A to B = f (A). Choose any base sequence p 1 , . . . , p n-1 ∈ A that suffices for a unique reconstruction of A ⊂ R n up to rigid motion in Lemma B.5(c).The given bijection NDP(A) → NDP(B) matches PR(A; p 1 , . . . , p n-1 ) with an equal PR(B; q 1 , . . . , q n-1 ) for some q 1 , . . . , q n-1 ∈ B.Lemma B.5(c) implies that a reconstruction of A, B from PR(A; σ(p 1 , . . . , p n-1 )) = PR(B; q 1 , . . . , q n-1 ) is unique up to rigid motion in R n so that A, B are matched by a rigid motion f as required. If aff(A) = aff(B) < n, this motion f may not be unique. For example, any clouds A, B ⊂ R 3 that are contained in a straight line L ⊂ R 3 are pointwise fixed by any rotation around the line L.
C. Maps of cloud spaces and explicit computations of invariantsThis section explains how cloud spaces can be visualized by considering the previously known and new types of 4-point clouds (quads) in R 2 . This geographic-style approach extends to any number m of points in R n .For any cloudA ⊂ R n , the center O(A) = 0 ∈ R n is the origin. For n = 2, let p{1} consist of a single point p 1 ∈ A with |p 1 | = R(A) = R. We can fix p 1 = (R, 0) in R 2 . Then all points p 2 , . . . , p m are in the disk D = {x 2 + y 2 ≤ R 2 }. Since m i=2 p i = -p 1 = (-R, 0), p m is determined from p 2 , . . . , p m-1 ∈ D that satisfy only one equation R 2 ≥ |p m | 2 = |(R, 0) T + m-1 i=2 p i | 2 = (R + x) 2 + y 2 , where (x, y) are the coordinates of s = m-1 i=2 p i . The domain of s is the intersection J = D ∩ {(R + x) 2 + y 2 ≤ R 2 }.For m = 3, we have s = (x, y) = p 2 . The symmetry p 2 ↔ p 3 allows us to choose any p 2 in the left half (yellow) D 3 of the intersection J in Fig. 13 (left). Then the Rigid Cloud Space CRS(R n ; 3) is parametrized by any radius R > 0 and p 2 ∈ D 3 . All equilateral triangles have p 2 = (-1 2 R, ± √ 3 2 R). All isosceles triangles have p 2 in the boundary ∂D 3 whose points should be identified under (x, y) → (x, -y). All p 2 = (x, 0) with -R ≤ x ≤ -1 2 R represent degenerate triangles with the vertices (R, 0), (x, 0), (-R -x, 0) in the same line. For m = 4, we can choose s = p 2 +p 3 ∈ J, then any p 3 in the disk with the radius R and center s so that |p 2 | = |p 3 -s| ≤ R. For any parallelogram in R 2 , its vertex cloud A has a longest diagonal between (say) p 1 , p 3 that should be at (±R, 0). All possible s = p 2 + (-R, 0) ∈ J mean that p 2 can be anywhere in D. Due to the symmetry p 2 ↔ p 4 , the left half D 4 of D in Fig. 13 (right) is the subspace of all parallelograms in DCS(R 2 ; 4) = CRS(R 2 ; 4)/scaling.Similarly for m > 4, n ≥ 2, we can sequentially sample points p 2 , . . . , p m-1 from allowed disks (high-dimensional for n > 2) to get a unique representation of A under rigid motion. The symmetry f : (x, y) → (x, -y) on D identifies mirror images of A. CIS(R n ; m) is the quotient of CRS(R n ; m) under (x, y) ∼ (x, -y), take the upper halves of D 3 , D 4 for triangles and parallelograms, respectively. We expand Fig. 13 above to illustrate severak important subspaces in the Isometry Cloud Space CIS(R 2 ; m) and the Similarity Cloud Space CSS(R 2 ; m) for m = 3, 4. For simplicity, we call all clouds of 3 and 4 unordered points triangles and quadrilaterals, respectively. However, all these polygons are considered equivalent when we re-order their vertices. If all m points are ordered, parametrizations of the resulting shape spaces were studied in geometry (Kapovich & Millson, 1996) and shape theory (Kendall et al., 2009). We focus on the much harder quotient spaces of m unordered points.Theorem B.7 explicitly describes all realizable Point-based Representations. Though the same point cloud A ⊂ R can have many PR(A; p{n -1}) depending on a base sequence p{n -1} ⊂ A, we can easily sample any of them and always reconstruct A, while random sampling distance-based invariants doesn't guarantee the existence of A because of extra relations between inter-point distances.Though PR(A; p{n -1}) consists of scalar products q • p i with basis vectors p 1 , . . . , p n , it is easier to visualize the isometry spaces by directly using some points q ∈ A as parameters instead of their projections.Case m = 3 of triangles is the same in all dimensions n ≥ 2. We consider R 2 for simplicity. Fig. 13 (left) showed the Dilation Cloud Space DCS(R 2 ; 3) of triangles A modulo rigid motion and uniform scaling in R 2 . We assume that the center of mass is at the origin: C(A) = 0 in R 2 . After the radius R = 1 of A is fixed up to scaling, we also fix the first vertex at p 1 = (R, 0). Then DCS(R 2 ; 3) is parametrized by the second vertex p 2 ∈ D 3 , because the vertex p 3 is uniquely determined by p 1 + p 2 + p 3 = 0.The blue boundary of DCS(R 2 ; 3) consists of points p 2 that define isosceles triangles. The vertical part of the blue boundary in Fig. 14 (left) represents all isosceles triangles with a unique angle (not equal to two equal ones) less than 60 • . The round part of the blue boundary in Fig. 14 (right) represents all isosceles triangles with a unique angle greater than 60 • . These boundary parts meet at the red points (-R 2 , ± √ 3 2 R) representing all equilateral triangles. If p 2 = (x, 0) for -R ≤ x ≤ -R 2 , then p 3 = (-R -x, 0), so the triangle generates to three points in the line. In the yellow space D 3 = CSS o (R 2 ; 3), the mirror reflection (x, y) → (x, -y) maps every isosceles triangle to itself, more exactly, to an equivalent triangle under rigid motion. Hence all points of the blue boundary of D 3 should be identified under (x, y) → (x, -y). Then the space D 3 of all triangles (including degenerate ones) under rigid motion and uniform scaling can be visualized as a topological sphere S 2 whose the northern and southern hemispheres are obtained from the upper and lower halves of D 3 .Case m = 4 of quadrilaterals in R 2 . Fix the center of mass O(A) = 0 ∈ R 2 at the origin, the radius R(A) = R, and a most distant (from 0) point p 1 at (R, 0). The other vertices p 2 , p 3 , p 4 belong to the disk D = {x 2 + y 2 ≤ R 2 } and have the shifted center of mass p2+p3+p4 3 = (-R 3 , 0). Hence, for a fixed radius R, the space CSS(R 2 ; 4) is 4-dimensional.The subspace of parallelograms in CSS(R 2 ; 4) is 2-dimensional. For any parallelogram A, its other most distant vertex is p 3 = (-R, 0) opposite to p 1 with respect to 0. Then p 2 + p 4 = 0 and the symmetry p 2 ↔ p 4 allows us to consider only p 2 in the yellow half-disk D 4 , which uniquely determines its symmetric image p 4 in Fig. 13 (left).The round (blue) boundary of D 4 in Fig. 15 (left) represents all rectangles inscribed in the circle x 2 + y 2 = R 2 . The vertical (orange) boundary of D 4 in Fig. 15 (right) represents all rhombi with equal sides. The reflection (x, y) → (x, -y) maps any parallelogram to its mirror image and preserves the equivalence class (up to rigid motion) of any rectangle or rhombus, which are mirror-symmetric. Hence all points on the boundary of D 4 should be identified under (x, y) → (x, -y).The resulting quotient is a topological sphere S 2 as D 3 for all triangles, unsurprisingly because a parallelogram can be considered as a double triangle.  Since any kite is mirror-symmetric, the points p 2 = (x, y) and p 4 = (x, -y) represents the same kite up to rigid motion. Hence the (yellow) subspace of all kites in CSS(R 2 ; 4) is the upper half K 4 of the disk D in Fig. 16 (left). For points p 2 in the vertical line x = -R 3 , we get a degenerate kites whose vertices p 2 , p 3 , p 4 are in the same straight line. If p 2 = (x, 0), the kite degenerates even further to the case of identical vertices p 2 = p 4 .So the subspace K 4 of kites in CSS(R 2 ; 4) is 2-dimensional, while the larger subspace of qmeds is 3-dimensional, parametrized by x ∈ [-R, R] and a point p 2 that can take any position in the intersection of the disk D = {x 2 + y 2 ≤ R 2 } and its symmetric image with respect to the diagonal mid-point (x 2,4 , 0) = (-x+R 2 , 0).The full space CSS(R 2 ; 4) is parametrized by the sum s = p 2 + p 3 in the intersection  Example C.1 (4-point clouds T, K in Fig. 17). Both clouds T, K ⊂ R 2 in Fig. 17  The (unordered) collections of squared distances above differ unless at least one of a, b, c, d is zero. Indeed, the squared distances 9a 2 +d 2 and a 2 +9d 2 are shared by C ± but SD(C + ; p + 2 ) is unique and cannot equal SD(C -; p - 2 ) or SD(C -; p - 3 ). Indeed, if all a, b, c, d ̸ = 0, thenJ = D ∩ {(R + x) 2 + y 2 ≤ R 2 }(a -b) 2 + (c -d) 2 ̸ = (a -b) 2 + (c + d) 2 or cd ̸ = 0, (a -b) 2 + (c -d) 2 ̸ = (a + b) 2 + (c -d) 2 or ab ̸ = 0.If d = 0, then p ± 4 = (0, 0), so the clouds C ± are identical.If a = 0, then p 1 = (0, 0) and C ± are related by the 180 • rotation around the origin: (x, y) → (-x, -y).If b = 0 or c = 0, then C ± are related by the reflection (x, y) → (x, -y), so distances cannot distinguish these mirror images. We compute NDP(C ± ) below to distinguish all non-rigidly equivalent C + ̸ ∼ = C -, see Fig. ??.For the basis point p + 1 , the matrix SD(C + ; p + 1 ) = 9a 2 + d 2 is the single squared distance. Lemma B.1 gives the orthogonal vector q + 1 = (d, 3a) ⊥ p + 1 . M (C + ; p + 1 ) consists of the 3 unordered columns-3a 2 + d(d + c) a 2 -c 2 + d 2 a 2 -3d(c + d)) -a(3c + 4d) 2ac a(c + 4d) -3a 2 + d(d -c) a 2 -c 2 + d 2 a 2 + 3d(c -d) a(3c -4d) -2ac a(4d -c) -3(a 2 + d 2 ) a 2 -3d(c + d) a 2 + 3d(c -d) 8ad -a(c + 4d) a(c -4d)By Lemma B.3(b), the reflection C + → C -changes the sign of the last row in the matrix M from any point-based representation PR. Indeed, changing the sign of the last row in each matrix M from NDP(C + ) makes this matrix identical to one of the matrices from NDP(C -), up to a permutation of columns as always. However, with all signs kept, the above unordered collections of four matrices are different unless all elements in the last row vanish, which happens only for a=0, when C + = C -are identical.Case c = 0 is symmetric to the case c = 0 under the reflection (x, y) → (y, x), which swaps b ↔ c and a ↔ d.We have considered only non-negative values of a, b, c, d because all other cases are obtained by symmetries. For example, the reflection y → -y maps the cloudC + (a, b, c, d) to C -(a, -b, c, d) = C -(a, b, -c, d).Example C.2 importantly demonstrates that the invariant NDP is simple enough for manual computations.A numerical experiment can only illustrate but not prove the conclusion of Example C.2 that all (infinitely many) non-rigidly equivalent clouds C ± are distinguished by NDP.
D. Generalization of section 4 and all proofs in dimensions n ≥ 2This appendix extends the metrics to dimensions n ≥ 2 and proves all metric results from section 4 in full generality.The point-based representation in Definition B.2 included the matrix SD(p 1 , . . . , p n-1 ) of squared distances, which can be rewritten as a vector row-by-row.Below we can take any norm on matrices and choose the simplest max norm below for consistency with the bottleneck distance and for Lipschitz constant 2 in Theorem E.5. ), q{n -1} = (q 1 , . . . , q n-1 ) of ordered points, from Definition B.2. The Point-Based Representation Metric between the PRs above is Definition D.4 (NBM : Nested Bottleneck Metric). Let A, B ⊂ R n be any clouds of m unordered points. For any ordered points p 1 . . . , p n-2 ∈ A and q 1 . . . , q n-2 ∈ B, the complete bipartite graph Γ(A; p 1 , . . . , p n-2 ; B; q 1 , . . . , q n-2 ) has m -n + 2 white vertices and m -n + 2 black vertices representing PR(A; p 1 , . . . , p n-1 ) and PR(B; q 1 , . . . , q n-1 ) for all m -n + 1 variable points p n-1 ∈ A \ {p 1 , . . . , p n-2 } and q n-1 ∈ B -{q 1 , . . . , q n-2 }, respectively.PRM = max{ |R(p{n -1}) -R(q{n -1})|, w D , |R(A) -R(B)|, w M }, where w D = d ∞ SD(p{n -1}) R(p{n -1}) , SD(q{n -1}) R(q{n -1}) ,andw M = BD M (A; p{n -1}) R(A) , M(Set the weight w(e) of an edge e joining the vertices represented by PR(A; p 1 , . . . , p n-1 ) and PR(B; q 1 , . . . , q n-1 ) as PRM between these PRs, see Definition D.2. Then Definition 4.3 gives us the bottleneck matching distance BMD(Γ(A; p 1 , . . . , p n-2 ; B; q 1 , . . . , q n-2 )). We continue dropping points iteratively. For any 1 ≤ k ≤ n -2 and ordered points p 1 . . . , p k-1 ∈ A and q 1 . . . , q k-1 ∈ B, the complete bipartite graph Γ(A; p 1 , . . . , p k-1 ; B; q 1 , . . . , q k-1 ) has m -k + 1 white vertices and m -k + 1 black vertices representing NDP(A; p 1 , . . . , p k ) and NDP(B; q 1 , . . . , q k ) for all m -k + 1 variable points p k ∈ A \ {p 1 , . . . , p k-1 } and q k ∈ B -{q 1 , . . . , q k-1 }, respectively.Set the weight w(e) of an edge e joining the vertices represented by NDP(A; p 1 , . . . , p k ) and NDP(B; q 1 , . . . , q k ) as BMD(Γ(A; p 1 , . . . , p k ; B; q 1 , . . . , q k )) obtained above. Then Definition 4.3 gives us the bottleneck matching distance BMD(Γ(A; p 1 , . . . , p k-1 ; B; q 1 , . . . , q k-1 )). Finally, for k = 1, we get the Nested Bottleneck Metric NBM(A, B) = BMD(Γ(A, B)).Lemma D.5 (metric axioms for the bottleneck matching distance BMD). Let S, Q be any unordered distributions of the same number of objects with a base metric d. Define the complete bipartite graph Γ(S, Q) whose every edge e joining objects R S ∈ S and R Q ∈ Q has the weight w(e) = d(R S , R Q ). Then the bottleneck matching distance BMD(Γ(S, Q)) from Definition 4.3 satisfies all metric axioms on such unordered distributions.Proof of Lemma D.5. The coincidence axiom means that NBM(S, Q) = 0 if and only if the weighted distributions S, Q are equal in the sense that there is a bijection g : S → Q so that d(g(R), R) = 0 for any R ∈ S.Indeed, if the weighted distributions S, Q can be matched by a bijection, we get a vertex matching E of Γ(S, Q) whose all edges have weights w(e) = 0. Definition 4.3 implies that BMD(Γ(S, Q)) = 0 as required.Conversely, if BMD(Γ(S, Q)) = 0, there is a vertex matching E in Γ(S, Q) with all w(e) = 0. This matching E defines a required bijection S → Q. The symmetry BMD(Γ(S, Q)) = BMD(Γ(Q, S)) follows from Definition 4.3 and the symmetry of the base metric d.To prove the triangle inequalityBMD(Γ(S, Q)) + BMD(Γ(Q, T )) ≥ BMD(Γ(S, T )),let E SQ , E QT be optimal vertex matchings in the graphs Γ(S, Q), Γ(Q, T ), respectively, such thatBMD(Γ(S, Q)) = W (E SQ ), BMD(Γ(Q, T )) = W (E QT ), see Definition 4.3. The composition E SQ • E QT is a vertex matching in Γ(S, T ), so W (E SQ • E QT ) ≥ BMD(Γ(S, T )). It suffices to prove that W (E SQ ) + W (E QT ) ≥ W (E SQ • E QT ).First we estimate the gradient ∇f k of f k at any intermediate point in the line segment between (p 1 , . . . , p n-1 ) and (q 1 , . . . , q n-1 ) with respect to the (n -1) 2 variables x i (v j ) for i, j = 1, . . . , n -1. For k = i, the k-th coordinate ofv n = | . . . | e 1 v 1 . . . v n-1 . . . | . . . | e nis (-1) n+k det(k), where det(k) is the (n -1) × (n -1) determinant obtained from the n -1 vector columns v 1 , . . . , v n-1 by removing the row of all k-th coordinates. Then∂f k ∂x i (v j ) = (-1) n+k ∂ det(k) ∂x i (v j ), which equals 0 for k = i because f k is independent of the coordinate x k (v j ) for j = 1, . . . , n -1.After expanding the determinant det(k) along the i-th row, the only terms containing the factor x i (v j ) form the smaller (n -2) × (n -2) determinant det(k, i) obtained from the n -2 vector columns v 1 , . . . , v j-1 , v j+1 , . . . , v n-1 after removing the rows of all k-th and i-th coordinates.Then |v j | ≤ R = max i=1,...,n-1 {|p i |, |q i |} for any points (v 1 , . . . , v n-1 ) in the line segment between (p 1 , . . . , p n-1 ) and(q 1 , . . . , q n-1 ). The (n -2) × (n -2) determinant det(k, i) equals the signed volume on n -2 vectors of maximum length R and hence has the upper bound R n-2 , so∂f k ∂x i (v j ) = | det(k, i)| ≤ R n-2 .The gradient ∇f k is the vector of (n -1) 2 partial derivatives and can be considered a vector (∇ 1 f k , . . . , ∇ n-1 f k ), where ∇ j f k = ∂f k x 1 (v j ) , . . . , ∂f k x n-1 (v j ) has|∇ j f k | ≤ √ n -1 max i=1,...,n-1 ∂f k ∂x i (v j ) ≤ √ n -1R n-2 .We consider the k-th coordinate f k of v n as a function depending on one parameter t ∈ [0, 1] when the point (v 1 , . . . , v n-1 ) moves along the line segment from (p 1 , . . . , p n-1 ) to (q 1 , . . . , q n-1 ). Then Theorem 5.10 from (Rudin et al., 1976) implies for some intermediate point (v 1 , . . . , v n-1 ) that |f k (p 1 , . . . , p n-1 ) -f k (q 1 , . . . , q n-1 )| = |∇f k (v 1 , . . . , v n-1 ) • (p 1 -q 1 , . . . , p n-1 -q n-1 )| = = n-1 i,j=1∂f k ∂x i (v j )• x i (p j ) -x i (q j ) =n-1 j=1∇ j f k • (p j -q j ) ≤ n-1 j=1 |∇ j f k | • |p j -q j | ≤≤ ε(n -1) max j=1,...,n-1|∇ j f k | ≤ ε(n -1) √ n -1R n-2 .Since e 1 , . . . , e n form an orthonormal basis, we get|p ⊥ n -q ⊥ n | = n k=1|f k (p 1 , . . . , p n-1 ) -f k (q 1 , . . . , q n-1 )| 2 ≤ √ n max k=1,...,n |f k (p 1 , . . . , p n-1 ) -f k (q 1 , . . . , q n-1 )| ≤ √ nε(n -1) √ n -1R n-2 ≤ εn(n -1)R n-2 for any n ≥ 3. If n = 3, the final upper bound can be improved to ε2 √ 6R.Proposition E.3 (Lipschitz continuity of PR under perturbations of a cloud). Let B ⊂ R n and a base sequence q{n-1} ⊂ B be obtained from a cloud A ⊂ R n and a base sequence p{n -1} ⊂ A, respectively, by perturbing every point in its Euclidean ε-neighborhood. Then Proof of Proposition E.3. (a) Let p 1 . . . , p m be all points of A so that the first n -1 points p 1 , . . . , p n-1 form the base sequence p{n -1}. Let q i ∈ B be an ε-perturbation of p i , so q 1 . . . , q m are all points of B and the first n -1 points q 1 , . . . , q n-1 form the base sequence q{n -1}. The radius of A is R(A) = max |p i -p j | ≤ |p i -q i | + |q i -q j | + |q j -p j | ≤ |q i -q j | + 2ε, |q i -q j | ≤ |q i -p i | + |p i -p j | + |p j -q j | ≤ |p i -p j | + 2ε.Hence |p i -p j | -|q i -q j | ≤ 2ε for all i, j = 1, . . . , m.To estimate the max metric d ∞ in (D.2), we rewrite the difference between the corresponding elements in the matrices SD/R of squared distances normalized by the radii in the notations r(A) = R(p{n -1}) and r(B) = R(q{n -1}). Without loss of generality, assume that r(A) ≥ r(B). To estimate the bottleneck distance BD between the matrices M/R in (D.2), which involve scalar products, we shift both clouds A, B so that their centers O(A) and O(B) coincide with the origin 0 ∈ R n . We keep the same notation p i , q i for all points for simplicity. Since |O(A) -O(B)| ≤ ε by part (a), the relative shift by a vector of a maximum length ε guarantees all corresponding points are now 2ε-close, i.e. |p i -q i | ≤ 2ε. Below we estimate the difference between scalsr products involving any 2ε-close points p ∈ A \ p{n -1} and q ∈ B -q{n -1} for i = 1, . . . , n -1 (indexing points from the base sequences) and i = n for the orthogonal vectors p n = p ⊥ n , q n = q ⊥ n .Then |p i -p j | 2 r(A) - |q i -q j | 2 r(B) ≤ | |p i -p j | 2 -|q i -q j | 2 | r(A) + |q i -q j |Case i = 1, . . . , n -1. The bottleneck distance BD has the upper bound obtained from estimating the differences below in the M/R matrices for any point p ∈ A \ p{n -1} matched with its 2ε-perturbation q ∈ B -q{n -1}. Without loss of generality, assume that R(A) ≥ R(B). Then  It suffices to show that the image f (q) of any other point q ∈ A \ {p} is 3 √ 2d-close to a unique point q ′ ∈ B that we will find below. Since all distances and scalar products are preserved under f , we use the matrix M (f (A); f (p)) p • p i R(A) - q • q i R(B) ≤ |p • p i -q • q i | R(A) + |q • q i | |R(|p • p i -q • q i | ≤ |(p -q) • p i + q • (p i -q i )| ≤ |p -q| • |p i | + |q| • |p i -q i | ≤ 2ε(R(A) + R(B)).f (q) • f (p) R(A) - q ′ • p ′ R(B)≤ δ, where the first fraction is the x-coordinate of f (q).To get the x-coordinate q ′ • p ′ |p ′ | of the point q ′ ∈ B, where |p ′ | is δ-close to R(A) = |p|, use the triangle inequality: Then the x-coordinates of f (q) ∈ f (A) and q ′ ∈ B differ by at most 3d. Applying the same arguments to the scalar products involving the orthogonal vectors p ⊥ , p ′⊥ , which have the same lengths as p, p ′ , respectively, conclude that the y-coordinates of f (q), q ′ also differ by at most 3d. So |f (q) -q ′ | ≤ (3d) 2 + (3d) 2 = 3 √ 2d, set β(q) = q ′ .f (q) • f (p) R(A) - q ′ • p ′ |p ′ | ≤ f (q) • f (p) R(A) - q ′ • p ′ R(B) + + q ′ • p ′ R(B) - q ′ • p ′ |p ′ | ≤ d + |q ′ • p ′ | R(B)|p ′ | | R(B) -|p ′ | | ≤ d + |q ′ | • |p ′ | R(B)|p ′ | | R(B) -|p ′ | | = d + |q ′ | R((right)  leaving other cases open.
Figure 1 .1Figure 1. Left: rigid classes of m unordered points in R n form a continuous space, which had no complete and bi-continuous invariants for m > 3, n > 1. Right: the space of 3 points under isometry is parametrized by distances 0 < a ≤ b ≤ c ≤ a + b.
(a) Completeness: any clouds A, B of unordered points are related by a rigid motion of R n if and only if I(A) = I(B). (b) Metric axioms: 1) d(α, β) = 0 ⇔ α = β; 2) d(α, β) = d(β, α); 3) d(α, β)+d(β, γ) ≥ d(α, γ) for all α, β, γ ∈ X.
Figure 2 .2Figure 2. The infinite family of non-isometric clouds C + ̸ ≃ C - sharing p1, p2, p3 and depending on free parameters a, b, c, d.
Figure 3 .3Figure 3. A Point-based Representation (PR) encodes a cloud A in the basis of a point p ∈ A. All PRs are combined into the complete invariant NDP(A). NDPs are compared by the Nested Bottleneck Metric (NBM) computed from a complete bipartite graph Γ(A, B) with weights equal to distances between PRs.
be the vertex set of a regular m-sided polygon. Then A m has the center of mass O(A m ) = (0, 0) at the origin and is inscribed in the circle of the radius R = R(A m ). In Definition 3.1, choose the point p = (R, 0) ∈ A m , which doesn't affect PR(A m ; p) due to the rotational symmetry of A m . Then the matrix M (A m ; p) consists of m -1 columns R 2 cos(2πi/m) R 2 sin(2πi/m) , i = 1, . . . , m -1. The pair is PR(A m ; p) = R 2 Let the cloud B m ⊂ R 2 be A m after adding the extra point at the origin 0 ∈ R 2 . For any point p ∈ A m , the new point-based representation PR(B m ; p) is obtained from PR(A m ; p) above by adding the zero column to the matrix M (A m ; p). For the extra point at the origin 0, the representation is PR(B m ; 0) = [0, M (B m ; 0)], where M (B m ; 0) is the 2 × m matrix consisting of zeros. Theorem 3.3 (realizability of abstract PR). Let s > 0 and M be any 2 × (m -1) matrix for m ≥ 2. The pair [s, M ] is realizable as a point-based representation PR(A; p) for a cloud A ⊂ R n of m unordered points with O(A) = 0 and a point p ∈ A if and only if s + m-1 j=1
Definition 4.2 (Point-Based Representation Metric PRM). Let PR(A; p), PR(B; q) be point-based representations of clouds A, B ⊂ R 2 of m unordered points for base points p ∈ A and q ∈ B, respectively, see Definition 3.1. The Point-based Representation Metric between the PRs above is PRM = max{ | |p|-|q| |, |R(A)-R(B)|, w M }, where
1. Definition 4.4 builds a graph Γ(A, B) on all point-based representations of A, B ⊂ R n and introduces the Nested Bottleneck Metric NBM(A, B) as BMD of Γ(A, B).
Definition 4.4 (NBM : Nested Bottleneck Metric). Let clouds A, B ⊂ R 2 consist of m unordered points. The complete bipartite graph Γ(A, B) has m white vertices (one for each p ∈ A) and m black vertices (one for each q ∈ B). Any edge e of Γ(A, B) has endpoints associated with pointbased representations PR(A; p), PR(B; q), and the weight w(e) = PRM PR(A; p), PR(B; q) . The Nested Bottleneck Metric is defined as NBM(A, B) = BMD(Γ(A, B)). Example 4.5 (4-point clouds C ± ). In R 2 , consider the 4point clouds C ± = {p 1 , p 2 , p 3 , p ± 4 }, where p 1 = (4a, 0), p 2 = (b, c), p 3 = -p 2 = (-b, -c), p + 4 = (0, 4d), and p - 4 = (0, -4d) for parameters a, b, c, d ≥ 0, see Fig. 2. Appendix C will explicitly compute NDP(C ± ) to distinguish all clouds C + ̸ ∼ = C -. Fig. 4 shows the new metric NBM for variable parameters a, b and fixed c, d. NBM > 0 implies that C + ̸ ∼ = C -, except in the singular cases below. If a = 0 or d = 0 or b = c = 0, the clouds are related by a 2-fold rotation around the origin 0. If a = √ 3 2 ≈ 0.87, b = 0, c = 2, d = 0.5, then C + consists of the vertices (0, ±2), (2 √ 3, 0) of an equilateral triangle, where (0, 2) is the double point p 2 = p + 4 . Then C -is the same equilateral triangle but its vertex (0, -2) is the double point p 3 = p - 4 . Because these clouds are related by rotation, NBM = 0 in the black pixel at a = √ 3 2 ≈ 0.87, b = 0 in Fig. 4.
Figure 4 .4Figure 4. The Nested Bottleneck Metric NBM in Definition 4.4 for the clouds C ± ⊂ R 2 that depend on parameters a, b and are not distinguished by 6 pairwise distances in Fig. 2, see Example C.1.
For a fixeddimension n, all algorithms for m unordered points will have polynomial times in m in the RAM model. Theorem 5.1 (Lipschitz continuity of NBM). Let B ⊂ R 2 be obtained from a cloud A ⊂ R 2 by perturbing every point of A up to Euclidean distance ε. Then NBM(A, B) ≤ 6ε. To illustrate Theorem 5.1, we generated uniformly random clouds A in the unit square and cube. To get a perturbation B of A, we shifted every point of A by adding a uniformly random value in [-ε, ε] to each coordinate, where ε ∈ [0.01, 0.1] is a noise bound. Fig. 5 shows how the Nested Bottleneck Metric (NBM, averaged over several clouds) linearly increases with respect to the noise bound.
Figure 5 .5Figure 5. The metric NBM(NDP(A), NDP(B)) for a random cloud A and its ε-perturbation B increases at most linearly in the noise bound ε with a Lipschitz constant λ2 < 6 as in Theorem 5.1. Theorem 5.2 (NDP time). For any cloud A ⊂ R 2 of m unordered points, the Nested Distributed Projection NDP(A) is computed in time O(m 2 ) with space O(m 2 ). Theorem 5.3 (NBM time). For any clouds A, B ⊂ R 2 of m unordered points, the Nested Bottleneck Metric NBM(A, B) is computable in time O(m 3.5 log m) with space O(m 3 ).
Figure 6 .6Figure 6. Times (microseconds, log scale) of metrics on invariants.
Fig. 66Fig. 6 illustrates a polynomial dependence of the NBM time in Theorem 5.3. Theorem 5.4 says that any m-point clouds A, B ⊂ R 2 can be matched up to a perturbation proportional
High accuracies of D(A, p; 4) in Table4are explained by the following cascade computations. First, split all clouds from Table3by the 1st distance (to the nearest neighbor of a central atom p) rounded to 3 decimal places in Å. This is a typical experimental precision, where 1 Å = 10 -10 m is the smallest interatomic distance. Second, split each subset with equal 1st distances by 2nd distances, and so on up to k = 5 distances. All clouds of different elements in QM9 and GD0 were separated by D(A, p; 4) and D(A, p; 5), respectively.We compared full molecules starting with the pseudo-metric L ∞ (max abs difference of corresponding coordinates) on SRVs of all 873,527,974 pairs of 3D atomic clouds having equal numbers of atoms in QM9, then 8,735,279 distances L ∞ on SDVs of the 1% closest pairs, 87,352 EMDs on PDDs of the 1% closest pairs, and NBMs on NDPs for the final 10K closest pairs. In this hierarchical computation, large values of L ∞ (then EMD) guarantee that molecules are distant and cannot be closely matched by rigid motion. Tiny or zero values of pseudo-metrics guarantee nothing because SDV and PDD can coincide for very different clouds, see Fig.2, Fig.S4in(Pozdnyakov et al., 2020).
Table 5 .5Fig. 7 compares the new metric y = NBM on complete NDPs with the pseudo-metric x = PDD. All pairs A, B with (x, y) close to the vertical axis in Fig. 7 (left) have EMD ≈ 0 because they are almost mirror images (indistinguishable by PDD) well distinguished by higher values of NBM. Fig. 8 shows bonds by standard visualization, they were not used for clouds of points without any edges.
Figure 7 .7Figure 7. x = EMD(PDD(A), PDD(B)) vs y = NBM(A, B) on complete invariants NDP with zoomed-in comparisons on the right, which all appear only for chemically identical molecules.
Figure 8 .8Figure 8. Left: chemically different QM9 molecules 28141 and 130099 have the smallest distances NBM ≈ 0.15 Å. Right: molecules 70954 and 74130 are almost mirror images with EMD ≈ 0.0004 Å but are well distinguished by NBM ≈ 1.619 Å.
Conditions 1.1(d,e,f) enable a generation of real clouds in CRS(R n ; m) from their invariants. A full answer to the question 'same or different, and how much different' required complete invariants with Lipschitz continuous metrics. The key contribution is a theoretically justified solution to Problem 1.1. The experiments on the databases QM9 and GEOM drugs are considered complementary. Example C.1 and its extension in Example C.2 prove that infinitely many pairs of non-isometric clouds C + ̸ ∼ = C -(depending on 4 free parameters and having the same 6 pairwise distances) are distinguished by the new invariants. This result is impossible to justify by any finite experiment. Example C.1 demonstrated the non-zero distances between the complete invariants of C ± in Fig. ??.
Figure 9 .9Figure 9. Left: each dot represents one QM9 molecule whose atomic cloud has two largest roots l1 ≥ l2 of eigenvalues (moments of inertia (Nemec, 2022) or elongations in principal directions) in Angstroms (1 Å = 10 -10 m ≈ smallest interatomic distance). The color represents the free energy G characterizing molecular stability. Right: each dot represents one QM9 molecule whose atomic cloud has coordinates x, y expressed via the roots l1 ≥ l2 ≥ l3 ≥ 0 of three eigenvalues.
Figure 10 .10Figure 10. Left: each dot is a comparison of closest atomic clouds A, B from QM9 by the distances L∞ on SRV vs L∞ on SDV. Right: zoomed-in comparisons for very small distances.
Fig. 12 (12Fig. 12 (left)  shows the simplest projections of the atomic clouds from QM9, see the familiar molecules such as H 2 O (water). Any small region on such a map can be zoomed in and displayed in other invariants from Table2, see Fig.12(right).
Figure 11 .11Figure 11. Left: each dot is a comparison of closest atomic clouds A, B from QM9 by the distances L∞ on SDV vs EMD on PDD. Right: zoomed-in comparisons for very small distances.
Figure 12 .12Figure 12. QM9 maps: each dot colored by the free energy G represents an atomic cloud. Left: x = SRV1, y = SRV1 -SRV2. Right: all molecules with SRV1 = SRV2 (two equidistant atoms from the center of mass) are projected to x = SRV2, y = SRV2 -SRV3.
Definition B.2 extends a point-based representation from Definition 3.1 to dimensions n ≥ 2. The key idea is to represent any m-point cloud A ⊂ R n relative to (a simplex of) any base sequence of ordered points p 1 , . . . , p n-1 ∈ A. If the vectors p 1 , . . . , p n-1 are linearly independent, they form with the vector p ⊥ n from Lemma B.1 a (not necessarily orthogonal) basis in R n . Below we represent any point p ∈ A by normalized scalar products, which are valid even if p 1 , . . . , p n-1 are linearly dependent. Definition B.2 (point-based representation PR for n ≥ 2). For any cloud A ⊂ R n of m unordered points, the center of mass is O
Lemma B. 3 (3PR under isometry). Let a point cloud A ⊂ R n have a base sequence (p 1 , . . . , p n-1 ).(a) Any rigid motion f of R n respects point-based representations from Definition B.2 so that PR(A; p 1 , . . . , p n-1 ) = PR(f (A); f (p 1 ), . . . , f (p n-1 )).
the Gram matrix of the columns of Q √ D. These columns become the reconstructed vectors p 1 , . . . , p m-1 ∈ R n . If there is another diagonalization QT GM Q = D for Q ∈ O(n), then D differs from D by a permutation of eigenvalues, which is realized by an orthogonal map, so we set D = D. Then GM = QD QT = ( Q√ D)( Q√ D) T is the Gram matrix of the columns of Q√ D.
by justifying a time for a point cloud reconstruction based on Lemma B.4. Lemma B.5 (reconstruction). (a) Any sequence of ordered points p 1 , . . . , p m in R n can be reconstructed (uniquely up to isometry) from the matrix of the Euclidean distances |p i -p j | in time O(m 3 ). If all distances are divided by R = max i=1,...,m |p i |, the reconstruction of p 1 , . . . , p m is unique up to isometry and uniform scaling in R n . (b) If m ≤ n, the uniqueness of reconstructions in part (a) remains true if we replace isometry by rigid motion in R n . (c) Any cloud A ⊂ R n of m unordered points can be reconstructed (uniquely up to rigid motion in R n ) from a point-based representation PR(A; p 1 , . . . , p n-1 ) in time O(m 3 ) for any p 1 , . .
MTheorem B.7 extends Theorem 3.3 to dimensions n ≥ 2.Theorem B.7 (realizability of abstract PR). Let S be a symmetric n × n matrix of s ij ≥ 0 with s ii = 0. Let M be any n × (m -n + 1) matrix for m ≥ n. The pair [S, M ] is realizable as a point-based representation PR(A; p 1 , . . . , p n-1 ) for a cloud A ⊂ R n of m points with O(A) = 0 and a base sequence p 1 , . . . , p n-1 if and only if (1) the (n -1) × (n -1)matrix G ij = 1 2 (s 1i + s 1j -s ij) has only positive eigenvalues, which uniquely determines p 1 , . . . , p n-1 up to isometry, ij = 0 for i = 1, . . . , n, where p n = p ⊥ n is the orthogonal vector from Lemma B.1.
Figure 13 .13Figure 13. The spaces in yellow for triangles (D3) and parallelograms (D4) under rigid motion and uniform scaling in R 2 .
Figure 14 .14Figure 14. The (blue) subspace of all isosceles triangles in CSS(R 2 ; 3). Left: isosceles triangles with |p1 -p2| = |p1 -p3|. Right: isosceles triangles with |p3 -p1| = |p3 -p2|.
Figure 15 .15Figure 15. The (yellow) subspace D4 of all parallelograms with p1 = (R, 0) and p3 = (-R, 0) in CSS(R 2 ; 4). Left: the (blue) subspace of rectangles. Right: the (orange) subspace of rhombi.
Figure 16 .16Figure 16. Left: the (yellow) subspace of kites in CSS(R 2 ; 4) parametrized by p2 ∈ K4. Right: the subspace of qmeds is parametrized by x ∈ [-R, R] and p2 in the yellow region.
and then taking p 2 in the disk with the radius R and center s to guarantee that|p 3 | = |p 2 -s| ≤ R.Case m = 4 of tetrahedra in R 3 . In R 3 , we similarly fix the center of mass at the origin and the most distant points p 1 at (R, 0, 0). The second most distant point p 2 (if not in the line through 0 and p 1 ) forms a base sequence p 1 , p 2 and can be fixed at (x, y, 0) with x 2 + y 2 ≤ R 2 , which determines the mid-point p 3,4 p3+p4 2 = (-x+R 2 , -y 2 , 0). Due to the symmetry p 3 ↔ p 4 around p 3,4 , it remains to choose p 3 in the upper half ball with the center p 3,4 and radius x 2 + y 2 . The clouds in Example C.1 are instances of C ± from Example 4.5: K = C + , T = C -for 4a = b = c = 4d = 2 √ 2 and are easy enough to write their NDPs below.
Figure 17 .17Figure 17. Non-isometric clouds of 4 points with the same 6 pairwise distances. Left: the trapezoid T has points (±2, 1), (±4, -1). The kite K has (5, 0), (-3, 0), (-1, ±2).
Figure 18. The Nested Bottleneck Metric NBM from Definition 4.4 for the 4-point clouds C ± ⊂ R 2 with variable parameters a, d, see details in Example C.1.
Definition D. 11(max norm and metric on matrices). The max norm ||D|| ∞ = max i,j |D ij | of a matrix is the maximum absolute value of its elements D ij . The max metric between matrices M, M ′ of the same size is d ∞ = ||M -M ′ || ∞ . Definition D.2 will extend Definition 4.2 to dimensions n ≥ 2. Below the notation SD/R means that all elements of a matrix SD are divided by R. The radius of a base sequence p{n -1} = (p 1 , . . . , p n-1 ) ⊂ A is defined as R(p{n -1}) = max i=1,...,n-1 |p i | in the same way as R(A) of a full cloud A. The notation M/R means that all elements in the first n -1 rows of a matrix M are divided by R, and by R n-1 in the n-th row, because p ⊥ n in Lemma B.1 is a polynomial of degree n -1. Then PRM and further metrics have units of original points. One more division by R makes all metrics invariant under scaling. Definition D.2 (Point-Based Representation Metric). Let clouds A, B ⊂ R n of m unordered points have base sequences p{n -1} = (p 1 , . . . , p n-1
B; q{n -1}) R(B) . Lemma D.3 (axioms for PRM). PRM in Definition D.2 satisfies all metric axioms from Problem (1.1b) on any point-based representations from Definition B.8. Proof of Lemma D.3. The first axiom means that PRM(PR(A; p{n -1}), PR(B; q{n -1})) = 0 if and only if these PRs are identical. The part if : by Lemma B.5(c), equal PRs guarantee that the clouds A, B are rigidly equivalent, so R(p{n -1}) = R(q{n -1}), R(A) = R(B), SD(p{n -1}) = SD(q{n -1}), and M (A; p{n -1}) = M (B; q{n -1}), so PRM = 0. The part only if : by Definition D.2 the equality PRM = 0 means that R(A) = R(B) and w D = 0 = w M . The coincidence axioms for the max metric and bottleneck distance together with R(p{n -1}) = R(q{n -1}) and R(A) = R(B) imply that SD(p{n -1}) = SD(q{n -1}) and M (A; p{n -1}) = M (B; q{n -1}). Then the point-based representations become identical: PR(A; p{n -1}) = PR(B; q{n -1}).The symmetry axiom for PRM follows from the symmetry axiom for the bottleneck distance and max metric d ∞ . Since each of the distances |R(A) -R(B)|, w D , w M satisfies the triangle inequality, then so does their maximum, see metric transforms in section 4.1 of(Deza & Deza, 2009).Definition D.4 extends Definition 4.4 to all dimensions n > 2.
(a) |O(A) -O(B)| ≤ ε, |R(p{n -1} -R(q{n -1})| ≤ 2ε, and |R(A) -R(B)| ≤ 2ε; (b) PRM PR(A; p{n -1}), PR(B; q{n -1}) ≤ λ n ε for λ 2 = 6, λ 3 = 16, λ n = 3n 2 , n > 3.
q i | ≤ ε. If the radius R(A) is attained at a point p i ∈ A, then R(A) = |p i -O(A)| ≤ ≤ |p i -q i | + |q i -O(B)| + |O(B) -O(A)| ≤ ε + max i=1,...,m |q i -O(B)| + ε = 2ε + R(B).Swapping the clouds A, B gives the opposite inequality R(B) ≤ 2ε + R(A), so |R(A) -R(B)| ≤ 2ε. The radii of the base sequences also differ by at most 2ε, i.e. |R(p{n -1}) -R(q{n -1})| ≤ 2ε. (b) All corresponding points of the given clouds A, B are ε-close so that |p i -q i | ≤ ε for all i = 1, . . . , m. Any distance |p i -p j | changes by at most 2ε under perturbation, because
2 |r(B) -r(A)| r(A)r(B)for i, j = 0, . . . , n -1, where p 0 = O(A) and q 0 = O(B) are centers of mass. In the first term above, we estimate the difference of squares by factorizing:| |p i -p j | 2 -|q i -q j | 2 | = | |p i -p j | -|q i -q j | | • (|p i -p j | + |q i -q j |) ≤ 2ε(2r(A) + 2r(B)).Using r(A) ≥ r(B), the bounds| |p i -p j | 2 -|q i -q j | 2 | r(A) ≤ 4ε r(A) + r(B) r(A) ≤ 8ε, |q i -q j | 2 |r(B) -r(A)| r(A)r(B) ≤ (2r(B)) 2 • 2ε r(A)r(B) ≤ 8ε give d ∞ SD(p{n -1}) r(A) , SD(q{n -1}) r(B) ≤ 16ε.
Due to |q • qi | ≤ |q| • |q i | ≤ R 2 (B), the second term above has the upper bound R 2 (B) • 2ε R(A)R(B) ≤ 2ε. Estimate the differenceof products in the first term above:
rotation of R 2 around 0 such that f (p) is also in the positive x-axis. By Definition 4.2, f (p), p ′ in the x-axis have lengths satisfying |p| = |f (p)|, | |p| -|p ′ | | ≤ d and hence are d-close: |f (p) -p ′ | ≤ d.
instead of M (A; p) in computing PRM. Each column of M (f (A); f (p)) R(A) consists of f (q) • f (p) |R(A)| , f (q) • f (p ⊥ ) |R(A)|, wheref (p) = (|p|, 0), f (p ⊥ ) = (0, |p|), R(A) = |p|. ≤ d guarantees that the above column is d-close to the column of q ′ • p ′ |R(B)| , q ′ • p ′⊥ |R(B)|for a point q ′ ∈ B determined by computing the bottleneck distance BD above. For the first scalar products involving p, p ′ , we have
B) | R(B) -|p ′ | | ≤ d + |R(B) -|p ′ || ≤ d + | R(B) -|p| | + | |p| -|p ′ | | ≤ 2d + | R(B) -|p| | = 2d + |R(B) -R(A)| ≤ 3d.

Table 1 .1Acronyms and references of all key concepts in the paper.all conditions of Problem 1.1. The major advantage of NDPis its applicability to all real clouds A ⊂ R 2 without anyrequirement of general position. Some points of a cloud Amay coincide, so A can be a multiset of points.Definition 3.4 (invariants NDP and NCP). Let A ⊂ R 2 beany cloud of m unordered points. The Nested DistributedProjection NDP(A) is the unordered set of PR(A; p) forall p ∈ A. If k > 1 representations PR(A; p) are equalthen we collapse them to one representation with the weightk/m. The resulting set of unordered PRs with weights iscalled the Nested Compressed Projection NCP(A).PRPOINT-BASED REPRESENTATIONDEF 3.1NDPNESTED DISTRIBUTED PROJECTIONDEF 3.4PRM POINT-BASED REPRESENT. METRICDEF 4.2BMD BOTTLENECK MATCHING DISTANCE DEF 4.3NBM NESTED BOTTLENECK METRICDEF 4.4For the cloud A m from Example 3.2, the Nested DistributedProjection NDP(A m ) consists of m identical representa-tions, so NCP(A m ) is the single representation PR(A m ; p)with weight 1. The invariant NDP is an expanded ver-sion of the NCP, where all PRs have equal weights 1/m.The full invariant NDP(A) includes the faster (linear-time)vector of squared distances |p| 2 from the center of massO(A) = 0 ∈ R 2 to all points p ∈ A. If A has a distin-guished point p, e.g. a special atom in a molecule, thepoint-based representation PR(A; p) is invariant.Theorem 3.5 (completeness of NDP). The Nested Dis-tributed Projection is complete in the sense that any cloudsA, B ⊂ R 2 of m unordered points are related by rigid mo-tion in R 2 if and only if NDP(A) = NDP(B) so that thereis a bijection NDP(A) → NDP(B) matching all PRs.Definition 3.4 combines point-based representations PR(A; p) for all points p ∈ A into one invariant NDP (Nested Distributed Projection) that will be proved to satisfy
, . . . , v n ) ∈ R n , the Minkowski norm is ||v|| ∞ = maxDefinition 4.1 (bottleneck distance BD). For any v =(v 1 i=1,...,n|v i |. For clouds A, B ⊂ R n of m unordered points,the bottleneck distance BD(A, B) = inf g:A→Bp∈A sup||p -g(p)|| ∞ is minimized over all bijections g : A → B.This section will define the metric NBM on invariants NDPby using the bottleneck distance BD in Definition 4.1, a met-ric on point-based representations (PRs) in Definition 4.2,and a bottleneck matching distance in Definition 4.3.
Table 3 .3Countsof atoms by chemical elements in QM9 (2,407,753atoms), GD0 (GEOM drugs 0th conformers, 12,917,980 atoms).QM9: HQM9: CQM9: N QM9: O QM9: F1,230,122 846,557139,764 187,996 3,314GD0: HGD0: CGD0: N GD0: O GD0: F5,660,986 5,267,096 842,562 854,400 64,299GD0: PGD0: SGD0: Cl GD0: Br GD0: I1,350159,64853,40414,010225
Table 4 .4Accuracies in percentages for predicting chemical elements by a 4-layer network using only Euclidean distances from an atomic center to its k nearest neighbors for QM9 and GD0.datak = 2 k = 3 k = 4 k = 5 k = 6QM9 94.63 98.64 98.24 98.54 98.77GD0 91.44 96.67 98.05 98.70 98.49
Table 6 .6Parameters of the default 4-layer network for predictions in Table4.LAYER (TYPE)OUTPUT SHAPE NUMBER OF PARAMETERSDENSE (DENSE)(NONE, 32)352BATCH NORMALIZATION(NONE, 32)128RE LU (RELU)(NONE, 32)0DENSE 1 (DENSE)(NONE, 5)165
Table 7 .7Past ML and non-ML predictions of chemical elements have lower accuracies than by distance invariants in Table4.METHODDESCRIPTIONACCURACY REFERENCELEAFLOCAL COORDINATION GEOMETRY86%(VASYLENKO ET AL., 2025)MATSCHOLAR ML-DERIVED FROM LITERATURE81%(WESTON ET AL., 2019)MAT2VECML-DERIVED FROM LITERATURE80%(TSHITOYAN ET AL., 2019)ATOM2VECML-DERIVED FROM COMPOSITIONAL CONTENT79%(ZHOU ET AL., 2018)GNOMEFREQUENCY OF ELEMENTS AT THE SAME ATOMIC SITES79%(MERCHANT ET AL., 2023)MAGPIEELEMENTAL PHYSICAL CHARACTERISTICS78%(WARD ET AL., 2016)OLIYNYKELEMENTAL PHYSICAL CHARACTERISTICS75%(OLIYNYK ET AL., 2016)MEGNETML-DERIVED FROM ATOM, BOND AND GRAPH ATTRIBUTES 73%(CHEN ET AL., 2019)SKIPATOMML-DERIVED FROM ATOM CONNECTIVITY GRAPHS68%(ANTUNES ET AL., 2022)