Proclaim

%% Defining \proclaim style Remark, Lemmas, Theorem, Corollary, etc
\defineenumeration[remark]
	[text=Remark,
	location=serried,
	width=fit,
	right={.~}]
\setupenumerations[remark]
	[prefix=yes,
	prefixsegments=section] % or prefixsegments=chapter:section
\setupnumber[remark][way=bysection]

\defineenumeration[lemma]
	[text=Lemma,
	location=serried,
	width=fit,
	counter=remark, % only use counter of remark
	style=slanted,
	right={.~}]
\setupenumerations[lemma]
	[prefix=yes,
	prefixsegments=section]

\defineenumeration[theorem]
	[text=Theorem,
	location=serried,
	width=fit,
	counter=remark,
	style=slanted,
	right={.~}]
\setupenumerations[theorem]
	[prefix=yes,
	prefixsegments=section]

\starttext

\title{First and only title of the article}

This file has been typeset 
on \currentdate{} 
at \currenttime, 
with 
\doifmodeelse{mkiv}
	{mkiv, 
	LuaTeX version \the\luatexversion,
	LuaTeX revision \luatexrevision,
	(LuaTeX date stamp \luatexdatestamp),
	using the command: \par
	\type{context basic-test.tex}\par}
	{mkii, 
	using the command: \par
	\type{texexec basic-test.tex}\par}
	ConTeXt version \contextversion.
Here we don't have any section.

\startremark
This is a silly remark.
\stopremark

\startlemma[lem:elem]
This is an elementary result.
\stoplemma

\starttheorem
This is a deep theorem.
\stoptheorem

\startremark
This is a silly remark.
\stopremark

\startlemma
This is an elementary result.
\stoplemma

\starttheorem
This is a deep theorem.
\stoptheorem

\section{This is a section}

Here we do have a section.

\startremark
This is a silly remark.
\stopremark

\startlemma
This is an elementary result.
\stoplemma

\starttheorem
This is a deep theorem.
\stoptheorem

\startremark[rem:silly]
This is a silly remark.
\stopremark

\startlemma
This is an elementary result.
\stoplemma

\starttheorem[thm:deep]
This is a deep theorem.
\stoptheorem

As mentioned in remark \in[rem:silly], the results of lemma \in[lem:elem] and that of theorem \in[thm:deep] are trivial.

\stoptext