Twin-width V: linear minors, modular counting, and matrix multiplication