Question: pattern matching

I'm trying to understand the various ways to do pattern matching. The problem is that sometimes the patterns seem to matched against a normal form that's different from the one displayed. For example can somebody explain to me why the last pattern match fails below?

> patmatch((1/2)*Zeta+(1/3)*Zeta^5, conditional(Zeta^n::posint*y::anything+z::anything, n >= 3), 's'); s;
true
[n = 5, y = 1/3, z = (1/2)*Zeta]
> patmatch(Zeta^2+(1/3)*Zeta^5, conditional(Zeta^n::posint*y::anything+z::anything, n >= 3), 's'); s;
true
[n = 5, y = 1/3, z = Zeta^2]
> patmatch((1/2)*Zeta^2+(1/3)*Zeta^5, conditional(Zeta^n::posint*y::anything+z::anything, n >= 3), 's');
false

Actually I would hope that it would suffice to just look for 'conditional(Zeta^n, n >= 3)' but that is even more restrictive:

> patmatch((1/2)*Zeta^3, conditional(Zeta^n::posint, n >= 3), 's');
false

Any explanations of how pattern matching works (or does not work) are welcome.

Please Wait...