The following exercise is taken from the text: Algebra: Groups, Rings, and Fields by Louis Rowen.
The infinite dihedral group $D$ is defined as having generators $a,b$ satisfying the two relations $b^{2}=e$ and $bab^{-1}=a^{-1}.$ Thus $D=\{a^{i}b^{j}| i \in Z, 0\leq j \leq 1\}$, (Note that $D$ is infinite.) We see that
$$(a^{i}b^{j})(a^{u}b^{v})=a^{i+(-1)^{j}u}b^{j+v},$$
implying for any $n$ that the map $\phi: D\rightarrow D_n$ sending $a^{i}b^{j}$ to its value in $D_n$ is indeed a homomorphism, for
$$\phi((a^{i}b^{j})(a^{u}b^{v}))=\phi(a^{i+(-1)^{j}u}b^{j+v})=\phi(a^{i}b^{j})\phi(a^{u}b^{v}).$$
$\phi$ is onto, by inspection: $\text{ker }\phi=\{a^{}b^{}| i\equiv 0 \pmod n \text{ and } j=0\}$.
$(1)$ Verify associativity in the infinite dihedral group $D$, namely that
$$ ((a^{i}b^{j})(a^{i'}b^{j'}))(a^{i''}b^{j''})=(a^{i}b^{j})((a^{i'}b^{j'})(a^{i''}b^{j''})).$$
$(2)$ Avoid computation in $(1)$ by noting that one needs merely check it in $D_n$ for $n$ large enough, but $D_n$ is already known to be a group. (This argument illustrates a general principle in mathematical logic, called compactness.)
For $(1)$, my solution is as follows:
from the presentation for dihedral groups:
$bab=a^{-1}$ implying $ba=a^{-1}b$, $ba^{u}=a^{-u}b$ and $ba^{-u}=a^{u}b$ $(*)$
Then, continuing applying $(*)$ to $(a^{i}b^{j})(a^{u}b^{v})$,
$$\begin{align*} (a^{i}b^{j})(a^{u}b^{v})&=a^{i}b^{j-1}baa^{u-1}b^{v}\\ &=a^{i}b^{j-1}a^{-1}ba^{u-1}b^{v}\\ &=a^{i}b^{j-1}a^{-1}a^{-u+1}bb^{v}\\ &=a^{i}b^{j-1}(a^{-1})^{u}b^{v+1}\\ &=a^{i}b^{j-2}ba^{-u}b^{v+1}\\ &=a^{i}b^{j-2}a^{u}bb^{v+1}\\ &=a^{i}b^{j-2}a^{u}b^{v+2}\\ &\vdots\\ &=a^{i}b^{j-2}a^{u}bb^{v+1}\\ &=a^{i+(-1)^{j}u}b^{v+j} \end{align*}$$
So if $a^{x}b^{y}\in D$, then $$ \begin{align*} [a^{x}b^{y}]((a^{i}b^{j})(a^{u}b^{v}))&=a^{x}b^{y}a^{i+(-1)^{j}u}b^{j+v}\\ &=a^{x}b^{y-1}ba^{i+(-1)^{j}u}b^{j+v}\\ &=a^{x}b^{y-1}a^{-i-(-1)^{j}u}bb^{j+v}\\ &=a^{x}b^{y-1}a^{-i-(-1)^{j}u}b^{j+v+1}\\ &=a^{x}b^{y-2}ba^{-i-(-1)^{j}u}b^{j+v+1}\\ &=a^{x}b^{y-2}a^{i+(-1)^{j}u}b^{j+v+2}\\ &\vdots\\ &=a^{x+(-1)^{j}u+(-1)^{y}i}b^{j+v+y} \end{align*}$$
Similarly by applying $(*)$ again to $((a^{x}b^{y})(a^{i}b^{j}))[a^{u}b^{v}],$ where $(a^{x}b^{y})(a^{i}b^{j})=a^{x+(-1)^{y}i}b^{y+j}$
We have $$\begin{align*} ((a^{x}b^{y})(a^{i}b^{j}))[a^{u}b^{v}]&=a^{x+(-1)^{y}i}b^{y+j}a^{u}b^{y+j}\\ &=a^{x+(-1)^{y}i}b^{y+j-1}baa^{u-1}b^{y+j}\\ &=a^{x+(-1)^{y}i}b^{y+j-1}a^{-1}ba^{u-1}b^{y+j}\\ &=a^{x+(-1)^{y}i}b^{y+j-1}a^{-1}a^{-u+1}bb^{y+j}\\ &=a^{x+(-1)^{y}i}b^{y+j-1}a^{-u}b^{y+j+1}\\ &\vdots\\ &=a^{x+(-1)^{y}i+(-1)^{j}u}b^{y+j+v} \end{align*}$$
Hence $[a^{x}b^{y}]((a^{i}b^{j})(a^{u}b^{v}))=((a^{x}b^{y})(a^{i}b^{j}))[a^{u}b^{v}],$ so $D$ is associative.
I am having trouble with $(2)$. Mainly, I don't know how to go about to "check it in $D_n$ for $n$ large enough". I don't know what that means or how to do it. Also, I don't have much background in mathematical logic, so I am not sure how this exercise is related to compactness argument in mathematical logic.
Thank you in advance.
You are completely ignoring the formula you are given to multiply elements in part (1), leading to completely unnecessary work. You are told that $$(a^ib^j)(a^rb^s) = a^{i+(-1)^jr} b^{j+s}$$ yet you ignore that formula over and over and over agan.
Even if you think you need to prove that formula, then you should just do it once. By induction on $r$ we have $ba^r = a^{-r}b$: for $r=1$ it is the definition, and if $ba^k = a^{-k}b$, then $ba^{k+1} = ba^ka = a^{-k}ba = a^{-k}a^{-1}b = a^{-(k+1)}b$. Now, by induction on $j$, we have $$(a^ib)(a^rb^s) = a^i(ba^r)b^s = a^ia^{-r}b^rb^s = a^{i+(-1)^1r}b^{r+s}.$$ Assuming the result holds for $k$, $$ \begin{align*} (a^ib^{k+1})(a^rb^s) &=a^ib(b^ka^r)b^s\\ &= a^i b(a^{(-1)^kr}b^k)b^s\\ &= a^i(ba^{(-1)^kr})b^{k+s}\\ &= a^i (a^{-(-1)^kr}b)b^{k+s}\\ &= a^ia^{(-1)^{k+1}r}b^{(k+1)+s}\\ &= a^{i+(-1)^{k+1}r}b^{(k+1)+s}. \end{align*}$$ That establishes the formula that you didn't have to establish in the first place...
Using the formula, you have $$\begin{align*} \Bigl( (a^ib^j)(a^rb^s)\Bigr)(a^mb^n) &= \Bigl( a^{i+(-1)^jr}b^{j+s}\Bigr)(a^mb^n)\\ &= a^{i+(-1)^jr + (-1)^{j+s}m} b^{j+s+n}.\\ (a^ib^j)\Bigl( (a^rb^s)(a^mb^n)\Bigr) &= (a^ib^j)\Bigl( a^{r+(-1)^sm}b^{s+n}\Bigr)\\ &= a^{i+(-1)^j(r + (-1)^sm)}b^{j+s+n}\\ &= a^{i+(-1)^jr + (-1)^{j+s}m}b^{j+s+n}, \end{align*}$$ proving that the equality holds.
Now, you also already have given that for every $n$ you have a group homomorphism $\phi_n\colon D\to D_{n}$ by $\phi_n(a^ib^j) = a^ib^j$, where the $a$ and $b$ on the right hand side are elements of $D_n$. So pick an $N$ sufficiently large so that all of $|\pm i \pm j\pm k|$ are less than $N$, so that when you map any/all the elements on the preceding calculations to $D_n$, you do not replace any exponents by their remainder modulo $N$. Then you know that $$\begin{align*} \phi_n\Bigl( \bigl( (a^ib^j)(a^rb^s) \bigr)(a^mb^n)\Bigr) &= \phi_n((a^ib^j)(a^rb^s)) \phi_n(a^mb^n)\\ &= \Bigl( \phi_n(a^ib^j)\phi_n(a^rb^s)\Bigr)\phi_n(a^mb^n)\\ &= \phi_n(a^ib^j)\Bigl( \phi_n(a^rb^s)\phi_n(a^mb^n)\Bigr)\\ &= \phi_n(a^ib^j)\phi_n\bigl( (a^rb^s)(a^mb^n)\bigr)\\ &= \phi_n\Bigl( (a^ib^j)\bigl( (a^rb^s)(a^mb^n)\bigr)\Bigr). \end{align*}$$ Because $N$ is sufficiently large, this equality can only hold if $$\Bigl( (a^ib^j)(a^rb^s)\Bigr)(a^mb^n) = (a^ib^j)\Bigl((a^rb^s)(a^mb^n)\Bigr),$$ which proves associativity.