In addition to the two mandatory arguments, newtheorem has two mutually exclusive optional arguments. These affect the sequencing and hierarchy of the numbering.
By default each kind of theorem-like environment is numbered independently. Thus if you have three lemmas and two theorems interspersed, they will be numbered something like this: Lemma 1, Lemma 2, Theorem 1, Lemma 3, Theorem 2. If you want lemmas and theorems to share the same numbering sequence---Lemma 1, Lemma 2, Theorem 3, Lemma 4, Theorem 5---then you should indicate the desired relationship as follows:
\newtheorem{thm}{Theorem}
\newtheorem{lem}[thm]{Lemma}
The optional argument |[thm]| in the second statement means that
the lem environment should share the thm numbering
sequence instead of having its own independent sequence.
To have a theorem-like environment numbered subordinately within a sectional unit---e.g., to get propositions numbered Proposition 2.1, Proposition 2.2, and so on in Section 2---put the name of the parent unit in square brackets in final position:
\newtheorem{prop}{Proposition}[section]
With the optional argument |[section]|, the |prop| counter will be reset
to 0 whenever the parent counter |section| is incremented.