I was wondering if there is a way to number Theorems and Lemmas the following way:
- Theorems are numbered as [section number].[theorem number] (which I've already done), and
- Lemmas are numbered as [section number].[theorem number].[lemma number] (which I have not done).
For example, here's what I want: the first theorem in section 4 would be Theorem 4.1. If it has two lemmas, the second one should be Lemma 4.1.2. The first lemma following Theorem 4.2 should be Lemma 4.2.1.
Below is my current code. Any help wold be greatly appreciated!
\documentclass{article}
\usepackage{amsmath}
\usepackage{varwidth}
\usepackage[most]{tcolorbox}
\tcbuselibrary{skins}
%THEOREM
\newtcbtheorem[auto counter,number within=section]{theorem}{Theorem}%
{enhanced,frame empty,interior empty,colframe=cyan!50!white, top=8mm,
coltitle=black,fonttitle=\bfseries,colbacktitle=cyan!15!white,
borderline={0.5mm}{0mm}{cyan!15!white},
borderline={0.5mm}{0mm}{cyan!50!white,dashed},
attach boxed title to top left={yshift=-4mm},
boxed title style={sharp corners=east,boxrule=1pt},varwidth boxed title}{thm}
%LEMMA
\newtcbtheorem[]{lemma}{Lemma}%
{enhanced,frame empty,interior empty,colframe=orange!75!white, top=8mm,
coltitle=black,fonttitle=\bfseries,colbacktitle=orange!20!white,
borderline={0.5mm}{0mm}{orange!20!white},
borderline={0.5mm}{0mm}{orange!50!white,dashed},
attach boxed title to top left={yshift=-4mm},
boxed title style={sharp corners=east,boxrule=1pt},varwidth boxed title}{thm}
\begin{document}
\section{First Section}
\begin{theorem}{This one should be named Theorem 1.1}{}
theorem
\end{theorem}
\begin{lemma}{This one should be named Lemma 1.1.1}{}
lemma
\end{lemma}
\begin{lemma}{This one should be named Lemma 1.1.2}{}
lemma
\end{lemma}
\end{document}