The $\tau$ function of the Kadomtsev-Petviashvili equation transformation groups for soliton equations, I