How to ensure I will stay first author of my paper? Some time ago i clumsily wrote a paper about an algorithm.Since i had no experience in scientific writing i gave the paper to a professor with the hope that he would help me improve the presentation.The professor rewrote the paper making some very minor changes in proofs without my consent but allowed me to be "first author" on the paper.Recently i discovered that he put himself as first author in the first author field(that was intended for those who made the greatest contribution) of the  of the journal's form.I feel a bit cheated by this and i am not sure how to proceed to change it if it is possible.I have already sent an email to the professor who agreed to change his "mistake" but i don't trust him at all since he lied to me repeatedly in the past for other matters.
Is it fair to pressure him to add my name as first author(he said he will but did nothing yet) on the submission form if its possible since he rewrote my paper(without my consent) but really added nothing new to my algorithm and its proofs ?
Since the professor is a bit dishonest how can i be sure that he does it without deceiving me in some way?
Journal editors don't want to become involved in fights about authorship.  However, it is a very well accepted ethical norm that a paper cannot be published without the consent of all of the authors and that authors can't be dropped from a paper after submission or author ordering changed without the consent of the authors.   It's good editorial practice to contact all of the authors of a paper and check for objections if any such change is proposed by the corresponding author.  

Thus you have the "nuclear option" of contacting the editor and telling him/her that this change in author order was counter to your prior agreement with the professor and that you no longer consent to publication. I'd recommend that you start by contacting the editor to find out whether the author order has been fixed by your professor.