  We study the single spin asymmetry (SSA) for the pion production in
semi-inclusive deep inelastic scattering, $ep^\uparrow\to e\pi X$, in the
framework of the collinear factorization. We derive the complete cross section
formula associated with the twist-3 quark-gluon correlation functions for the
transversely polarized nucleon, including all types of pole (hard-pole,
soft-fermion-pole and soft-gluon-pole) contributions which produce the strong
interaction phase necessary for SSA. We prove that the partonic hard part from
each pole contribution satisfies certain constraints from Ward identities for
color gauge invariance. We demonstrate that the use of these new constraints is
crucial to reorganize the collinear expansion of the Feynman diagrams into
manifestly gauge-invariant form so as to obtain the factorization formula for
the cross section in terms of a complete set of the twist-3 distributions
without any double counting. It also provides a simpler method for the actual
calculation. We also present a simple estimate of SSA based on our cross
section formula, using a model for the ``soft-gluon-pole function'' that
represents the relevant twist-3 quark-gluon correlation, and compare the
magnitude of the terms involving the derivative of the soft-gluon-pole function
with that of the ``non-derivative'' terms.
