\section{Cancellation and uniqueness of finite roots for products reducible to sums}\label{sec:general-products} We now use the measures selected in the previous section to prove \Cref{thm:general-cancellation,prop:general-roots}. We need quantities that multiply on products and determine the isometry class of a factor. For a space $\boldsymbol{M}=(M,c_M)$ with a continuous semi-metric, push the product measure $\mu^{\otimes m}$ on $M^m$ forward under the map recording pairwise semi-metric values and take the Laplace transform $L_t(\boldsymbol{M},\mu)$ of this pushforward. The transform for the common factor is positive, so we can divide by it. For finite powers we take positive roots. The resulting transform values determine the pushforward under the semi-metric matrix map. On the image of $h$, the inverse $h^{-1}$ sends each transformed distance to the original distance. Pushing the measure of the transformed matrix forward under this entrywise inverse recovers the measure induced by the original distance matrix map. We then apply the theorems to metrical functions with an additive generator and to $\ell^p$ products with $1\leq p<\infty$. For a compact space $\boldsymbol{M}=(M,c_M)$ with a continuous semi-metric, a probability measure $\mu\in\ProbabilityMeasures(M)$, an integer $m\geq2$, and a nonnegative vector $t=(t_{ij})_{0\leq i0. \] When $c_M$ is a metric and $\supp\mu=M$, this is the semicharacter $\chi_t((M,c_M,\mu))$ of Evans and Molchanov (\cite[Eq.~(3.1)]{EvansMolchanov2014}). As a function of the measured triple $(M,c_M,\mu)$ we also call $L_t$ a \emph{Laplace semicharacter}. After proving multiplicativity, we recover the pushforward under the distance matrix map from the values on the positive integer lattice. \begin{proposition}\label{lem:cost-laplace-product} Let $\boldsymbol{A}=(A,c_A)$ and $\boldsymbol{B}=(B,c_B)$ be compact spaces with continuous semi-metrics, let $\alpha\in\ProbabilityMeasures(A)$ and $\beta\in\ProbabilityMeasures(B)$ be probability measures, and fix an integer $m\geq2$ and a vector $t\in[0,\infty)^{\binom m2}$. Then \begin{equation}\label{eq:cost-laplace-product} L_t(\boldsymbol{A}\times\boldsymbol{B},\alpha\otimes\beta) =L_t(\boldsymbol{A},\alpha)L_t(\boldsymbol{B},\beta). \end{equation} \end{proposition} \begin{proof} Let $\tau\colon(A\times B)^m\to A^m\times B^m$ reorder the coordinates, taking $((x_i,y_i))_{0\leq i0}^{\binom m2}$, then $\MetricSpace{X}{d}\cong\MetricSpace{Y}{e}$. \end{proposition} \begin{proof} Fix $m\geq2$ and set $I=\{(i,j)\mid 0\leq i0}^{I}$ we have \begin{equation}\label{eq:cost-laplace-integer-moments} L_k((M,h\circ\delta),\sigma) =\int_{[0,\infty)^I}\exp\left(-\sum_{0\leq i0}^{I}$. Applying \Cref{thm:lin-dou-laplace} with $n=|I|=\binom m2$ yields $\eta_m^{d,\alpha}=\eta_m^{e,\beta}$. Set $D=\max\{\diam_d X,\diam_e Y\}$ and $Q=[0,h(D)]^I$. Since $C_m^{h\circ\delta}$ takes values in $Q$, the restriction $\eta_m^{\delta,\sigma}|_Q$ of $\eta_m^{\delta,\sigma}$ to $Q$ is a probability measure on $Q$. The function $h$ is a homeomorphism from $[0,D]$ onto $[0,h(D)]$. Hence the map $G\colon Q\to\R^I$ defined by $G(v)=(h^{-1}(v_{ij}))_{0\leq i0}^{\binom m2})$ used for reconstruction is countable. We show that isometry of products implies equality of the factor semicharacters at all these indices. \begin{proof}[Proof of \Cref{thm:general-cancellation}] Let $u\colon \MetricSpace{X\times K}{d\times_F \rho}\to \MetricSpace{Y\times K}{e\times_F \rho}$ be an isometry. Equip the three factors with the semi-metrics $c_X=h\circ d$, $c_Y=h\circ e$, and $c_K=h\circ\rho$. By assumption $d\times_F\rho$ and $e\times_F\rho$ are metrics. Since $F$ is continuous, \Cref{lem:product-topology} shows that they induce the respective product topologies. Thus $u$ is a homeomorphism in those topologies. For $z,w\in X\times K$, preservation of distance reads \[ \psi(c_{Y\times K}(u(z),u(w)))=\psi(c_{X\times K}(z,w)).\] By injectivity of $\psi$, the map $u$ preserves the sum of the semi-metrics. Apply \Cref{prop:cost-compatible-measures} to the factors $\boldsymbol{X}=(X,c_X)$, $\boldsymbol{Y}=(Y,c_Y)$, and $\boldsymbol{K}=(K,c_K)$. For each integer $m\geq2$ and vector $t\in\Z_{>0}^{\binom m2}$ we compare semicharacters. By \eqref{eq:cost-compatible-product} and \eqref{eq:cost-compatible-bijection} we have $u_*(\mu_{\boldsymbol{X}}\otimes\mu_{\boldsymbol{K}})=\mu_{\boldsymbol{Y}}\otimes\mu_{\boldsymbol{K}}$. Since $u$ preserves the sum of the semi-metrics, we can apply \Cref{lem:sample-array-pushforward} to the two product spaces and $u$. Integrating $v\mapsto\exp(-\sum_{0\leq i0$, so division yields $L_t(\boldsymbol{X},\mu_{\boldsymbol{X}})=L_t(\boldsymbol{Y},\mu_{\boldsymbol{Y}})$. By \Cref{lem:cost-laplace-reconstruction} we conclude $\MetricSpace{X}{d}\cong \MetricSpace{Y}{e}$. \end{proof} \begin{proof}[Proof of \Cref{prop:general-roots}] Equip $X$ and $Y$ with the continuous semi-metrics $h\circ d,h\circ e$, respectively. Since $F_n$ is continuous, \Cref{lem:product-topology} shows that $d_{F_n}$ and $e_{F_n}$ induce the product topologies. By injectivity of $\psi$, the isometry $u\colon\MetricSpace{X^n}{d_{F_n}}\to\MetricSpace{Y^n}{e_{F_n}}$ between the two $n$-fold products preserves the sum of the semi-metrics. Apply \Cref{prop:cost-compatible-measures} to the factors $\boldsymbol{X}=(X,h\circ d)$ and $\boldsymbol{Y}=(Y,h\circ e)$. Equip their finite ordered products with the product topology and the sum of the coordinate semi-metrics. Denote the two $n$th powers with this structure by $\boldsymbol{X}^n,\boldsymbol{Y}^n$. For each $m\geq2$ and each vector $t\in\Z_{>0}^{\binom m2}$ we compare semicharacters. Iterating \eqref{eq:cost-compatible-product} and applying \eqref{eq:cost-compatible-bijection} to $u$ yields $u_*(\mu_{\boldsymbol{X}}^{\otimes n})=\mu_{\boldsymbol{Y}}^{\otimes n}$. Apply \Cref{lem:sample-array-pushforward} to the product measures and $u$, and take Laplace transforms of the pushforwards to obtain $L_t(\boldsymbol{X}^n,\mu_{\boldsymbol{X}}^{\otimes n})=L_t(\boldsymbol{Y}^n,\mu_{\boldsymbol{Y}}^{\otimes n})$. Repeated application of \eqref{eq:cost-laplace-product} to both sides yields \[ L_t(\boldsymbol{X},\mu_{\boldsymbol{X}})^n=L_t(\boldsymbol{Y},\mu_{\boldsymbol{Y}})^n.\] Taking positive $n$th roots and applying \Cref{lem:cost-laplace-reconstruction} proves the assertion. \end{proof} \begin{corollary}\label{thm:general-square} Let $h,\psi\colon[0,\infty)\to[0,\infty)$ be continuous strictly increasing functions vanishing at zero and put $F(s,t)=\psi(h(s)+h(t))$. Let $\MetricSpace{X}{d}$ and $\MetricSpace{Y}{e}$ be nonempty compact metric spaces and assume that $d\times_F d$ and $e\times_F e$ are metrics on $X^2$ and $Y^2$, respectively. If $\MetricSpace{X^2}{d\times_F d}\cong\MetricSpace{Y^2}{e\times_F e}$, then $\MetricSpace{X}{d}\cong\MetricSpace{Y}{e}$. \end{corollary} \begin{proof} Take $n=2$ in \Cref{prop:general-roots} and use $F_2(s,t)=\psi(h(s)+h(t))=F(s,t)$. \end{proof} \subsection{Associative metrical functions} The metrical functions used by Avgustinovich and Fon-Der-Flaass admit additive generators. This representation allows us to apply \Cref{thm:general-cancellation} to their two-factor products. We also show that the metric on the iterated $n$th power agrees with the metric defined directly from the coordinates in \Cref{prop:general-roots}. \begin{definition}[{Avgustinovich and Fon-Der-Flaass, \cite[Definition~2]{Avgustinovich2000}}]\label{def:metrical} A function $F\colon[0,\infty)^2\to[0,\infty)$ is a \emph{metrical function} if for all nonnegative $s,t,u,v$ the following conditions hold. \begin{enumerate}[label=\textup{(M\arabic*)},ref=\textup{(M\arabic*)}] \item\label{item:metrical-identity} We have $F(s,0)=F(0,s)=s$. \item\label{item:metrical-strict} The function $F$ is strictly increasing in each coordinate. \item\label{item:metrical-subadditive} We have $F(s+u,t+v)\leq F(s,t)+F(u,v)$. \item\label{item:metrical-symmetric} We have $F(s,t)=F(t,s)$. \item\label{item:metrical-associative} We have $F(F(s,t),u)=F(s,F(t,u))$. \end{enumerate} \end{definition} Normalization on the axes and monotonicity in each coordinate already imply $F(s,t)\geq\max\{s,t\}$ for every $s,t\geq0$, since $F(s,t)\geq F(s,0)=s$ and $F(s,t)\geq F(0,t)=t$. \begin{lemma}[{Avgustinovich and Fon-Der-Flaass, \cite[p.~849, after Definition~3]{Avgustinovich2000}}]\label{lem:metrical-product} Every metrical function is metric preserving in the sense of \Cref{def:metric-product}. \end{lemma} Homogeneity is not required in \Cref{def:metrical}. Normalization, coordinatewise monotonicity, and subadditivity already imply continuity. \begin{lemma}\label{lem:metrical-bounds} Let $F\colon[0,\infty)^2\to[0,\infty)$ satisfy $F(s,0)=F(0,s)=s$. If $F$ is subadditive, then for all $s,t\geq0$ we have \begin{equation}\label{eq:metrical-bounds} F(s,t)\leq s+t. \end{equation} \end{lemma} \begin{proof} Indeed, $F(s,t)\leq F(s,0)+F(0,t)=s+t$. \end{proof} \begin{lemma}\label{lem:metrical-continuity} Let $F\colon[0,\infty)^2\to[0,\infty)$ be nondecreasing in each coordinate. If for all $s,t,u,v\geq0$ we have \[ F(s,0)=F(0,s)=s,\qquad F(s+u,t+v)\leq F(s,t)+F(u,v), \] then for all $s,t,u,v\geq0$ we have \begin{equation}\label{eq:metrical-continuity} |F(s,t)-F(u,v)|\leq|s-u|+|t-v|.\end{equation} \end{lemma} \begin{proof} For nonnegative $s,t,u,v$, monotonicity, subadditivity, and \eqref{eq:metrical-bounds} imply \begin{align*} F(s,t)&\leq F(u+|s-u|,v+|t-v|)\\ &\leq F(u,v)+F(|s-u|,|t-v|)\\ &\leq F(u,v)+|s-u|+|t-v|.\end{align*} Interchanging the pairs proves \eqref{eq:metrical-continuity}. \end{proof} This Lipschitz bound implies continuity of $F$. For a metrical function, strict increase in each coordinate and associativity yield an additive representation. \begin{proposition}\label{lem:metrical-generator} Let $F$ be a metrical function. Then there exists a strictly increasing homeomorphism $h\colon[0,\infty)\to[0,\infty)$ satisfying $h(0)=0$ and, for every $s,t\geq0$, the identity \begin{equation}\label{eq:metrical-generator} h(F(s,t))=h(s)+h(t).\end{equation} \end{proposition} \begin{proof} By \Cref{lem:metrical-continuity} the function $F$ is continuous, and by \Cref{def:metrical} it is associative and strictly increasing in each argument. Applying Acz\'el's representation theorem to this operation on the half-open interval $[0,\infty)$ yields a continuous strictly increasing function $h\colon[0,\infty)\to\R$ satisfying \eqref{eq:metrical-generator} (\cite[p.~59]{Aczel1948}). Since $F(0,0)=0$, we have $h(0)=2h(0)$, hence $h(0)=0$. The image is an interval containing $0$ and the positive number $h(1)$, and is closed under addition by \eqref{eq:metrical-generator}. It therefore contains $nh(1)$ for every integer $n\geq1$. By monotonicity of $h$ the image equals $[0,\infty)$, and $h$ is a homeomorphism of the half-line onto itself. \end{proof} For a metrical function $F$, a compact metric space $\MetricSpace{X}{d}$, and an integer $n\geq1$, write $\MetricSpace{X^n}{d^{\times_F n}}$ for the $n$th power formed by iterating $F$. By associativity the distance is independent of parenthesization. \begin{corollary}\label{cor:metrical-cancellation} Let $F$ be a metrical function and let $\MetricSpace{X}{d}$, $\MetricSpace{Y}{e}$, and $\MetricSpace{K}{\rho}$ be nonempty compact metric spaces. 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{corollary} \begin{proof} Choose $h$ as in \Cref{lem:metrical-generator} and apply \Cref{thm:general-cancellation} with $\psi=h^{-1}$. \end{proof} \begin{corollary}\label{cor:metrical-roots} Let $F$ be a metrical function, $n\geq2$ an integer, and $\MetricSpace{X}{d}$ and $\MetricSpace{Y}{e}$ nonempty compact metric spaces. If $\MetricSpace{X^n}{d^{\times_F n}}\cong \MetricSpace{Y^n}{e^{\times_F n}}$, then $\MetricSpace{X}{d}\cong \MetricSpace{Y}{e}$. \end{corollary} \begin{proof} Let $v=h^{-1}$ be the inverse of the homeomorphism $h$ in \Cref{lem:metrical-generator}. Substituting $s=v(a)$ and $t=v(b)$ in \eqref{eq:metrical-generator} yields, for every $a,b\geq0$, \begin{equation}\label{eq:dyadic-generator} v(a+b)=F(v(a),v(b)). \end{equation} For a compact metric space $\MetricSpace{M}{d}$ and $z,w\in M^n$ put $a_i=h(d(z_i,w_i))$ for each $0\leq i