$\mathfrak{q}$ is primary iff: given $a,b \in A$, $ab \in \mathfrak{q}$ and $a \not\in \mathfrak{q}$, then $b^n \in \mathfrak{q}$ for some $n \geq 1$

I am studying from Lang's Algebra, and in Chapter X Noetherian Rings and Modules, $$\S$$3 Primary Decomposition, he makes the following definitions on page 421, third edition (assume that $$A$$ is a commutative ring and that $$M$$ is an $$A$$-module):

Let $$M$$ be a module. A submodule $$Q$$ of $$M$$ is said to be primary if $$Q \neq M$$, and if given $$a \in A$$, the homomorphism $$a_{M/Q}$$ is either injective or nilpotent. Viewing $$A$$ as a module over itself, we see that an ideal $$\mathfrak{q}$$ is primary if and only if it satisfies the following condition: $$\textit{Given a,b \in A, ab \in \mathfrak{q} and a \not\in \mathfrak{q}, then b^n \in \mathfrak{q} for some n \geq 1.}$$

(Here, $$a_{M/Q}$$ is the homomorphism $$M \to M$$ given by $$x \mapsto ax$$.)

I am not able to deduce the equivalent condition given for the ideal $$\mathfrak{q}$$ to be primary. This is what I have so far:

1. If $$a \in \mathfrak{q}$$, then $$a_{A/\mathfrak{q}}$$ is nilpotent. So, to check whether or not $$\mathfrak{q}$$ is primary, we only need to see what happens when $$a \not\in\mathfrak{q}$$.

2. So, suppose that $$a \not\in \mathfrak{q}$$. Then, $$a_{A/\mathfrak{q}}$$ is injective if and only if for all $$\bar{b} \in A/\mathfrak{q}$$, $$a_{A/\mathfrak{q}}(\bar{b}) = \bar{0} \implies \bar{b} = \bar{0}$$, that is, if and only if for all $$b \in A$$, $$ab \in \mathfrak{q} \implies b \in \mathfrak{q}$$.

3. And, $$a_{A/\mathfrak{q}}$$ is nilpotent if and only if there exists $$n \geq 1$$ such that $$(a_{A/\mathfrak{q}})^n(\bar{b}) = \bar{0}$$ for all $$\bar{b} \in A/\mathfrak{q}$$, that is, if and only if $$a^n b \in \mathfrak{q}$$ for all $$b \in A$$.

So, what I have is that $$\mathfrak{q}$$ is primary if and only if for each $$a \not\in \mathfrak{q}$$, either $$ab \in \mathfrak{q} \implies b \in \mathfrak{q}$$ for all $$b \in A$$, or there exists $$n \geq 1$$ such that $$a^n b \in \mathfrak{q}$$ for all $$b \in A$$.

How do I go from here to the statement given in Lang?

Note that $$\newcommand{\q}{\mathfrak{q}}a_{A/\q}$$ is nilpotent if for some $$n\ge1$$, $$a^n(A/\q)=0$$, that is $$a^n\in\q$$. Thus $$a_{A/\q}$$ is nilpotent iff $$a\in\sqrt\q$$, the radical of $$\q$$.

If $$\q$$ is primary and $$ab\in\q$$ then either $$b_{A/\q}$$ is nilpotent or $$b_{A/\q}$$ is injective, but that implies $$a$$ is zero in $$A/\q$$, that is $$a\in\q$$. Therefore either $$a\in\q$$ or $$b\in\sqrt\q$$.

Now suppose that $$\q$$ satifies the alternative condition. If $$b_{A/\q}$$ is not injective, there is $$a\notin\q$$ with $$ab\in\q$$. Then $$b\in\sqrt\q$$, that is, $$b_{A/\q}$$ is nilpotent.

I realised how to do it a few moments after posting the question.

Suppose that $$\mathfrak{q}$$ is primary. Let $$a,b \in A$$, $$ab \in \mathfrak{q}$$ and $$a \not\in \mathfrak{q}$$. We need to show that $$b^n \in \mathfrak{q}$$ for some $$n \geq 1$$.

Let $$b_{A/\mathfrak{q}}$$ be injective. The condition $$ab \in \mathfrak{q}$$ implies that $$b_{A/\mathfrak{q}}(\bar{a}) = \bar{0}$$, since $$ab = ba$$. Now, since $$b_{A/\mathfrak{q}}$$ is injective by assumption, this implies that $$\bar{a} = \bar{0}$$, that is, $$a \in \mathfrak{q}$$, a contradiction.

So, $$b_{A/\mathfrak{q}}$$ must be nilpotent. Hence, there exists $$n \geq 1$$ such that $$b^n r \in \mathfrak{q}$$ for all $$r \in A$$, as shown in point no. 3. In particular, this is true for $$r = 1$$, so we get that $$b^n \in \mathfrak{q}$$ for some $$n \geq 1$$.

Conversely, suppose that the following condition is satisfied:

$$\textit{Given a,b \in A, ab \in \mathfrak{q} and a \not\in \mathfrak{q}, then b^n \in \mathfrak{q} for some n \geq 1.}\tag{*}$$

We need to show that for each $$a \in A$$, $$a_{A/\mathfrak{q}}$$ is either injective or nilpotent.

If $$a \in \mathfrak{q}$$, then $$a_{A/\mathfrak{q}}$$ is nilpotent, as shown in point no. 1.

So, let $$a \not\in \mathfrak{q}$$. If it so happens that whenever $$ab \in \mathfrak{q}$$ we have $$b \in \mathfrak{q}$$, then $$a_{A/\mathfrak{q}}$$ will be injective. That is, if it so happens given $$a \not\in \mathfrak{q}$$ we can take $$n = 1$$ in $$(*)$$ for any $$b \in A$$, then $$a_{A/\mathfrak{q}}$$ will be injective.

So, suppose that $$a \not\in \mathfrak{q}$$ and it is not the case that $$n = 1$$ works in $$(*)$$ for all $$b \in A$$. Then, there exists $$b \in A$$ such that $$ab \in \mathfrak{q}$$ but $$b \not\in \mathfrak{q}$$. Now, since $$ab = ba$$, by swapping the roles of $$a$$ and $$b$$ we see that the hypotheses of $$(*)$$ are again satisfied. Hence, $$a^n \in \mathfrak{q}$$ for some $$n \geq 1$$ (in fact, $$n > 1$$ since $$a \not\in \mathfrak{q}$$ by assumption). Hence, $$a^n r \in \mathfrak{q}$$ for all $$r \in A$$. Thus, $$a_{A/\mathfrak{q}}$$ is nilpotent.

Hence, the two definitions of $$\mathfrak{q}$$ being primary are equivalent.