\numberwithin{section}{chapter}
will set up the first part which will also result in a two-part section number, then \newtheorem{thm}{Theorem}[section]
will add the theorem number to the precomposed section number. (based on amsthm
and amsmath
, the latter for \numberwithin
.)