how can a set generated by 2 elements have 3 basis vectors???
to be fair, p1 and p2 are only listed as generating elements, its not explicitly stated whether or not {p1,p2} forms a basis.
but, by the very definition of "generate" they are elements of a span-set. are they linearly independent? (if you decide they are, how can you be sure?
and what does this mean dim(M) is?)
elements do not have dimension, vector spaces (and their subspaces) have dimension.
the dimension of a vector space, V, is defined to be the number of elements in ANY basis.
if S is a subset of V, then dim(span(S)) ≤ |S|.
if S is a linearly independent set, then dim(span(S)) = |S|.