Let $R$ be a commutative ring with unity, and $0\neq a\in R.$ We will say that an element $x\in R$ is linearly independent if $\{x\}$ is a linearly independent set. A non-zero element of $R$ is called regular if it is not a zero divisor.
$a$ is a regular element iff $\{a\}$ is a linearly independent set. So if $a$ is regular, then the principal ideal $Ra$ is a free $R$-module with basis $\{a\}.$ My question is about the converse.
Suppose $Ra$ is a free $R$-module. Is $a$ regular?
Suppose for a moment that $Ra$ has a one-element basis $\{b\}.$ Then $Ra$ is isomorphic to $R$ as an $R$-module. The $R$-module $R$ has the following property.
$(\mathrm P)$ Every element $x\in R$ generating the whole module $R$ is linearly independent.
This is because the elements generating the whole $R$ are exactly the units of $R$, and the linearly independent elements are exactly the regular elements of $R$ and $0$. Units are always regular.
$Ra$, being isomorphic to $R,$ also satisfies $(\mathrm P).$ Therefore, since $a$ generates the whole $Ra,$ we have that $a$ is linearly independent, and hence regular.
So, returning to my main question, if $Ra$ is a free $R$-module, and we want to show that $a$ is regular, it is enough to show that $Ra$ has a one-element basis, not necessarily $\{a\}.$
It is not difficult to prove that $Ra$ must have a finite basis. Suppose $\{x_i\}_{i\in I}$ is a basis of $Ra$. Then $a$ can be written as $a=\sum_{j\in J}r_ix_j,$ where $J$ is a finite subset of $I.$ Clearly, $\{x_j\}_{j\in J}$ is linearly independent and generates the whole $Ra.$
I don't see how to go from a finite basis to a one-element basis. However, I believe commutative rings should be "nice" enough for the answer to be "yes". Could an ideal of a commutative ring have greater dimension than the ring itself?