This returns an identity matrix that has the given dimension.
- 2ND + X-1 (MATRIX)
:Prompt [A] :dim([A])→L1 :If L1(1)≠L2(2):Then ::Disp "NO IDENTITY" ::Return :Else ::identity(L1(1))→[B] ::Disp "[A]" ::Pause [A] ::Disp "[B]" ::Pause [B] ::Disp "[A]*[B]" ::Pause [A]*[B] :End
Prompts for a matrix. If the matrix is not square, this determines that there is no identity for that matrix. If it is square, this determines the identity matrix, and proves it by multiplying the identity to the original and returning the result.