%mathpiper,def="IsIdempotent"

IsIdempotent(A_IsMatrix) <-- (A^2 = A);

%/mathpiper



%mathpiper_docs,name="IsIdempotent",categories="User Functions;Matrices (Predicates);Predicates"
*CMD IsIdempotent --- test for an idempotent matrix
*STD
*CALL
	IsIdempotent(A)

*PARMS

{A} -- a square matrix

*DESC

{IsIdempotent(A)} returns {True} if {A} is idempotent and {False} otherwise.
$A$ is idempotent iff $A^2=A$. Note that this also implies that $A$ raised
to any power is also equal to $A$.

*E.G.

In> IsIdempotent(ZeroMatrix(10,10));
Result: True;
In> IsIdempotent(Identity(20))
Result: True;
%/mathpiper_docs