I want theorems and lemmas to be referred to in the text as "Theorem 1" and "Corollary 2", sharing the same counter. This works fine when I'm using the normal article documentclass, but fails when I've to use the custom lipics format a conference requires me to use. (One needs to download and unzip the .tgz file in the same folder as the MWE).
Here's a MWE:
\documentclass[a4paper,UKenglish]{lipics}
\usepackage{amsthm, cleveref}
\crefname{theorem}{theorem}{theorems}
\crefname{corollary}{corollary}{corollaries}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}[theorem]{Corollary}
\begin{document}
\section{Section title}
\begin{theorem}\label{thm:test}
Here is the theorem.
\end{theorem}
\begin{corollary}\label{cor:test}
Here is the corollary.
\end{corollary}
The theorem reference is given by \cref{thm:test} and the corollary reference is given by \cref{cor:test}.
\end{document}
I've read here that one needs to declare the newtheorem commands after loading cleveref, but the problem as I've discovered is that lipics.cls declares them in the class file at the very outset. So, is there any way for me to redeclare the newtheorem commands after loading cleveref?
Here's the output I currently get:
How do I correct it so that the corollary reference is correct?