Idempotent and similar matrix using Einstein notation

Once the matrix product in Einstein summation is understood, one can esily formulate an answer to both the questions (1) and (2).
The matrix product is defined with upper and lower ($i=$ row, $j=$ column) indices as: $$ A B = \left[ (AB)^i_j \right] = \left[ \sum_k A^i_k B^k_j \right] $$ With the Einstein convention, the summation $\sum_k$ is replaced by the assumption that summation is automatically over upper and lower indices iff they are the same. Hence: $$ (AB)^i_j = A^i_k B^k_j $$ Now idempotency (1) can be formulated as: $$ A^2 = A \quad \Longleftrightarrow \quad (AA)^i_j = A^i_k A^k_j = A^i_j $$ And similarity (2) can be formulated as: $$ AP=PB \quad \Longleftrightarrow \quad (AP)^i_j = A^i_k P^k_j = P^i_k B^k_j = (PB)^i_j $$ Or should I say : $\;A^i_k P^k_j - P^i_k B^k_j = 0$ ?