Luc's ten commandments of authorship
Rule 1: Never consult a list of rules regarding authorship.
Rule 2: Someone tells you a problem, and you solve it. That someone becomes a coauthor.
Rule 3: You are writing a paper, and consult someone regarding a certain crucial fact. That person becomes a coauthor.
Rule 4: You are writing a paper, and consult someone regarding a certain non-essential fact. Use your judgment.
Rule 5: You don't like a certain coauthor for whatever reason. Keep him/her on board. Never remove coauthors. Get your mind off it---crying, sex, indulging, smoking, hallucinating, and swimming in the North Sea may help.
Rule 6: Your name is on a manuscript that is being written but you did not contribute. Remove yourself. You will feel good.
Rule 7: Your name is on a manuscript that is being written and the others are doing or writing something that is unacceptable to you. You fail to convince your coauthors to change their position. Go home, have a beer, and withdraw from the paper.
Rule 8: You help a student out by explaining a certain path to a solution in your office. The student publishes a paper with that solution, but your name is not on it. Be happy, smile.
Rule 9: A group of friends solves a mathematical problem together while kicking around new ideas on the beach. You are all in it together, linked by common bacteria---everyone is a coauthor.
Rule 10: Do not get stressed about it.