add matrix theorem