basic optimizations for inverses and transposes