If you feel mentally slower in the summer, it’s not your imagination. Research points to four factors that affect cognition.