\newcommand{cmd}[n]{def}
\renewcommand{cmd}[n]{def}
\providecommand{cmd}[n]{def}
\newenvironment{name}[n]
{beg}{end}
\renewenvironment{name}[n]
{beg}{end}
\newtheorem{name}{caption}[within]
\newtheorem{name}[like]{caption}
\ensuremath