\newtheorem

\newtheorem{env_name}{caption}[within] \newtheorem{env_name}[numbered_like]{caption}

This command defines a theorem-like environment.

The \newtheorem command may have at most one optional argument.