π
is a field iff it has no nonzero proper ideals.
So if π
is a field, dimβ‘π
=0.
Conversely, if dimβ‘π
=0 then 0 is a maximal ideal (as Assuming choice, commutative ring has a maximal ideal and A maximal ideal in a commutative ring is prime),
and thus π
has no nonzero proper ideals: π
is a field.
Note for dimβ‘π
=0 every nonzero prime ideal is maximal by vacuity.
Given dimβ‘π
=1,
then any nonzero prime ideal π is contained within a maximal ideal πͺ which is also prime (since Every ideal in a commutative ring is contained in a maximal ideal),
but this must be equal to π or else 0 βπ βπͺ implies dimβ‘π
>1.