I am across the following question here: The uniqueness of a special maximal ideal factorization
Let R be a domain, and let I be an ideal that is a product of distinct maximal ideals in two ways, say $I=P_1⋯P_r=Q_1⋯Q_s$. Prove that the two factorizations are the same, except for the ordering of the terms.
My question: I proved (without loss of generality) that $P_1=Q_1$ using the condidtion that maximal ideals are also prime. Why cant we carry on this argument further? Say $r<s$. Thus, after finite steps we get $1=Q_{r+1}Q_{r+2}\cdots Q_{s}$. This is impossible as this would imply (WLOG) that $(1)\subset Q_{r+1}$ which would then mean that $Q_{r+1}$ is not maximal. Hence $r=s$