Manuscript Offprint
arXiv:2610.32369A Regularity Condition Under Which a CPAB Transformation is a Diffeomorphism
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Continuous Piecewise-Affine Based (CPAB) transformations, introduced by Freifeld et al. in [10, 11], are defined as the flows obtained by integrating continuous piecewise-affine (CPA) velocity fields. These highly expressive, well-behaved transformations have proven useful in a variety of applications, including nonlinear temporal warping and trainable activation functions in 1D, as well as nonrigid spatial deformations in 2D and 3D. While computational costs were not an issue in 1D, they originally limited the practical expressiveness of CPAB transformations in 2D and, much more severely, in 3D. Our recent work (Aflalo et al. [1]), however, removed this bottleneck, enabling efficient optimization of CPAB transformations with much finer tessellations and substantially greater expressiveness, thereby providing a more practical way than traditional methods for representing and constructing diffeomorphisms in 1D, 2D, and 3D.
There is, however, a mathematical subtlety that was overlooked in the original CPAB papers [10, 11]. CPAB transformations are always homeomorphisms and, in fact, bi-Lipschitz, implying that both the transformations and their inverses are differentiable almost everywhere. However, an additional regularity condition is needed to ensure that these transformations are also diffeomorphisms. The purpose of this note is to remedy this omission by identifying a sufficient regularity condition under which a CPAB transformation is guaranteed to be a diffeomorphism. In 1D and 2D, we show that these conditions can be easily enforced and, moreover, hold with probability one under standard sampling assumptions; we expect analogous behavior in 3D.
1 Introduction
Throughout this note, a diffeomorphism is a differentiable bijection whose inverse is also differentiable. Diffeomorphisms are a natural choice in spatial modeling tasks that require differentiable, invertible, and topology-preserving deformations. They are widely used in applications such as registration, spatial alignment, and geometric warping, where folding, tearing, or self-intersection would result in geometrically invalid deformations. The standard way to construct such transformations is via integration of either a stationary velocity field (SVF) [2] or a time-dependent velocity field as in Large Deformation Diffeomorphic Metric Mapping (LDDMM) [3]. However, in practice, such methods often rely on a dense-grid discretization of the spatial domain. As a result, the number of parameters controlling the diffeomorphisms grows directly with the resolution of the domain (e.g., with the number of pixels in 2D). In modern 2D and especially 3D settings, this leads to high memory use, slow optimization, and difficult optimization landscapes.
Continuous Piecewise-Affine Based (CPAB) transformations, introduced by Freifeld et al. [10, 11], offer a compelling alternative. Instead of a dense-grid discretization, this approach tessellates the domain into cells (e.g., triangles in the 2D case) and constrains the velocity field to be a continuous piecewise-affine (CPA) function. A CPAB transformation is, by definition [10], obtained by integrating a CPA velocity field. CPAB transformations provide a compact low-dimensional pa-rameterization while still capturing rich nonlinear deformations and have been used in diverse deep learning settings, including 1D applications such as time-series alignment and trainable activation functions [15, 19, 24, 27, 5, 17, 20, 16, 23], parameter-efficient multi-task fine-tuning [18], and 2D vision and generative modeling tasks [14, 7, 21, 22, 25, 26, 13].
CPAB transformations are homeomorphisms and even bi-Lipschitz functions (hence also almost-everywhere differentiable with an almost-everywhere differentiable inverse). Typically, but technically not always, CPAB transformations are also diffeomorphisms. Under a suitable regularity condition, a CPAB transformation is a diffeomorphism. The purpose of the present paper is to provide and explain this condition, as well as to show that in 1D and 2D it usually holds in practice. We expect that it also usually holds in 3D.
Relation to the ODE literature. The dependence of ODE flows on initial conditions is a classical topic [12]. Related questions concerning crossings, tangencies, and differentiability of flows at switching interfaces arise in the theory of piecewise-smooth dynamical systems [8, 4, 9]. Some of this literature considers discontinuous vector fields, whereas the CPA velocity fields considered here are continuous and Lipschitz. Our focus is on sufficient regularity conditions that guarantee differentiability of CPAB flows, and on whether these conditions hold generically for commonly used tessellations.
A Remark on Expressiveness and Scalability. Until recently, despite their compact parameterization, CPAB transformations remained hard to scale in practice. The bottleneck lay in computing the loss gradient, , where the standard formulation made optimization prohibitively expensive once tessellations become fine or spatial inputs become large. Consequently, traditional CPAB implementations were limited to coarse tessellations, restricting their practical expressiveness. Fortunately, in work concurrent with this paper [1], we showed how to remove this bottleneck. The consequence was drastic improvements (orders of magnitude) in speed and memory consumption. Such gains enable efficient optimization of fine-tessellation CPAB diffeomorphisms even in 3D, and make CPAB competitive as a modern primitive for large-scale nonrigid spatial modeling.
Let be an interval, tessellated into smaller intervals, which we will refer to as cells. A continuous piecewise-affine (CPA) velocity field is affine within each cell and continuous across cell boundaries. Thus, within cell ,
where . The corresponding CPAB transformation, denoted by , is obtained by integrating the stationary ordinary differential equation
and setting . This transformation, from onto , is referred to as the time-one flow map associated with .
Since is continuous and piecewise affine, it is Lipschitz continuous. Consequently, its flow is well-defined, invertible, and bi-Lipschitz. In particular, is a homeomorphism, and both and are differentiable almost everywhere. We will now address the question whether and are differentiable everywhere. In other words, we ask whether is a diffeomorphism.
A bi-Lipschitz function is an invertible function that is Lipschitz continuous and whose inverse is also Lipschitz continuous.
A homeomorphism is an invertible continuous function whose inverse is also continuous.
An affine velocity field. Consider first a single affine velocity field,
where . The corresponding time-t flow map, , is given by
In particular, the time-one flow map is
and therefore
Note this result holds regardless of whether the velocity field has a zero in (i.e., a point where ). Thus, an affine velocity field always generates a diffeomorphism, and the presence of a zero introduces no regularity issue. Figure 1 illustrates both a field with a zero and a constant nonzero field.
(a) Velocity

(b) Flow

(c) Derivative

Figure 1: Affine fields, including the constant case. The solid blue curves correspond to , giving and . Although the origin is stationary, the flow is differentiable there. The dashed orange curves show ( ), whose flow is the translation with derivative 1. Both derivatives are everywhere positive.
A CPA velocity field without zeros. Unlike the affine case, the flow map of a general CPA velocity field has a more complicated expression. Although this expression is available in closed form [10, 11], we will not need it here. Instead, we derive the derivative of the flow map directly from the defining ODE, which is simpler for studying its regularity.
Consider a CPA velocity field that does not vanish anywhere on . Since v is also continuous, it has a constant sign on , and every trajectory is a monotonic function (possibly crossing cell boundaries); that is, if v is positive then the trajectories are monotonic increasing functions (so each point moves rightward) while if v is negative then the trajectories are monotonic decreasing functions (each point moves leftward).
Recall that the trajectory satisfies
Since v is nonzero, we can divide both sides by to obtain
Integrating both sides from 0 to t, using s as the integration variable, gives
Now, introducing the new variable , so that , we obtain
To establish differentiability of the flow, fix and define
Since is continuous and nowhere zero, is continuously differentiable, with . Thus, is strictly monotonic, and the inverse function theorem guarantees that is continuously differentiable. The integral identity above can now be written as
or, equivalently,
Hence, the flow is continuously differentiable with respect to its initial condition. Differentiating this expression and setting gives
Since is continuous and nonzero, the right-hand side is continuous and strictly positive. Importantly, this remains true even when a trajectory crosses one or more cell boundaries, where the derivative of (as opposed to the derivative ) may be discontinuous. As a similar analysis holds for the inverse flow (namely, the inverse of ), we conclude that , the resulting CPAB transformation, is a diffeomorphism. Figure 2 shows that a kink in a nonvanishing velocity field does not produce a kink in the flow.
(a) Velocity

(b) Flow

(c) Derivative

Figure 2: Nonzero velocity at a cell boundary. The fields (solid blue) and (dashed orange) have unequal slopes across , but neither vanishes there. Arrows indicate the direction of motion; trajectories can cross the interface. For both fields, the time-one flow is smooth to first order across the interface, and is continuous and strictly positive.
We have just shown that if the CPA field v is nowhere zero, then the derivative of the flow exists and is continuous. In fact, the same argument applies locally at every provided that , even if the velocity field has zeros elsewhere. To see this, consider the maximal interval containing on which v does not vanish. By uniqueness of ODE solutions, a trajectory starting at cannot reach a zero of v in finite time. Thus, as long as the flow is defined, the trajectory remains in this interval, where G is well-defined and the preceding argument applies.
In fact, even without such analysis of the inverse flow we can reach the same conclusion: since the derivative of is everywhere positive and continuous, the inverse function theorem establishes that is continuously differentiable.
Zero boundary conditions with no zeros at interior cell boundaries. We now consider the case where the velocity field vanishes at the endpoints of the domain but does not vanish at any interior cell boundary. Zeros strictly inside cells are allowed.
Specifically, let , and suppose
These boundary points are fixed points of the flow, so the flow preserves the interval.
The presence of these zeros does not prevent the resulting transformation from being a diffeomorphism of the interval. To see this, consider the cell adjacent to . Since v is affine in that cell and vanishes at , it has the form
For initial points sufficiently close to , the trajectory remains within this cell for every , and therefore
Hence, the one-sided derivative at the boundary exists and equals
An analogous argument applies at , with the slope of the last cell.
Thus, zero boundary conditions introduce no regularity problem. Under the assumptions stated above, the CPAB transformation is a diffeomorphism on the interior of , with positive one-sided derivatives at its endpoints. An example with two cells is shown in Figure 3.
(a) Velocity

(b) Flow

(c) Derivative

Figure 3: Zeros at the domain endpoints. On , take , with cells meeting at . The endpoints are fixed, while interior points move to the right and remain inside the interval. The flow has a continuous positive derivative in the interior and positive one-sided endpoint derivatives and . The nonzero velocity at the interior interface allows smooth passage between cells.
A CPA velocity field with a zero inside a cell. Next, suppose that v vanishes at some interior point of a cell c, so that . Since v is affine within this cell, we can write
The point is stationary, i.e., . Moreover, for initial points sufficiently close to , the trajectories remain within cell throughout the integration time interval. Consequently,
and hence
throughout a neighborhood of .
Thus, although the general derivative formula in Eq. 14 cannot be applied directly at , the flow is differentiable there, with a continuous and strictly positive derivative. Away from zeros of v, that formula remains applicable, including at cell boundaries where the velocity field is nonzero. Therefore, a zero strictly inside a cell introduces no regularity issue, and the resulting CPAB transformation remains a diffeomorphism provided that no zeros occur at problematic cell interfaces. Figure 4 illustrates this local affine behavior around a stationary point.
(a) Velocity

(b) Flow

(c) Derivative

Figure 4: A zero strictly inside a cell. Here on the central cell , for , and for . The zero lies away from the interfaces, where the velocity is nonzero. For , trajectories remain in the central cell, so and . Thus, the derivative is well-defined at the zero and continuous throughout.
A similar argument applies when v vanishes at an interior boundary between two adjacent cells, provided that the slopes of the two affine pieces agree. Indeed, by continuity, the two pieces then define the same affine function in a neighborhood of that boundary. Consequently, the flow is differentiable there, with a continuous and positive derivative given by the exponential of their common slope. This harmless interface zero is illustrated in Figure 5.
(a) Velocity

(b) Flow

(c) Derivative

Figure 5: An interface zero with matching slopes. The two cells meet at , and both affine pieces are . The interface therefore introduces no change in the local affine field. Although , the flow is on both sides, and its one-sided derivatives agree: . The stationary point is a differentiable point of the flow.
To summarize the discussion above, as long as v does not vanish at any interior cell boundary where the slopes of the adjacent affine pieces differ, the resulting CPAB transformation is a diffeomorphism. Its derivative is given by
where, in the first case, a is the slope of v in a neighborhood of , with a one-sided interpretation at the endpoints of .
A zero at a cell boundary. We now consider the case responsible for the regularity issue: a zero at an interior cell boundary where the slopes of the adjacent affine pieces differ. Let denote this boundary point, so that
By continuity and piecewise affinity, in a neighborhood of we may write
where and are the slopes of the velocity field in the two cells.
The point is stationary, so . For initial points sufficiently close to , the trajectories remain within their respective cells throughout the integration interval. Consequently,
The one-sided derivatives at are therefore
If , these derivatives differ, and hence is not differentiable at . Nevertheless, both one-sided derivatives are strictly positive, and remains a bi-Lipschitz homeomorphism.
This demonstrates that the continuity and Lipschitz continuity of a CPA velocity field do not, by themselves, guarantee that its flow is a diffeomorphism. The difficulty arises when a zero of the velocity field coincides with an interior cell boundary at which the affine slopes differ. Figure 6 makes this failure visible as a kink in the flow and unequal one-sided limits of its derivative.
(a) Velocity

(b) Flow

(c) Derivative

Figure 6: An interface zero with differing slopes: the failure case. For , the slopes at are (blue) and (orange). The time-one map is on the left and on the right. It is continuous and strictly increasing, but has a kink at the fixed point. Open circles mark the unequal derivative limits and ; does not exist. The map remains bi-Lipschitz, but is not a diffeomorphism.
Conclusion for the 1D case. The examples above identify the essential distinction. Zeros of the velocity field are not inherently problematic. In particular, zeros in the interior of cells, zeros at interior cell boundaries where the adjacent affine slopes agree, and zeros at the endpoints of a bounded domain are all compatible with diffeomorphic flows. Likewise, discontinuities in the derivative of the velocity field at cell boundaries cause no problem when the velocity is nonzero there.
A sufficient regularity condition in 1D is therefore that, at every interior cell boundary where the affine slopes differ, the velocity field is nonzero. Under this condition, the CPAB transformation is a diffeomorphism (with the usual one-sided interpretation at the endpoints of a closed interval). In fact, the preceding analysis establishes the stronger result that both the transformation and its inverse are continuously differentiable. Thus, the transformation is a diffeomorphism on the interior of the domain.
Note that, importantly, this regularity condition is naturally satisfied in practice. For example, if the free velocities at the tessellation vertices are sampled jointly from an absolutely continuous distribution (e.g., a multivariate Gaussian distribution), then the condition holds almost surely. The same is true if arbitrarily small Gaussian noise is added to the free velocities at the tessellation vertices, while preserving any prescribed boundary conditions. Random initialization followed by gradient-based optimization is also expected to satisfy the condition in typical settings, although this is not guaranteed for arbitrary optimization procedures. In contrast, the two sampling or perturbation procedures described above guarantee that the condition holds with probability one. Thus, for all practical purposes, 1D CPAB transformations are usually diffeomorphisms.
3 The 2D Case
We now turn to the 2D case. As in 1D, a CPA velocity field is continuous across cell boundaries, but its derivative may be discontinuous there. The question is whether such discontinuities can prevent the resulting CPAB transformation from being a diffeomorphism.
Let be a rectangular domain partitioned into finitely many triangles. Within each triangle , the velocity field takes the form
where and . Continuity of is enforced across all shared cell boundaries. For example, Figure 7 illustrates a tessellation of into a grid of squares, each divided into four triangles.
Ω

Figure 7: 2D tessellation. A grid of squares, each divided into four triangles. Dots mark vertices; one cell c is shaded.
As in 1D, a CPA velocity field on a finite tessellation in 2D is Lipschitz continuous. Consequently, for every time at which the flow is defined, the corresponding flow map is invertible and bi-Lipschitz. In particular, it is a homeomorphism, and both the flow map and its inverse are differentiable almost everywhere.
We now explore when it is also a diffeomorphism. The situation is more involved than in 1D because the velocity is now vector-valued, and trajectories may cross cell interfaces transversely, touch them tangentially, or move along them. Moreover, several cells may meet at a single vertex.
As in 1D, the key issue is not necessarily the discontinuity of the derivative of the velocity field, but rather how trajectories interact with the interfaces at which such discontinuities occur.
To illustrate a difficulty that does not arise in 1D, consider the CPA velocity field
This velocity field is nonzero everywhere, but its derivative is discontinuous across the interface . The corresponding time-one flow is
Here , so and give the final - and -coordinates, respectively. For this field, is independent of , so it can be plotted as a function of alone: the same graph applies for every initial horizontal coordinate .
Thus, is not differentiable along , even though the velocity field never vanishes. The issue is that the velocity is tangent to the interface, and trajectories starting on it remain there. This shows that, unlike in 1D, excluding zeros of the velocity field at cell interfaces is not sufficient. Figure 8 illustrates this loss of differentiability.
(a) Velocity

(b) Full flow

(c) Vertical component
(d) Derivative


Figure 8: Loss of regularity for . The nonzero field is tangent to (a). In (b), maps the left grid and diagonal segment to the right; matching markers identify corresponding points. The resulting flow is not differentiable at , as illustrated by the kink created in the image of the diagonal segment. The vertical component is independent of , so (c) plots it against alone. Its one-sided derivatives with respect to are unequal: and (d, open circles).
A sufficient regularity condition. Consider an interior edge E shared by two adjacent triangles. Let and denote its endpoints, and let be a unit normal vector to the edge.
We impose the following two conditions on every interior edge:
The first condition extends the nonvanishing-velocity requirement from the 1D case: it excludes zeros of the velocity field on interior cell interfaces, while still allowing zeros strictly inside cells and at the domain boundary.
The second condition addresses an additional phenomenon that does not arise in 1D: trajectories may remain on an interface even when the velocity is nonzero. It excludes interfaces along which the velocity is everywhere tangent. Importantly, it does not require the normal component of the velocity to be nonzero everywhere. Thus, trajectories may cross an interface transversely or touch it tangentially.
Since v is affine along each edge, the second condition is equivalent to requiring that
These conditions are stronger than necessary. For example, an interface at which the affine velocity fields on both sides agree introduces no regularity issue, regardless of whether the conditions above hold. Nevertheless, we adopt these stronger conditions because they are simple, easy to verify, and, as shown below, satisfied almost surely under standard sampling of CPA parameters.
Regularity of the flow. We now show that the conditions above are sufficient to guarantee that the resulting CPAB transformation is a diffeomorphism.
Proposition. Suppose that is a CPA velocity field satisfying Eq. 30 on every interior edge of the tessellation. Fix , and let denote the set of initial conditions whose trajectories remain in throughout . Since each such trajectory is a compact subset of over , continuous dependence on initial conditions implies that is open. Moreover, is precisely the set of points whose backward trajectories remain in throughout . The same argument therefore shows that is open. Then the flow map
is a diffeomorphism.
Proof. The central observation is that, under Eq. 30, every trajectory that remains in the interior of the domain spends zero time on the union of interior cell interfaces.
To establish this, consider an interior edge E. Since v is affine along E, its normal component
is an affine scalar function along the edge.
By the second condition in Eq. 30, g is not identically zero. Therefore, it can vanish at most at one point of E.
Now consider a trajectory . Whenever the trajectory crosses E transversely, its intersection with the edge occurs at an isolated time.
More generally, suppose, for contradiction, that the set of times at which the trajectory lies on E has positive measure.
At almost every such time, the derivative of the signed distance from the trajectory to the line containing E must vanish. Consequently,
at almost every such time.
Since g can vanish at most at one point of E, the trajectory would have to occupy that same point for a set of times of positive measure.
If that point belongs to the interior of , the first condition in Eq. 30 guarantees that the velocity there is nonzero. A trajectory cannot occupy a point with nonzero velocity for a set of times of positive measure. If the point belongs to the domain boundary, it cannot be reached by a trajectory that remains in the interior.
In either case, we obtain a contradiction. Thus, the trajectory spends zero time on E.
Since the tessellation contains finitely many edges, every interior trajectory spends zero time on the union of all interior cell interfaces. This argument also covers vertices where several triangles meet, without requiring separate treatment of the different configurations.
We now turn to differentiability of the flow.
Fix , and let
denote its trajectory. Since the trajectory spends zero time on cell interfaces, the matrix
is well-defined for almost every , where denotes the cell containing . We may assign arbitrary bounded values to at the remaining times.
Consider the matrix-valued initial-value problem
Since is bounded and measurable, this problem has a unique absolutely continuous solution.
We will show that
Consider a nearby initial condition , with sufficiently small that , and denote its trajectory by
Define the difference between the two trajectories as
Since v is Lipschitz continuous, with Lipschitz constant L, Grönwall's inequality gives
We now define the linearization error
At almost every time , the reference trajectory lies strictly inside a cell. Since as , for sufficiently small the two points lie in the same cell. Within that cell, is affine, so
for all sufficiently small h, at almost every fixed t.
Moreover, let . By the Lipschitz continuity of and Eq. 41,
Thus, is uniformly bounded and converges to zero for almost every . By the dominated convergence theorem,
Using the integral form of the ODE and the definition of , we obtain
On the other hand, the solution of Eq. 37 satisfies
Subtracting these equations and applying Grönwall's inequality yields
Consequently, the flow is differentiable with respect to its initial condition, and
We have therefore established that is differentiable at every . It remains to verify differentiability of the inverse.
Let . Since the flow is bi-Lipschitz, there exists such that for all . Taking and , dividing by , and letting yields
Thus is nonsingular.
Now write and . By differentiability, . Since the inverse is Lipschitz, , and hence
Therefore, the inverse is differentiable as well, and is a diffeomorphism from onto its image.
A remark on stronger regularity. In fact, the preceding proof can be extended to establish that the Jacobian of the flow is continuous with respect to the initial condition. Thus, under the same regularity condition, the resulting transformation is not merely a diffeomorphism but a diffeomorphism. We omit the additional details.
Almost-sure satisfaction of the regularity condition. We now consider the tessellations commonly used in CPAB implementations [10, 11, 6, 1].
Let be a rectangle partitioned into a regular grid of squares, where each square is divided into four triangles by its two diagonals, as in Figure 7. Thus, each square contains an additional vertex at its center.
The CPA velocity field is specified by its values at the mesh vertices, subject to continuity across cells. Optionally, zero boundary conditions may be imposed by fixing the velocities at the domain-boundary vertices to zero.
Assume that every interior edge has at least one endpoint whose velocity is a free parameter. This holds for the four-triangle-per-square construction on rectangular grids with at least two squares in each coordinate direction.
We claim that if the free vertex velocities are sampled jointly from an absolutely continuous distribution, then Eq. 30 holds with probability one.
To see this, consider an interior edge E with endpoints and .
The second condition fails only when
Since at least one endpoint velocity is a free parameter, this event imposes a nontrivial linear equality on the free velocity parameters. Under an absolutely continuous distribution, it therefore has probability zero.
For the first condition, recall that the velocity along an edge is obtained by linear interpolation of its endpoint velocities.
If both endpoint velocities are free, the probability that their interpolated values vanish anywhere on the edge is zero. Indeed, such an event requires the two velocity vectors to be linearly dependent, which occurs with probability zero under an absolutely continuous joint distribution.
If one endpoint lies on the domain boundary and has its velocity fixed to zero, the interpolated velocity can vanish at that endpoint. However, it is nonzero everywhere else along the edge provided that the other endpoint velocity is nonzero, which again holds almost surely.
Thus, both conditions hold almost surely for each interior edge. Since the tessellation contains finitely many edges, they hold simultaneously for all interior edges with probability one.
In particular, the same result applies if we independently add Gaussian noise, with arbitrarily small positive variance, to the free vertex velocities while keeping the boundary velocities fixed.
Therefore, for the tessellations described above, the CPAB transformation is a diffeomorphism on the interior of the domain almost surely, provided the flow is defined there for the time interval under consideration.
Zero boundary conditions. Finally, suppose that zero boundary conditions are imposed, so that
Every boundary point is then a fixed point of the flow. Moreover, uniqueness of ODE solutions prevents an interior trajectory from reaching the boundary in finite time. Consequently, the flow maps the interior of onto itself.
In particular, the set in the proposition is then the entire interior of . Under the regularity condition above, the resulting CPAB transformation is therefore a diffeomorphism from onto itself.
On the entire closed domain , the flow remains a bi-Lipschitz homeomorphism. In particular, it extends continuously to the boundary, where it equals the identity.
We do not require the derivative of the flow to extend continuously to every boundary point. Such an extension need not exist at boundary vertices where several affine pieces meet, even though the transformation is a diffeomorphism throughout the interior.
4 The 3D Case
The argument establishing differentiability of the flow in the 2D case extends directly to 3D. Here, the domain is tessellated into tetrahedra, and the interfaces between adjacent cells are triangular faces. As in 2D, a sufficient regularity condition is that every trajectory that remains in the interior of the domain spends zero time on interior interfaces where the derivative of the CPA velocity field is discontinuous. Under this condition, the differentiability argument from the previous section applies without modification. Together with the bi-Lipschitz property of the flow, this guarantees that, for every , the flow map is a diffeomorphism from onto its image, with defined as in the 2D Proposition. We omit the proof.
A separate question is whether this regularity condition is typically satisfied in practice. In 3D, the set of points where the velocity is tangent to a cell interface may form an entire line rather than an isolated point, making the analysis more involved than in 2D.
For the standard five-tetrahedron subdivisions of rectangular grids used in CPAB implementations, including with zero-normal-velocity boundary constraints, we expect the regularity condition to hold with probability one when the free velocity parameters are sampled from a probability distribution with a joint density (e.g., a Gaussian). However, we do not establish this probability-one result here.
5 The mistake in [10, 11]
In the original CPAB papers by Freifeld et al. [10, 11], the pathological cases discussed in the preceding sections were overlooked, and it was stated, without qualification, that every CPAB transformation is a diffeomorphism. The error there, in the proof of Part (iii) of Theorem 1 from [11], can be traced to an incorrect statement preceding the proof: that a Lipschitz continuous velocity field necessarily generates a differentiable flow. This implication is false, as demonstrated by the counterexamples in the preceding sections of the present paper.
Importantly, the invertibility argument in the original papers remains valid, although the differentiability claim should have been demoted to bi-Lipschitz continuity. As explained in the present paper, CPAB transformations are always bi-Lipschitz homeomorphisms, and hence differentiable almost everywhere, with almost-everywhere differentiable inverses. Moreover, under the sufficient regularity conditions established above, they are indeed diffeomorphisms.
Finally, these regularity conditions are not merely theoretical. In 1D and for the 2D tessellations considered above, they can be easily enforced and, moreover, hold with probability one when the free CPA parameters are sampled from any probability distribution with a joint density (e.g., a Gaussian). Thus, although the original unconditional claim was incorrect, CPAB transformations are typically diffeomorphisms in these settings. As mentioned above, we expect analogous behavior in 3D.
References
[1] Amit Aflalo, Eran Treister, Chaim Baskin, and Oren Freifeld. Factorized gradients for scalable highly-expressive parametric diffeomorphisms. In Advances in Neural Information Processing Systems, 2026. 1, 2, 12
[2] John Ashburner. A fast diffeomorphic image registration algorithm. Neuroimage, 38(1):95–113, 2007. 1
[3] M Faisal Beg, Michael I Miller, Alain Trouvé, and Laurent Younes. Computing large deformation metric mappings via geodesic flows of diffeomorphisms. International journal of computer vision, 61(2):139–157, 2005. 1
[4] Samuel A. Burden, S. Shankar Sastry, Daniel E. Koditschek, and Shai Revzen. Event-selected vector field discontinuities yield piecewise-differentiable flows. SIAM Journal on Applied Dynamical Systems, 15(2):1227–1267, 2016. doi: 10.1137/15M1016588. 2
[5] Irit Chelly, Shahaf E Finder, Shira Ifergane, and Oren Freifeld. Trainable highly-expressive activation functions. In European Conference on Computer Vision, 2024. 2
[6] Nicki S. Detlefsen. libcpab. https://github.com/SkafteNicki/libcpab, 2018. 12
[7] Nicki Skafte Detlefsen, Oren Freifeld, and Søren Hauberg. Deep diffeomorphic transformer networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4403–4412, 2018. 2
[8] Mario di Bernardo, Christopher J. Budd, Alan R. Champneys, and Piotr Kowalczyk. Piecewise-Smooth Dynamical Systems: Theory and Applications, volume 163 of Applied Mathematical Sciences. Springer, 2008. doi: 10.1007/978-1-84628-708-4. 2
[9] Luca Dieci and Luciano Lopez. Fundamental matrix solutions of piecewise smooth differential systems. Mathematics and Computers in Simulation, 81(5):932–953, 2011. doi: 10.1016/j.matcom.2010.10.012. 2
[10] Oren Freifeld, Soren Hauberg, Kayhan Batmanghelich, and John W Fisher. Highly-expressive spaces of well-behaved transformations: Keeping it simple. In Proceedings of the IEEE International Conference on Computer Vision, pages 2911–2919, 2015. 1, 3, 12, 13
[11] Oren Freifeld, Søren Hauberg, Kayhan Batmanghelich, and John W. Fisher. Transformations based on continuous piecewise-affine velocity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(12):2496–2509, 2017. doi: 10.1109/TPAMI.2016.2646685. 1, 3, 12, 13
[12] Philip Hartman. Ordinary Differential Equations, volume 38 of Classics in Applied Mathematics. Society for Industrial and Applied Mathematics, 2002. doi: 10.1137/1.9780898719222. 2
[13] Adam Hartshorne, Allen Paul, Tony Shardlow, and Neill DF Campbell. Arc-flow: Articulated, resolution-agnostic, correspondence-free matching and interpolation of 3d shapes under flow fields. In 2025 International Conference on 3D Vision (3DV), pages 11–33. IEEE, 2025. 2
[14] Søren Hauberg, Oren Freifeld, Anders Boesen Lindbo Larsen, John Fisher, and Lars Hansen. Dreaming more data: Class-dependent distributions over diffeomorphisms for learned data augmentation. In Artificial intelligence and statistics, pages 342–350. PMLR, 2016. 2
[15] Ilya Kaufman, Ron Shapira Weber, and Oren Freifeld. Cyclic diffeomorphic transformer nets for contour alignment. In 2021 IEEE International Conference on Image Processing (ICIP), pages 349–353, 2021. doi: 10.1109/ICIP42928.2021.9506570. 2
[16] Alaa Kryeem, Shmuel Raz, Dana Eluz, Dorit Itah, Hagit Hel-Or, and Ilan Shimshoni. Personalized monitoring in home healthcare: An assistive system for post hip replacement rehabilitation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, pages 1868–1877, October 2023. 2
[17] Krishna S Mantri, Xinzhi Wang, Carola-Bibiane Schönlieb, Bruno Ribeiro, Beatrice Bevilacqua, and Moshe Eliasof. Digraf: Diffeomorphic graph-adaptive activation function. Advances in Neural Information Processing Systems, 37:3649–3681, 2024. 2
[18] Krishna Sri Ipsit Mantri, Carola-Bibiane Schönlieb, Bruno Ribeiro, Chaim Baskin, and Moshe Eliasof. Ditask: Multi-task fine-tuning with diffeomorphic transformations. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 25218–25229, 2025. 2
[19] Iñigo Martinez, Elisabeth Viles, and Igor G Olaizola. Closed-form diffeomorphic transformations for time series alignment. In International Conference on Machine Learning, pages 15122–15158. PMLR, 2022. 2
[20] Nour Neifar, Achraf Ben-Hamadou, Afef Mdhaffar, Mohamed Jmaiel, and Bernd Freisleben. Leveraging statistical shape priors in gan-based ecg synthesis. IEEE Access, 12:36002–36015, 2024. 2
[21] Pola Schwöbel, Frederik Rahbæk Warburg, Martin Jørgensen, Kristoffer Hougaard Madsen, and Søren Hauberg. Probabilistic spatial transformer networks. In Uncertainty in artificial intelligence, pages 1749–1759. PMLR, 2022. 2
[22] Guy Shacht, Dov Danon, Sharon Fogel, and Daniel Cohen-Or. Single pair cross-modality super resolution. In Proceedings of the ieee/cvf conference on computer vision and pattern recognition, pages 6378–6387, 2021. 2
[23] Ron Shapira Weber, Shahar Ben Ishay, Andrey Lavrinenko, Shahaf E Finder, and Oren Freifeld. Timepoint: Accelerated time series alignment via self-supervised keypoint and descriptor learning. In International Conference on Machine Learning, 2025. 2
[24] Ron A Shapira Weber, Matan Eyal, Nicki Skafte, Oren Shriki, and Oren Freifeld. Diffeomorphic temporal alignment nets. Advances in neural information processing systems, 32, 2019. 2
[25] Nicki Skafte and Søren Hauberg. Explicit disentanglement of appearance and perspective in generative models. Advances in Neural Information Processing Systems, 32, 2019. 2
[26] Hexiang Wang, Fengqi Liu, Qianyu Zhou, Ran Yi, Xin Tan, and Lizhuang Ma. Continuous piecewise-affine based motion model for image animation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 5427–5435, 2024. 2
[27] Ron Shapira Weber and Oren Freifeld. Regularization-free diffeomorphic temporal alignment nets. In International Conference on Machine Learning, pages 30794–30826. PMLR, 2023. 2