I am studying the book Discovering Modern Set Theory: The Basics but I am stuck in one important lemma.
Let $\langle A_0,\leq_0 \rangle$ and $\langle A_1,\leq_1 \rangle$ be dense, complete linear orders without largest or smallest elements, and let $D_0$, $D_1$ be dense subsets of $A_0$ and $A_1$ respectively. For every order-preserving function $f:D_0 \to D_1$ there exists an order preserving function $\tilde{f}:A_0 \to A_1$ such that $\tilde{f}|_{D_0}=f$. Moreover, if $f$ maps $D_0$ onto $D_1$, then $\tilde{f}$ maps $A_0$ onto $A_1$.
I succeded to prove the part of the extension following the book's guidance, however I'm stuck in this surjection part. I tried proving by contradiction, contrapositive and trying to prove using the definition of the extension that $\tilde{f}$ will be surjective. This function was defined as following: for each $r \in A_0$ let $$X_r = \{b \in A_1 : \exists d \in D_0, d \leq_0 r, b\leq_1 f(d)\}$$ and set $f(r)$ as the unique $a \in A_1$ such that $$X_r \leq_1 a \leq_1 X_r^c$$ which exists because of density and $\{X_r,X_r^c\}$ being a Dedekind cut. Everything I can think of leads me to the idea of sequence or supremum, which we don't have here. Every idea is welcome.