[step:Completeness — every distinguishable pair gets filled]
[claim:For every $\{q, q'\} \in P$ with $q \not\sim q'$, the algorithm fills $A_{q, q'}$ before termination]
Suppose $q \not\sim q'$ and fix a *shortest* word $w$ distinguishing $q$ from $q'$. We prove by strong induction on $|w|$ that $A_{q, q'}$ is filled.
*Base* $|w| = 0$: then $w = \varepsilon$ and by definition of distinguishing, exactly one of $q, q'$ lies in $F$. Initialisation sets $A_{q, q'} := \varepsilon$ immediately, so the entry is filled at time $t = 0$.
*Inductive step* $|w| \ge 1$: write $w = av$ with $a \in \Sigma$ and $v \in \Sigma^*$, $|v| = |w| - 1$. From $\hat{\delta}(q, w) = \hat{\delta}(\delta(q, a), v)$ and $\hat{\delta}(q', w) = \hat{\delta}(\delta(q', a), v)$, together with the hypothesis that $w$ distinguishes $q$ from $q'$, we conclude that $v$ distinguishes $\delta(q, a)$ from $\delta(q', a)$. In particular $\delta(q, a) \ne \delta(q', a)$ (else the deterministic transition would send $q$ and $q'$ to the same state after reading $a$, and $v$ could not distinguish them). Moreover $v$ is a distinguishing word of length $|w| - 1$, so $\{\delta(q, a), \delta(q', a)\}$ is distinguishable, and any *shortest* distinguishing word for this pair has length at most $|v| < |w|$. By the strong inductive hypothesis, $A_{\delta(q, a), \delta(q', a)}$ is filled at some termination time $t'$.
Now suppose for contradiction that $A_{q, q'} = \bot$ at termination. Consider the pass immediately after $A_{\delta(q, a), \delta(q', a)}$ is filled (if the child was filled at initialisation, consider the first iteration pass). During that pass, the algorithm inspects $\{q, q'\}$ (because it is still empty) and the letter $a$, finds $A_{\delta(q, a), \delta(q', a)} \ne \bot$, and sets $A_{q, q'}$ to $a$ concatenated with that child word. This contradicts the assumption $A_{q, q'} = \bot$ at termination. Hence $A_{q, q'}$ is filled.
[/claim]
[/step]