A mathematical introduction to logic