Let R denote the real numbers with the order and arithmetic of their ordered field structure, and write s<t to mean s≤t and s=t. Let ε∈R with 0<ε; we must produce δ∈R with 0<δ such that all x,y∈K with dX(x,y)<δ satisfy dY(f(x),f(y))<ε.
The degenerate case. If K=∅, take δ=1, which satisfies 0<1 by claim 6 of Elementary Order Arithmetic in an Ordered Field. There are no points x,y∈K, so the required condition holds vacuously. Assume from now on that K is nonempty.
A cover with no choices. By claim 8 of Elementary Order Arithmetic in an Ordered Field the element η=ε⋅2−1 satisfies 0<η and η+η=ε. Let P be the set of all pairs (x,r) with x∈K and r∈R such that 0<r and such that every z∈K with dX(x,z)<r+r satisfies dY(f(z),f(x))<η. For p=(x,r)∈P put Up=BdX(x,r), the open ball of radius r about x; this assignment is a family of subsets of X indexed by P, and each Up lies in TdX by Open Ball in a Metric Space is Open. Note that P is specified outright by a condition, so no selection of a radius for each point is made.
This family is an open cover of K in X. Indeed, let x∈K. By continuity of f at x relative to K, applied with the tolerance η, there is δ0∈R with 0<δ0 such that every z∈K with dX(x,z)<δ0 satisfies dY(f(z),f(x))<η. Put r=δ0⋅2−1; by claim 8 of Elementary Order Arithmetic in an Ordered Field we have 0<r and r+r=δ0, so (x,r)∈P. Moreover dX(x,x)=0<r by condition 2 of the definition of a metric, so x∈U(x,r).
Extracting a radius. Since K is compact in (X,TdX), the implication from condition 1 to condition 2 of Compact Subset Criterion via Open Covers in the Ambient Space gives a finite subset J⊆P with K contained in the union of the sets Up for p∈J. As K is nonempty, some point of K lies in some Up with p∈J, so J is nonempty. Hence J has n elements for some natural number n; fix a bijection from the initial segment [n] onto J and write (xk,rk) for the image of k∈[n], so that J consists exactly of the pairs (xk,rk) with k∈[n].
Let c be the n-tuple in R with components ck=−rk. By Greatest Element of a Finite Family in a Totally Ordered Set, applied to R with its total order, there is j∈[n] with ck≤cj for every k∈[n], that is −rk≤−rj; by claim 4 of Elementary Order Arithmetic in an Ordered Field this says rj≤rk for every k∈[n]. Put δ=rj, so 0<δ because (xj,rj)∈P.
The estimate. Let x,y∈K satisfy dX(x,y)<δ. Since the sets Up with p∈J cover K, there is k∈[n] with x∈BdX(xk,rk), that is dX(xk,x)<rk.
First, 0<rk gives rk+0<rk+rk by claim 1 of Elementary Order Arithmetic in an Ordered Field, so rk<rk+rk; with dX(xk,x)<rk and claim 2 of that lemma we get dX(xk,x)<rk+rk. Since x∈K and (xk,rk)∈P, this yields dY(f(x),f(xk))<η.
Next, dX(x,y)<δ=rj and rj≤rk give dX(x,y)<rk by claim 2 of Elementary Order Arithmetic in an Ordered Field, hence in particular dX(x,y)≤rk. Combining with dX(xk,x)<rk by claim 3 of that lemma gives dX(xk,x)+dX(x,y)<rk+rk, and condition 4 of the definition of a metric gives dX(xk,y)≤dX(xk,x)+dX(x,y); so dX(xk,y)<rk+rk by claim 2. Since y∈K and (xk,rk)∈P, this yields dY(f(y),f(xk))<η.
Finally, condition 4 of the definition of a metric gives
dY(f(x),f(y))≤dY(f(x),f(xk))+dY(f(xk),f(y)),
and dY(f(xk),f(y))=dY(f(y),f(xk))<η by condition 3 of that definition. From dY(f(x),f(xk))<η and dY(f(xk),f(y))≤η, claim 3 of Elementary Order Arithmetic in an Ordered Field gives dY(f(x),f(xk))+dY(f(xk),f(y))<η+η=ε, and claim 2 of that lemma gives dY(f(x),f(y))<ε.
Since ε was an arbitrary positive real number, f is uniformly continuous on K.