The amsthm documentation states:
If any theorem elements are numbered by section, and (in a book) the first such element in a chapter comes before the first section, numbering will continue from the previous chapter. In such a case, reset the counter by invoking this command before the affected element:
\setcounter{thm}{0}
However, I run the following MWE
\documentclass[openany]{book} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{dfn}{Definition}[section] \begin{document} \chapter{Elio} \begin{dfn} content \end{dfn} \section{Bach} \begin{dfn} content \end{dfn} \chapter{Oliver} \begin{dfn} content \end{dfn} \end{document} and find that dfn in the second chapter is correctly numbered as 2.0.1 despite not using \setcounter{dfn}{0}.
What is going on here?
\newcounter{section}[chapter](l. 271 of book.cls). Is this what you are asking?\newtheorem{dfn}{Definition}[section]overrides the default for thebookdocument class, which (in essence) is\newtheorem{dfn}{Definition}[chapter]. Since a\chapterdirective resets thesectioncounter to 0, it should come as no surprise that the firstdfnenvironment is numbered2.0.1.