\section{Introduction to Part I}\label{sec:intro-additive} For coordinate distances $s,t$, put $a=h(s)$ and $b=h(t)$. The product distance is $\psi(a+b)$. For every $\lambda>0$, the exponential kernel $\exp(-\lambda(a+b))$ factors as $\exp(-\lambda a)\exp(-\lambda b)$. We use this formula to cancel a common factor and to recover a space from a finite power. \subsection*{Main results and their scope} As in \eqref{eq:general-product}, write $d\times_F e$ for the function obtained by combining the coordinate distances of $\MetricSpace{X}{d}$ and $\MetricSpace{Y}{e}$ by $F$. If both factors are compact and $F$ is continuous, then whenever $d\times_F e$ is a metric it induces the product topology (\Cref{lem:product-topology}). We impose no triangle inequality on the transformed function $h\circ d$. \begin{theorem}\label{thm:general-cancellation} Let $h,\psi\colon[0,\infty)\to[0,\infty)$ be continuous strictly increasing functions satisfying $h(0)=\psi(0)=0$. For $s,t\geq0$, set \[ F(s,t)=\psi(h(s)+h(t)). \] Let $\MetricSpace{X}{d}$, $\MetricSpace{Y}{e}$, and $\MetricSpace{K}{\rho}$ be nonempty compact metric spaces. Assume that $d\times_F\rho$ and $e\times_F\rho$ are metrics on $X\times K$ and $Y\times K$, respectively. If $\MetricSpace{X\times K}{d\times_F \rho}\cong \MetricSpace{Y\times K}{e\times_F \rho}$, then $\MetricSpace{X}{d}\cong \MetricSpace{Y}{e}$. \end{theorem} \begin{theorem}\label{prop:general-roots} Let $n\geq2$ be an integer and let $h,\psi\colon[0,\infty)\to[0,\infty)$ be continuous strictly increasing functions satisfying $h(0)=\psi(0)=0$. For $s_0,\ldots,s_{n-1}\geq0$ define \[ F_n(s_0,\ldots,s_{n-1})=\psi\left(\sum_{i=0}^{n-1}h(s_i)\right). \] Let $\MetricSpace{X}{d}$ and $\MetricSpace{Y}{e}$ be nonempty compact metric spaces. Assume that $d_{F_n}$ and $e_{F_n}$ in \Cref{def:metric-product} are metrics on $X^n$ and $Y^n$, respectively. If $\MetricSpace{X^n}{d_{F_n}}\cong\MetricSpace{Y^n}{e_{F_n}}$, then $\MetricSpace{X}{d}\cong\MetricSpace{Y}{e}$. \end{theorem} When $n=2$ we have $F_2=F$, so the square determines the isometry class of the original space (\Cref{thm:general-square}). In particular, $h(s)=s^2$ and $\psi(t)=\sqrt t$ yield an affirmative answer to Ulam's square problem for Euclidean products of compact metric spaces. For $n\geq3$ we again define $F_n$ directly from all coordinate distances. We require no associativity of the binary operation $F$. We prove both theorems in Section~\ref{sec:general-products}. Both theorems require the metric axioms only on the two products being compared. For example, take $h(s)=s^2$ and $\psi(t)=t$. The square of an ultrametric is an ultrametric, so adding the squares of the coordinate ultrametrics defines a product metric. Both theorems therefore apply to compact ultrametric spaces. To see the role of the hypothesis, equip $X=\{0,1,2\}$ with the metric $d(x,y)=|x-y|$. Identifying the product of $\MetricSpace{X}{d}$ and the one-point space $\MetricSpace{\{\ast\}}{0}$ with $X$ identifies $d\times_F 0$ with $d^2$. In this case $d(0,2)^2=4>1+1=d(0,1)^2+d(1,2)^2$. With $h(t)=t^p$ and $\psi(t)=t^{1/p}$, both theorems apply to $\ell^p$ products for $1\leq p<\infty$. A \emph{metrical function} in the sense of Avgustinovich and Fon-Der-Flaass is normalized on the axes, strictly increasing in each coordinate, subadditive, symmetric, and associative (\cite[Definition~2]{Avgustinovich2000}). We state the conditions in \Cref{def:metrical}. Normalization, monotonicity, and subadditivity imply continuity of $F$ (\Cref{lem:metrical-continuity}). Continuity, strict monotonicity, and associativity are the hypotheses of Acz\'el's representation theorem (\cite[p.~59]{Aczel1948}). In \Cref{lem:metrical-generator} we construct a strictly increasing homeomorphism $h$ of the half-line satisfying $h(0)=0$ and prove $F(s,t)=h^{-1}(h(s)+h(t))$. Hence \Cref{thm:general-cancellation} and \Cref{prop:general-roots} imply compact cancellation and uniqueness of finite roots for every metrical function, without a homogeneity assumption (\Cref{cor:metrical-cancellation,cor:metrical-roots}). Avgustinovich and Fon-Der-Flaass showed that a chosen point of a finite metric space determines a unique finest factorization through that point (\cite[Theorem~2]{Avgustinovich2000}). \subsection*{Relation to earlier work} For complete separable metric spaces equipped with probability measures of full support, Evans and Molchanov proved cancellation (\cite[Proposition~3.6(a)]{EvansMolchanov2014}) and unique decomposition into irreducible factors (\cite[Theorem~5.5]{EvansMolchanov2014}) for the sum metric and product measure. Their isometries preserve the measures specified as part of the spaces. Here we start with the finite family of spaces involved in cancellation and construct maximizing measures compatible with products formed by summing the transformed semi-metrics. When the semi-metric $c_M$ is a metric and the measure has full support, the Laplace semicharacters used in reconstruction agree with those of Evans and Molchanov (\cite[Definition~3.1]{EvansMolchanov2014}). For $\ell^2$ products of proper metric spaces, Lytchak proved uniqueness of finite roots (\cite[Theorem~A]{Lytchak2026}) and a decomposition into a Euclidean factor and pointed irreducible factors (\cite[Theorem~D]{Lytchak2026}). We choose measures transported by bijections that preserve sums of continuous semi-metrics, and apply this construction to the general expression $\psi(h(s)+h(t))$. Since $\psi$ is injective, an isometry for the product distances also preserves the sum of the transformed coordinate distances. \subsection*{Selection of measures by rate and distortion} Let $\boldsymbol{M}=(M,c_M)$ be a compact space with a continuous semi-metric. Fix an input measure $\mu\in\ProbabilityMeasures(M)$ and take a probability measure $\pi$ on $M\times M$ with first marginal $\mu$. The measurable coordinate projections $Z(z,\hat z)=z$ and $\widehat Z(z,\hat z)=\hat z$ on $(M\times M,\mathcal B(M\times M),\pi)$ represent the input and its reproduction. Reproducing $z$ by $\hat z$ incurs distortion $c_M(z,\hat z)$. If $\pi_2$ is the second marginal of $\pi$, the mean distortion is $\int_{M\times M}c_M\,d\pi$ and the information about the input retained by the reproduction is $I(Z;\widehat Z)=D(\pi\Vert\mu\otimes\pi_2)$. The rate--distortion function $R_{\mu,c_M}(\Delta)$ in Section~\ref{sec:introduction} takes the infimum of mutual information over joint measures of mean distortion at most $\Delta$. Here we fix $\lambda>0$ and use the minimum of mutual information plus $\lambda$ times mean distortion (\Cref{prop:rate-distortion}). \begin{equation}\label{eq:intro-rate-distortion} \RateDistortionValue{\lambda}(\boldsymbol{M},\mu) =\min_{\substack{\pi\in\ProbabilityMeasures(M\times M)\\(\operatorname{pr}_1)_*\pi=\mu}} \left\{D(\pi\Vert\mu\otimes\pi_2)+\lambda\int_{M\times M}c_M\,d\pi\right\}. \end{equation} The reproduction measure $\pi_2$ on the right also varies. A larger coefficient $\lambda$ places greater weight on mean distortion in the objective. This is the Lagrangian formulation of rate--distortion theory (for finite alphabets see \cite[Eq.~(1.2)]{ChenEtAl2024RateDistortion}). On a metric space $\MetricSpace{M}{d}$ we may use the transformed value $c_M=h\circ d$ as the distortion between each pair of points. Write $C(M,(0,1])$ for the continuous functions from $M$ to $(0,1]$. The operator $K^M_\lambda\colon\ProbabilityMeasures(M)\to C(M,(0,1])$ sends a candidate reproduction measure $q$ to the function $K^M_\lambda[q]\colon M\to(0,1]$. Its value at $x\in M$ and its negative logarithm are \[ K^M_\lambda[q](x)=\int_M \exp(-\lambda c_M(x,y))\,dq(y),\qquad f^M_{\lambda,q}(x)=-\log K^M_\lambda[q](x). \] For a fixed input measure $\mu$ and coefficient $\lambda$, the minimum of $J^M_\lambda(\mu,q)=\int_M f^M_{\lambda,q}(x)\,d\mu(x)$ over reproduction measures $q$ is $\RateDistortionValue{\lambda}(\boldsymbol{M},\mu)$. Given a minimizing measure $q$, let $\pi$ be the coupling provided by \Cref{lem:cost-optimizer} and \Cref{cor:cost-variational-minimizer}. We may choose the conditional probability of the reproduction given $Z=x$ so that, for every Borel set $B\subseteq M$, \[ \pi(\widehat Z\in B\mid Z=x) =\int_B\frac{\exp(-\lambda c_M(x,y))}{K^M_\lambda[q](x)}\,dq(y). \] Moreover, $\widehat Z_*\pi=q$. On the product $\boldsymbol{A}\times\boldsymbol{B}$ of $\boldsymbol{A}=(A,c_A)$ and $\boldsymbol{B}=(B,c_B)$ with sum semi-metric $c_{A\times B}$, the exponential similarity kernel in this formula factors into the kernels on the factors. For a joint measure $\nu$ on $A\times B$ with respective marginals $\alpha,\beta$, this factorization yields \[ \RateDistortionValue{\lambda}(\boldsymbol{A}\times\boldsymbol{B},\nu) \leq \RateDistortionValue{\lambda}(\boldsymbol{A},\alpha)+\RateDistortionValue{\lambda}(\boldsymbol{B},\beta) \] by \Cref{lem:cost-tensor}. For input measure $\alpha\otimes\beta$ the coordinates are independent, so tensorization of mutual information yields the reverse inequality (\Cref{thm:information-tensorization,lem:cost-tensor-additivity}). This equality and the upper bound for arbitrary couplings show that the product of input measures maximizing $\RateDistortionValue{\lambda}$ on the separate factors also maximizes $\RateDistortionValue{\lambda}$ on the product. To select an input measure, we add the minima at several scales and maximize the sum over input measures. For the prescribed factors and their finite ordered products, take a common sequence $\{\lambda_j\}_{j\geq0}$ with $\lambda_j\to\infty$. Define the following functional of the input measure $\mu$. \[ \Psi_{\boldsymbol{M}}(\mu)=\sum_{j=0}^\infty\frac{\RateDistortionValue{\lambda_j}(\boldsymbol{M},\mu)}{\lambda_j}. \] Since $\RateDistortionValue{\lambda}(\boldsymbol{M},\mu)/\lambda$ converges to $0$ uniformly in $\mu$, we can ensure uniform convergence of the series by making $\lambda_j$ increase sufficiently fast. Given two distinct input measures, for all sufficiently large $\lambda$ the functional $\RateDistortionValue{\lambda}(\boldsymbol{M},\cdot)$ satisfies the strict concavity inequality for their mixture at every weight $00$, we obtain $L_t(\boldsymbol{X},\mu_{\boldsymbol{X}})=L_t(\boldsymbol{Y},\mu_{\boldsymbol{Y}})$. In the same way an isometry between powers yields $L_t(\boldsymbol{X},\mu_{\boldsymbol{X}})^n=L_t(\boldsymbol{Y},\mu_{\boldsymbol{Y}})^n$, from which we take positive $n$th roots. The values of the Laplace transform on the positive integer lattice determine the pushforward under the semi-metric matrix map (\Cref{lem:cost-laplace-reconstruction}). Every transformed distance lies in the image of $h$. Pushing this measure forward by the map that applies $h^{-1}$ on that image to each entry recovers the measure induced by the original distance matrix map. Full support and \Cref{lem:reconstruction} imply $\MetricSpace{X}{d}\cong \MetricSpace{Y}{e}$. \subsection*{Organization of Part I} Section~\ref{sec:cost-information} introduces the rate--distortion functional and proves the estimates needed for its optimization. Section~\ref{sec:cost-measures} uses the multiscale rate--distortion functional to construct a product-compatible system of maximizing measures. Section~\ref{sec:general-products} proves cancellation and reconstruction using Laplace semicharacters and applies the results to metrical functions and to $\ell^p$ products with $1\leq p<\infty$.