Elements of abstract and linear algebra