  We use first-principles calculations to find that in infinite-layer
nickelates $R$NiO$_2$, the widely studied tetragonal $P4/mmm$ structure is only
dynamically stable for early lanthanide elements $R$ = La-Sm. For late
lanthanide elements $R$ = Eu-Lu, an imaginary phonon frequency appears at
$A=(\pi,\pi,\pi)$ point. For those infinite-layer nickelates, condensation of
this phonon mode into the $P4/mmm$ structure leads to a more energetically
favorable $I4/mcm$ structure that is characterized by an out-of-phase rotation
of "NiO$_4$ square". Special attention is given to two borderline cases:
PmNiO$_2$ and SmNiO$_2$, in which both the $P4/mmm$ structure and the $I4/mcm$
structure are local minima and the energy difference between the two structures
can be fine-tuned by epitaxial strain. Compared to the $P4/mmm$ structure,
$R$NiO$_2$ in the $I4/mcm$ structure has a substantially reduced Ni
$d_{x^2-y^2}$ bandwidth, a smaller Ni $d$ occupancy, a "cleaner" Fermi surface
with a lanthanide-$d$-derived electron pocket suppressed at $\Gamma$ point, and
a decreased critical $U_{\textrm{Ni}}$ to stabilize long-range
antiferromagnetic ordering. All these features imply enhanced correlation
effects and favor Mott physics. Our work reveals the importance of
structure-property relation in infinite-layer nickelates, in particular, the
spontaneous "NiO$_4$ square" rotation provides a tuning knob to render
$R$NiO$_2$ in the $I4/mcm$ structure a closer analogy to superconducting
infinite-layer cuprates.
