Bi-Lipschitz arcs in metric spaces with controlled geometry

We generalize a bi-Lipschitz extension result of David and Semmes from Euclidean spaces to complete metric measure spaces with controlled geometry (Ahlfors regularity and supporting a Poincar\'e inequality). In particular, we find sharp conditions on metric measure spaces $X$ so that any bi-Lipschitz embedding of a subset of the real line into $X$ extends to a bi-Lipschitz embedding of the whole line. Along the way, we prove that if the complement of an open subset $Y$ of $X$ has small Assouad dimension, then it is a uniform domain. Finally, we prove a quantitative approximation of continua in $X$ by bi-Lipschitz curves.


Introduction
Given metric spaces (X, d X ) and (Y, d Y ), a map f : X → Y is said to be an L-bi-Lipschitz embedding (or simply L-bi-Lipschitz or just bi-Lipschitz) if there is a constant L ≥ 1 such that for all x 1 , x 2 ∈ X.A bi-Lipschitz arc in a metric space X is the image of an interval in the real line R under a bi-Lipschitz map.
We will consider the following question: given a set E ⊂ X which is the image of a subset of R under a bi-Lipschitz map, is E contained in a bi-Lipschitz arc?If E is any finite subset of R n , the answer is trivially "yes".For general sets E ⊂ R n , the question was answered in the positive when n ≥ 3 by the following extension theorem of David and Semmes [DS91]: Theorem 1.1 ([DS91, Proposition 17.1]).Let n ≥ 3 be an integer, let A ⊂ R, and let f : A → R n be a bi-Lipschitz embedding.Then there exists a bi-Lipschitz extension F : R → R n .
MacManus [Mac95] extended the result of David and Semmes to the case n = 2, which is much more difficult since intersecting lines in R 3 may be easily modified so that they no longer intersect, but this is not the case in R 2 .One may view these extension results as rougher versions of the classical Whitney Extension Theorem [Whi34]; while the maps considered here are analytically weaker (as they are bi-Lipschitz rather than differentiable), they are metrically and topologically stronger.
Theorem 1.1 is a special case of a more general result in [DS91] where A ⊂ R d and n ≥ 2d+1.The main motivation behind that result was to establish the equivalence of the boundedness of certain singular operators on R n via quantitative rectifiability.More precisely, Theorem 1.1 was used in [DS91] to show that, when n ≥ 3, every Ahlfors 1-regular set A ⊂ R n (see (2.1) for the definition of Ahlfors regularity) which admits a corona decomposition (roughly speaking, A can be decomposed into a collection of subsets which are well-approximated by Lipschitz graphs and a collection of subsets which are not, and both of these collections have controlled measure) contains "big pieces" of bi-Lipschitz arcs i.e. for any ϵ > 0, there exists an M > 0 such that, for any x ∈ A and any R > 0, there is an M -bi-Lipschitz embedding ρ : R → R n such that Another application of Theorem 1.1 is in the problem of the bi-Lipschitz rectifiability of sets in Euclidean spaces.In other words, one hopes to classify those subsets of R n that are contained in a bi-Lipschitz arc.While the classical characterization of the Lipschitz rectifiability of sets in Euclidean spaces has been completely resolved [Jon90,Oki92], the problem of bi-Lipschitz rectifiability remains open mainly due to topological constraints.Theorem 1.1 can be used to show that, if a set E ⊂ R n has Assouad dimension less than 1, then E is bi-Lipschitz rectifiable; see [BV19, Corollary 3.5] for a different approach.See Section 2 for the definition of the Assouad dimension.
In this article, we generalize Theorem 1.1 to the setting in which Euclidean spaces R n are replaced by a large class of metric measure spaces.There are two main difficulties in this generalization.Firstly, the target metric space X must contain many of rectifiable curves, and this notion of "many" must be understood quantitatively.A notable example (and, in fact, the initial motivation for this project) is the Heisenberg group H in which the classical Whitney Extension Theorem for curves has been well-studied recently; see [Zim18,PSZ19,Zim22,SZ23].We will not define the Heisenberg group here but only recall that it is a geodesic space homeomorphic to R 3 , and there exists a distribution H : R 3 → Gr(2, R 3 ) such that if a curve γ : [0, 1] → H is rectifiable, then it is differentiable almost everywhere and γ(t) ∈ H γ(t) for almost every t.This fact implies that there must be many fewer rectifiable curves in H than in R 3 .Secondly, the proof in the Euclidean case relies on the existence of differentiable bump functions ϕ : R → R n with controlled derivatives, and we cannot hope to recover this idea in a general metric space.
The class of metric measure spaces to which the bi-Lipschitz extension result will be generalized will have two properties.The first is Ahlfors regularity: we say that a metric measure space (X, d, µ) is Ahlfors Q-regular (or simply Q-regular) if the measure of any ball of radius r is comparable to r Q .The second property is the existence of a Poincaré inequality.Such an inequality roughly states that, if we use u B to denote the average value of a function u : X → R on a ball B, then the average of the variation |u − u B | is controlled by the average of a "weak derivative" of u on B. See Section 2 for all relevant definitions.It is known that Ahlfors regular spaces supporting a Poincaré inequality must contain quantitatively many rectifiable curves.Moreover, such spaces admit a notion of differentiation [Che99].
The following is the main result of this paper: Theorem 1.2.Let (X, d, µ) be a Q-regular, complete metric measure space supporting a p-Poincaré inequality for some 1 < p ≤ Q − 1.If A ⊂ R and f : A → X is a bi-Lipschitz embedding, then f extends to a bi-Lipschitz embedding F : I → X where I is the smallest closed interval containing A.
In Theorem 6.1 we prove a stronger quantitative version of this result in the sense that the bi-Lipschitz constant of F depends only the bi-Lipschitz constant of f and on the data of Ahlfors Q-regularity and the Poincaré inequality.Moreover, if X is unbounded, then we can choose I = R.
The assumptions of the theorem are sharp in that neither Ahlfors regularity nor the Poincaré inequality can be removed from the statement.For Ahlfors regularity, let X = S 2 × R with the length metric and the induced Hausdorff 3-measure.Then X is complete, has Ricci curvature bounded from below so it satisfies the 1-Poincaré inequality [Cha01, Chapter VI.5], but is not Ahlfors regular.Define Since the Poincaré inequality is an open ended condition [KZ08], we may assume that p < Q − 1 for the proof of the theorem.However, the bound Q − 1 is sharp.To see this, let n ≥ 2, let P 1 , P 2 be two n-dimensional planes in R 2n−1 intersecting on a line ℓ, and let p 0 ∈ ℓ.The metric space X = (P 1 ∪ P 2 ) \ B(p 0 , 1) with the induced Euclidean metric and n-dimensional Lebesgue measure is complete, n-regular, and satisfies the p-Poincaré inequality for all p > n − 1 [HK98, Theorem 6.15].Let 2 ) ∈ P 2 \(ℓ∪B(p 0 , 1)), and f maps R\(−1, 1) isometrically onto ℓ\B(p 0 , 1).Then f is bi-Lipschitz but admits no homeomorphic (let alone bi-Lipschitz) extension F : R → X.
1.1.Related results.The first corollary of Theorem 1.2 gives a sufficient condition for bi-Lipschitz rectifiability in Ahlfors regular spaces satisfying a Poincaré inequality.
Corollary 1.3.Let X be a complete Q-regular metric measure space supporting a p-Poincaré inequality for some 1 The proof of the corollary follows the same ideas as in the Euclidean case.Since the Assouad dimension of E is less than 1, [DS97, Lemma 15.2] implies that E must be uniformly disconnected, and hence it is bi-Lipschitz equivalent to an ultrametric space Z of Assouad dimension less than 1 [DS97, Proposition 15.7].By [LML94, Theorem 3.8], there exists a bi-Lipschitz embedding g : E → R, and, by Theorem 1.2, there exists a closed interval I and a bi-Lipschitz extension f : I → X of the map g −1 : g(E) → X.Thus E ⊂ f (I), so E is contained in a bi-Lipschitz arc.
The proof of Theorem 1.2 has two main ingredients.The first is the construction of short curves in X \ f (A) that stay quantitatively far from f (A).To build such curves, we will use the notion of the uniformity of a set.Given a set U ⊂ X, we say that U is c-uniform if, for every x, y ∈ U , there exists a path γ : [0, 1] → U joining x to y such that (1) the length of γ is at most cd(x, y), and (2) dist(γ(t), X \ U ) ≥ c −1 dist(γ(t), {x, y}) for all t ∈ [0, 1].In other words, U is uniform if, for any x, y ∈ U , there exists a curve connecting them which is short compared to d(x, y) and stays far from X \ U quantitatively.If U satisfies only property (1) in this definition, then we say that U is c-quasiconvex.
It is an open problem to classify the closed sets Y ⊂ X for which X \ Y is quasiconvex or uniform.Hakobyan and Herron [HH08] showed that, if this assumption is sharp.Herron, Lukyanenko, and Tyson [HLT18] proved the same result in the Heisenberg group H where, in this setting, it is assumed that H 3 (Y ) = 0.The dimension 3 is natural as H is 4-regular while R n is n-regular.It is unknown if a similar result exists in all Carnot groups.
The question of whether X \ Y is uniform has been studied in terms of uniform disconnectedness of Y [Mac99] and quasihyperbolicity of X and Y [Her87, HVW17,Her22].Väisälä [Väi88] showed that, if R n \ Y is uniform, then the topological dimension of Y is at most n − 2. The following proposition, which we prove in Section 3, works in the opposite direction: if X is Ahlfors regular and supports a Poincaré inequality and if the Assouad dimension of Y is small, then X \ Y is uniform.
Proposition 1.4.Let (X, d, µ) be a complete Q-Ahlfors regular metric measure space supporting a p-Poincaré inequality for some Note that if Y ⊂ X and has Assouad dimension less than Q−p, then H Q−p (Y ) = 0.The assumption on the Assouad dimension is sharp.For example, let X = R n , let P be an (n − 1)-dimensional hyperplane in R n , and let Y be a maximal 1separated subset of P .Then it is easy to see that dim The second ingredient in the proof of Theorem 1.2 is a standard "straightening" argument for paths.In particular, Lytchak and Wenger [LW20, Lemma 4.2] proved that, given any topological arc in a geodesic space, there exists a bi-Lipschitz arc with the same endpoints that is close to the original one; see also [MW21,Lemma 4.2] for a similar result for topological circles.In Section 4, we prove a quantitative version of their result.Moreover, under the additional assumptions of Q-regularity and a Poincaré inequality, we show as a corollary of Theorem 1.2 that every continuum (i.e., every compact connected set) can be approximated by a bi-Lipschitz curve in the Hausdorff distance.
In particular, every compact Ahlfors regular metric measure space supporting a Poincaré inequality contains "almost space-filling" bi-Lipschitz curves.
1.2.Outline of the proof of Theorem 1.2.We start with two simple reductions.First, since bi-Lipschitz maps extend on the completion of their domain, we may assume that A is a closed set.Second, it is well known that the Poincaré inequality, completeness, and Ahlfors regularity imply that X is quasiconvex [Che99, Theorem 17.1].Every complete quasiconvex space is bi-Lipschitz equivalent to a geodesic metric space and since the properties of Ahlfors Q-regularity and the p-Poincaré inequality are preserved under bi-Lipschitz mappings [HKST15, Lemma 8.3.18],we may assume for the rest that X is geodesic.
For the proof of Theorem 1.2, similar to the proof of Theorem 1.1 and the Whitney Extension Theorem, we construct a Whitney decomposition {Q i } i∈N of I \ A, i.e., a collection of closed intervals in I \ A with mutually disjoint interiors such that their union is I \ A and the length of each interval is comparable to its distance from A.
In Section 5 we define two auxiliary embeddings.Specifically, in §5.1 we construct a bi-Lipschitz embedding π of E into X, where E is the set of endpoints of the Whitney intervals Q i .The final map F will map elements of E very close to their image under π.In §5.2, we use the results of Sections 3 and 4 to define a second bi-Lipschitz embedding then the image g( Qi ) is a bi-Lipschitz curve that has endpoints very close to π(x) and π(y).
In Section 6 we describe a method to modify and extend the map g near the points π(x) to build a curve on the entire interval I, and we verify that this curve is indeed bi-Lipschitz to complete the proof of Theorem 1.2.
Acknowledgements.We thank the referee for their valuable comments.The second author would like to thank Sylvester Eriksson-Bique for a valuable conversation at an early stage of this project, and Damaris Meier for a conversation on the bi-Lipschitz approximation of curves.

Preliminaries
Given quantities x, y ≥ 0 and constants a 1 , . . ., a n > 0 we write x ≲ a1,...,an y if there exists a constant C depending at most on a 1 , . . ., a n such that x ≤ Cy.If C is universal, we write x ≲ y.We write x ≃ a1,...,an y if x ≲ a1,...,an y and y ≲ a1,...,an x.
Given a metric space (X, d) and two points x, y ∈ X, we say that γ is a path joining x with y if there exists some continuous γ : [0, 1] → X with γ(0) = x and γ(1) = y.
2.1.Porosity and regularity.For a constant C > 1, a metric space X is called C-doubling if every ball of radius r can be covered by at most C balls of radii at most r/2.Given another constant α ≥ 0, X is called (C, α)-homogeneous if every ball of radius R can be covered by at most C(R/r) α balls of radii at most r.We will occasionally refer to such a metric space as α-homogeneous when the constant C is not important.Clearly, a (C, α)-homogeneous space is (C2 α )-doubling.Conversely, given C > 0 there exists C ′ > 0 and α > 0 such that a C-doubling space is (C ′ , α)homogeneous.
The Assouad dimension of a metric space X (denoted dim A (X)) is the infimum of all α ≥ 0 such that X is α-homogeneous.
A metric measure space (X, d, µ) is said to be Q-Ahlfors regular (or Q-regular) for Q ≥ 0 if there exists C ≥ 1 such that, for all x ∈ X and all r ∈ (0, diam X), (2.1) Given Y ⊂ X we say that Y is p-porous for some p ≥ 1 if, for all y ∈ Y and all r ∈ (0, diam X), there exists some x ∈ B(y, r) such that B(x, r/p) ⊂ B(y, r) \ Y .In other words, Y contains relatively large "holes" near every point.
Here, ϵ and p depend only on each other, Q, and C.

Poincaré inequality.
Given a locally Lipschitz function u defined on a metric space (X, d), we say that a function g : X → [0, ∞) is an upper gradient of u if |u(x) − u(y)| ≤ ˆγ g ds for all x, y ∈ X and all paths γ in X joining x with y.
We say that a metric measure space (X, d, µ) supports a (1, p)-Poincaré inequality (or simply a p-Poincaré inequality) for some 1 ≤ p < ∞ if there exist λ ≥ 1 and C > 1 with the following property: if u : X → R is locally Lipschitz and g : X → [0, ∞) is an upper gradient of u, then, for all x ∈ X and r > 0, (2.2) It follows from Hölder's inequality that if 1 ≤ p ≤ q and (X, d, µ) satisfies a p-Poincaré inequality, then it satisfies a q-Poincaré inequality.Moreover, if the space is geodesic and doubling, then one can choose λ = 1; see for example [HKST15, Remark 9.1.19].Henceforth, given a geodesic doubling space X that satisfies the p-Poincaré inequality, we will assume that λ = 1 in (2.2) and the constant C will be called the data of the Poincaré inequality.
For a detailed exposition on the Poincaré inequality on metric measure spaces, the reader is referred to [HKST15].

Modulus of curve families.
The basic tool in the proof of Theorem 1.2 and Proposition 1.4 is the notion of the modulus of curves.In a sense, the modulus is a measurement of "how many" rectifiable curves are contained in a curve family.
Given a family Γ of rectifiable curves in a metric measure space (X, d, µ), we say that a Borel function ρ : For p ≥ 1, we define the p-modulus of Γ by Mod p (Γ) := inf ˆX ρ p dµ : ρ is admissible for Γ .
It is well known that Mod p is an outer measure on the space of all curve families in X.
The next lemma relates the modulus of curve families with the locally Lipschitz capacity between compact sets.Given two sets E and F in a metric space, we say that a curve γ joins E with F if there are points x ∈ E and y ∈ F such that γ joins x with y.
Lemma 2.2 ([KS01, Theorem 1.1]).Suppose that (X, d, µ) is a geodesic metric measure space equipped with a doubling measure µ and supporting a p-Poincaré inequality with p > 1, and suppose that Ω is a domain in X.Let E, F be disjoint, compact, non-empty subsets of Ω, and let Γ be the collection of curves in Ω that join E with F .Then the p-modulus of Γ is equal to the p-capacity of E and F : where the infimum is taken over all Borel functions g : Ω → [0, ∞) such that each g is an upper gradient of some locally Lipschitz function u : Ω → R satisfying u| E ≥ 1 and u| F ≤ 0.

Uniformity in metric measure spaces
The goal of this section is the proof of Proposition 1.4.The next lemmas are the crux of the proof.
Lemma 3.1.Let (X, d, µ) be a (C 1 , Q)-Ahlfors regular geodesic metric measure space supporting a p-Poincaré inequality with data C, for some C, C 1 ≥ 1, and , and let Γ be the collection of paths in B(x, 2d(x, y)) that connect B(x, r) with B(y, r).Then Proof.Set D = d(x, y).Let u : B(x, 2D) → R be a locally Lipschitz function satisfying u| B(x,r) ≥ 1 and u| B(y,r) ≤ 0. Let also g : B(x, 2D) → [0, ∞) be an upper gradient of u.By the p-Poincaré inequality, ˆB(x,2D) Denote by Γ the collection of curves joining B(x, r) with B(y, r).By Lemma 2.2, and let Γ be the collection of paths in B(x, R) that have length at least ℓR.Then, Proof.Note that the function ρ = (ℓR and let Γ be the collection of paths in B(x, R) with an endpoint outside of B(Y, 2δR) and which intersect B(Y, δR).Then Proof.Define the function and note that ρ is admissible for Γ.Indeed, if γ ∈ Γ, then the the total length of the part of γ that is inside B(Y, 2δR) must be at least δR.
and, by the homogeneity of X, it follows that card(V ) Proof.Set D := d(x, y) and r := 1 4 min {D, dist({x, y}, Y )} .Let Γ 1 be the collection of all curves in B(x, 2D) that join B(x, r) to B(y, r).Let Γ ℓ be the collection of all curves in B(x, 2D) that have length at least 2Dℓ.Let Γ ′ δ be the collection of all curves in B(x, 2D) that intersect a (2Dδ)-neighborhood of Y and have length at least 2Dδ.
By Lemma 3.1, Lemma 3.2, and Lemma 3.3, there exist and concatenate γ with geodesic segments [x, γ(0)] and [γ(1), y].The resulting curve satisfies the conclusions of the corollary.□ Proof of Proposition 1.4.By Lemma 2.1, the regularity of X, and the homogeneity of Y , there exists p 0 > 1 such that Y is p 0 -porous.Fix now x, y ∈ X \ Y and denote r := d(x, y).There exists Moreover, for each n ∈ N, there exist points Applying Corollary 3.4, there exists c > 1 depending only on p 0 , p, Q, C, and C 1 such that, for each n ∈ Z, there exists a path Concatenating all the paths {γ n } n∈Z and adding the points x, y we obtain a path γ : If z is either of x or y, then there is nothing to show.Otherwise, there exists n ∈ Z such that z is in the image of γ n .Assume as we may that n ≥ 0. Then which completes the proof.□

Bi-Lipschitz approximation of curves
In this section we show how paths in geodesic spaces can be approximated by bi-Lipschitz arcs with the same endpoints.The main goal will be the proof of Proposition 1.5.
The next lemma is important in the proof of Theorem 1.2 and is almost identical to [LW20, Lemma 4.2].The difference here is the quantitative control on the bi-Lipschitz constant L. Lemma 4.1.Given C ≥ 1 and ϵ > 0, there exist L = L(C, ϵ) ≥ 1 with the following property.Let (X, d) be a C-doubling geodesic metric space and let σ : [0, 1] → X be a curve with σ(0) ̸ = σ(1).There exists a curve γ : The doubling property is not necessary to guarantee the existence of the bi-Lipschitz map γ; see [LW20, Lemma 4.2].It is, however, necessary to control the constant L. For example, let X = ℓ 2 , let e 1 , e 2 , . . .be an orthonormal basis of ℓ 2 , and let n ∈ N. Define σ : [0, 1] → ℓ 2 so that σ(0) = e 0 := 0, σ(i/n) = e i for i ∈ {1, . . ., n}, and σ| is disconnected.Therefore, if γ is a path in ℓ 2 joining 0 with e n and satisfying In particular, the length of γ is at least a fixed multiple of n, while |γ(0) − γ(1)| = 1.It follows that, if γ is L-bi-Lipschitz, then L must depend on n and not just on ϵ.
For the proof of Lemma 4.1, we require a simple lemma.Here and for the rest of this section, all geodesic curves are parameterized by arc-length.Lemma 4.2.Let X be a geodesic metric space, let a ≥ b > 0, let f : [0, a] → X be L-bi-Lipschitz, let p ∈ X, and suppose For the lower bound, we claim that d(h(t), h(s)) ≥ d(h(t), h(b)).Indeed, if this was not the case, then □ We are now ready to show Lemma 4.1.
By induction, we have defined a number 0 < s n ≤ n(ϵ/2) and a 2 n−1 -bi-Lipschitz curve γ n : [0, s n ] → X such that γ n (0) = σ(0), γ n (s n ) = σ(1), and The desired curve γ : [0, 1] → X is the reparameterization γ(t) = γ n (s n t).□ 4.1.Proof of Proposition 1.5.The proof of Proposition 1.5 will rely on the quantitative version of Theorem 1.2; see Theorem 6.1.We first review some elementary notions from graph theory.A (combinatorial) graph is a pair G = (V, E) of a finite vertex set V and an edge set E which contains elements of the form {v, y, and {v i−1 , v i } ∈ E for all i ∈ {1, . . ., n}.A graph G is connected if any two distinct vertices can be joined by a simple path in G.
Proof.We will use the fact that every connected graph admits a 2-to-1 Euler tour along its edges, that is, for each vertex z there exists a finite sequence (z j ) m j=1 of vertices in G such that z 1 = z m = z, {z j , z j+1 } is an edge for all j, and for each edge e there exists exactly two j such that e = {z j , z j+1 }.See for example the Euler tour technique introduced in [TV84].Now let G, v, v ′ be as in the statement.Deleting some edges from E, we may assume that G is a (combinatorial) tree, that is, for any two distinct vertices there exists unique simple path in G that connects them.Let Ṽ = {v 1 , . . ., v k } be the unique such path with v 1 = v and v k = v ′ .For each i ∈ {1, . . ., k}, let G i = (V i , E i ) be the maximal subgraph of G with the property that any simple path connecting a vertex of G i with a vertex of Ṽ must contain v i .Since G is connected, it follows that each G i is connected.Moreover, since G is a tree, for any i ̸ = j the graphs G i and G j are trees with mutually disjoint vertices (and hence edges).
The construction of the finite sequence (v i ) i is as follows.Firstly, do a 2-to-1 tour of G 1 starting and ending on v 1 .Then proceed to v 2 and do a 2-to-1 tour of G 2 starting and ending on v 2 .Continue in this way until reaching v k where we do a 2-to-1 tour of G k starting and ending on v k .□ Proof of Proposition 1.5.If diam K = 0, then there is nothing to prove.Assume now that diam K > 0 and, rescaling, we may further assume that diam K = 1.Let Y be a maximal (ϵ/4)-separated subset of K that contains x and y.By the regularity of X, the cardinality of Y is at most C ′ ϵ −Q for some C ′ > 0 depending only on the constants of Q-regularity.Define a graph G with vertex set Y such that two points z, z ′ ∈ G are connected by an edge if and only if d(z, z ′ ) < ϵ/2.Since K is connected, it follows that G is connected.By Lemma 4.3 there exists a tour x = v 0 , . . ., v n = y of the vertices Y such that each edge is visited at most twice.
For each z ∈ Y , denote by m z the number of indices i such that v i = z.There exists C ′′ > 0 depending only on the constants of Q-regularity such that each vertex of G is contained in at most C ′′ edges.Therefore, for each z ∈ Y , m z ≤ C ′′ and it follows that n ≤ C ′′ C ′ ϵ −Q .Moreover, there exists c > 4 depending only on the constants of Q-regularity such that for each z ∈ Y there exist points v z,1 , . . ., v z,mz ∈ B(z, ϵ/16) such that d(v z,i , v z,j ) ≥ c −1 ϵ, for all z ∈ Y and i ̸ = j.
We may also assume that v x,1 = x and v y,my = y.

Whitney intervals and a preliminary extension
Here and for the rest of this section we assume that X is a complete geodesic (C 1 , Q)-Ahlfors regular metric measure space supporting a p-Poincaré inequality with data C where p ∈ (1, Q − 1) and C 1 , C > 1.We also assume that A ⊂ R is a closed set and that f : A → X is an L-bi-Lipschitz embedding.
Let I be the smallest closed interval with A ⊂ I (possibly R).We need a Whitney decomposition of I \ A as in Whitney's classical proof of his extension theorem [Whi34].We may assume that A is not a closed interval itself, as then there is no extension to be made.

1]). There exists a collection of closed intervals {Q
Moreover, if the intervals Q i and Q j share an endpoint, then (5.1) Henceforth, the intervals {Q i } i∈N will be called Whitney intervals.

Reference points. Let E denote the collection of endpoints of {Q
Proposition 5.2.There exists ξ ∈ (0, 1) and L > 1 depending only on L, C 1 , and Q, and there exists an L-bi-Lipschitz map π : E → X such that, for all distinct x, y ∈ E, (1) We start with a result that allows us to partition E into a finite number of subsets such that elements of the same subset are far apart quantitatively.Recall that by Lemma 2.1, there exists p 0 ≥ 1 depending only on L, C 1 , and Q such that f (A) is p 0 -porous.
Lemma 5.3.There exists n ∈ N depending only on L, C 1 , and Q, and there exists a partition of E into mutually disjoint sets E 1 , . . ., E n such that for any i ∈ {1, . . ., n} and for any x, y Proof.Enumerate E = {x 1 , x 2 , . . .}, and for each i ∈ N, define V i be the set of all indices j ∈ N such that We claim that there exists n ∈ N depending only on L, C 1 , and Q such that card(V i ) ≤ n for each i ∈ N. To this end, fix i ∈ N and note that for any j, k ∈ V i with j ̸ = k, Moreover, let j, k ∈ V i with j ̸ = k, and let Q j1 and Q j2 be the two Whitney intervals which share the endpoint x j and Q k1 and Q k2 be the two Whitney intervals which share the endpoint x k .We have , and a similar estimate holds for Q j2 , Q k1 , and Q k2 .Since x j ̸ = x k , one of the intervals for which they are endpoints lies between them.That is, Combining this with (5.3), we conclude that card(V i ) ≤ 192L(8p 0 ) 2 =: n.
For the first property, fix x ∈ E k+1 .By (5.4), For the third property, fix distinct x, y ∈ E (k+1) and assume that x ∈ E k+1 .If y ∈ E k+1 , then by (5.6) then we work as in the preceding case.If then by (5.13) and (5.14), After n steps, we have defined ξ := ξ n and the map π : E → X that satisfies properties (1)-(3) in the statement of the lemma.
To show that π is bi-Lipschitz, fix distinct x, y ∈ E and assume without loss of generality that |x − a x | ≥ |y − a y |.By Lemma 5.1(iii), |x − a x | ≤ 4|x − y|.By property (3), For (5.2), fix a Whitney interval Q i = [x, y] and assume, without loss of generality, that |x − a x | ≤ |y − a y |.There are two cases to consider.Assume first that a x = a y .By property (1), The middle third of each Whitney interval.The goal of this subsection is to extend f to the union of the middle-thirds of all Whitney intervals {Q i } i∈N in a bi-Lipschitz way.From here on, for each Whitney interval Q i , we denote by Qi the middle third interval of Q i .Recall the constants ξ ∈ (0, 1) and L from Proposition 5.2 depending only on L, C 1 , and Q.
Proposition 5.4.There exists a constant L ≥ 1 depending only on p, C, C 1 , L, and Q, and there exists an L-bi-Lipschitz extension of f Recall that, since f is bi-Lipschitz, the set f (A) is 1-homogeneous in X.
Lemma 5.5.There exist constants β 0 , ℓ 0 , δ 0 > 0 depending only on p, C, C 1 , L, and Q with the following property.Let Q i = [w, z] be a Whitney interval and Γ i be the collection of curves γ : , we may apply Lemma 3.1, Proposition 5.2(3), and (5.2) to conclude that the family Γ (1) i of curves where α > 0 is some constant depending only on p, C, C 1 , Q, and L.
By Lemma 3.2, there exists ℓ 0 > 0 depending only on p, C, C 1 , Q, and L such that the subfamily . By Lemma 3.3, there exists δ 0 > 0 depending only on Q, p, C, C 1 , and L such that the subfamily We now need a filtration of the Whitney decomposition, in the vein of the following result of David and Semmes.The proof of the lemma is almost identical to that of Lemma 5.3 and is left to the reader.

Lemma 5.6 ([DS91, Proposition 17.4]).
There exists an integer N depending only on L, C 1 , and Q, and there exists a partition of N into sets {I 1 , . . ., I N } such that for any k ∈ {1, . . ., N } and for any i, j We are now ready to prove Proposition 5.4.
Proof of Proposition 5.4.The construction is in an inductive fashion.Let N and I 1 , . . ., I N be the integer and sets of indices from Lemma 5.6.Denote A 0 := A and for each k ∈ {1, . . ., N } denote For each k ∈ {0, . . ., N }, we find some L k ≥ 1 depending only on p, C, C 1 , L, Q, and k, and we find an The map g of Proposition 5.4 will then be the map f N .
For k = 0, set L 0 = L and f 0 = f .Properties (a)-(c) are vacuous.Assume now that for some k ∈ {0, . . ., N − 1}, there exists a constant L k and an Fix i ∈ I k+1 and write Q i = [w, z] and Qi = [ ŵ, ẑ].Recall the family of curves Γ i from Lemma 5.5.By Lemma 3.3, there exists δ k+1 ∈ (0, ξ) depending only on Q, p, C, C 1 , L, and k (in particular on the homogeneity constant of f (A k )) such that the subfamily In particular, Γ ′ k,i is nonempty, so we can pick a curve σ i ∈ Γ ′ k,i .Applying Lemma 4.1 to σ i with a suitable reparameterization, we find a constant L ′ k+1 depending only on Q, p, C, C 1 , L, and k, and we find an In particular, we have that dist(γ i ( Qi ), Clearly, f k+1 |A k = f k .Properties (a)-(c) are clear from the design of f k+1 and Lemma 5.5.To complete the inductive step, we claim that f k+1 is L k+1 -bi-Lipschitz for some L k+1 ≥ 1 depending only on Q, p, C, C 1 , L, and k.Fix x, y ∈ A k+1 .
Firstly, if x, y ∈ A k , then the claim follows by the fact that Secondly, assume that x ∈ Qi for some i ∈ I k+1 and y ∈ A. Let w be the endpoint of Q i closest to A, let ŵ be the endpoint of Qi between x and w, and note that |w − x| ≤ |x − a w | ≤ |x − y|.By (5.16), Proposition 5.2(1), the fact diam Q i ≤ |w − a w |, and properties (a), (b) for f k+1 .
For the lower bound, we have by Lemma 5.5(4) and the design of and, by (5.16), property (c) for f k+1 , and Proposition 5.2(2) , f k+1 (y)) Thirdly, assume that x ∈ Qi and y ∈ Qj , for some i, j For the upper bound, note that (5.17 . Let a i be the closest point of A to Q i , let a j be the closest point of A to Q j , let e i be the endpoint of Q i that lies between x and a i , and let e j be the endpoint of Q j that lies between y and a j .By Proposition 5.2(1), (5.15), (5.2), Lemma 5.1(iii), and (5.17), d(f k+1 (x), f k+1 (y)) ≤ d(f k+1 (x), π(e i )) + d(π(e i ), f (a i )) + d(f (a i ), f (a j )) + d(f (a j ), π(e j )) + d(π(e j ), f k+1 (y)) For the lower bound, there are two cases to consider.Case 1: dist(Q i , Q j ) > 800L 2 diam Q i .By Proposition 5.2(1), (5.15), and Lemma 5.1(iii), Case 2 splits now into two subcases.Case 2.1: i ∈ I k+1 and j ∈ I 1 ∪ • • • ∪ I k .According to the line following (5.15), Case 2.2: i, j ∈ I k+1 .By Lemma 5.6 we have that diam Q i > 800Lδ −1 0 diam Q j .By Lemma 5.5(4), the design of γ i , Proposition 5.2(1), and (5.15), In this section, we will give the proof of the following quantitative version of Theorem 1.2.Theorem 6.1.Given C, C 1 > 0, Q > 2, p ∈ (1, Q − 1), and L ≥ 1, there exists L ′ ≥ 1 with the following property.
Let (X, d, µ) be a complete geodesic (C 1 , Q)-Ahlfors regular metric measure space supporting a p-Poincaré inequality with data C. Let A ⊂ R be a closed set, let I be the smallest closed interval of R containing A, and let f : A → X be an L-bi-Lipschitz embedding.Then there exists an L ′ -bi-Lipschitz extension F : I → X of f .Moreover, if (x, y) is a component of I \ A, then The remainder of this section is devoted to the proof of this theorem.Let {Q i } i∈N be the Whitney decomposition of I \ A from Lemma 5.1 and let Recall that Qi denotes the middle third of the Whitney interval Q i and that E denotes the set of endpoints of Whitney intervals {Q i } i∈N .
There is a map π : E → X satisfying the properties of Proposition 5.2, and there exist a constant L ≥ 1 depending only on C, C 1 , Q, p, and L, and there exists an L-bi-Lipschitz extension g : Â → X of f satisfying the properties outlined in Proposition 5.4.In particular, if (x, y) is a component of I \ A, if Q i ⊂ (x, y), and if x is the closest point of A to Q i , then by (5.2) and (5.15), (6.2) max We introduce several pieces of notation.Given x ∈ E, we denote by L x (resp.R x ) the Whitney interval for which x is the right (resp.left) endpoint.As above, Lx and Rx are the middle thirds of intervals L x and R x .By (5.1), for any x ∈ E we have Further, for any x ∈ E we write Since g is L-bi-Lipschitz, there exists C 2 > 0 depending only on C, C 1 , Q, p, and L such that the set g( Â) (and each of its subsets) is (C 2 , 1)-homogeneous.

Local modifications around points in E.
We divide E into two sets E ′ and E ′′ such that for any two points in E ′ there exists a point in E ′′ between them and vice-versa.That is, for any x ∈ E ′ we have x L , x R ∈ E ′′ , and for any x ∈ E ′′ we have x L , x R ∈ E ′ .
We perform local modifications around points in E starting with points in E ′ .
Furthermore, suppose that x < y are consecutive points in E; that is, x = y L (or equivalently y = x R ).Then, d(g(t 4 x ), g(t 1 y )) (6.8) 2 ξ diam L y .6.2.Definition of the extension F and proof of Theorem 6.1.
Define the map F : I → X so that (1) x ] is the geodesic from γ x (t 3 x ) to g(t 4 x ) of constant speed.Clearly, F is an extension of f .In view of (6.2), the following proposition completes the proof of Theorem 6.1.Proposition 6.1.The map F is an L ′ -bi-Lipschitz embedding for some L ′ ≥ 1 depending only on C, C 1 , Q, p, and L. Proof.Fix s, t ∈ I with s < t.We may assume that one of s, t is in [t 1 x , t 4 x ] for some x ∈ E, since, otherwise F = g, which is L-bi-Lipschitz.Assume without loss of generality that t ∈ [t 1 x , t 4 x ] for some x ∈ E. The proof is a case study.Case 1. Assume that s ∈ [t 1 x , t 4 x ].There are a few subcases to consider.

For
the lower bound, suppose first that |a x − a y | ≥ 16L|x − a x |.Then, |x − y| ≤ 2|a x − a y | and by property (1)