Edit: Here's a solution very similar to the proposal in the original question using the xsim pacakge, and solves the problem of the number by substituting a custom ExerciseProperty "mynumber".
\documentclass{article}
\usepackage{amsmath,amsthm}
\usepackage{xsim}
\DeclareExerciseType{myexercise}{
exercise-env = myexercise,
solution-env = mysolution,
exercise-name = \XSIMtranslate{exercise},
exercises-name = \XSIMtranslate{exercises},
solution-name = \XSIMtranslate{solution},
solutions-name = \XSIMtranslate{solutions},
exercise-template = mytemplate,
solution-template = mysoltemplate
}
\DeclareExerciseProperty!{mynumber}
\DeclareExerciseEnvironmentTemplate{mytemplate}{
\begin{description}
\item[\XSIMmixedcase{\GetExerciseName}~\GetExerciseProperty{mynumber}]
}{
\end{description}
}
\DeclareExerciseEnvironmentTemplate{mysoltemplate}{
\renewcommand{\proofname}{Solution}\begin{proof}
}{
\end{proof}
}
\xsimsetup{
mysolution/print = true
}
\begin{document}
\begin{myexercise}[mynumber=2.2.1]
Statement
\end{myexercise}
\begin{mysolution}
Here is the solution.
\end{mysolution}
\end{document}
My original suggestion is below, and uses a simpler set up using mainly just amsthm.
Is the issue just that you need to manually specify the exercise numbers?
Here are a couple ideas.
Create an environment with an argument which is the exercise number, have it create a custom theorem type environment. (Here you use two separate environments, one for the statement, one for the proof.)
\documentclass[12pt]{article}
\usepackage{xparse}
\usepackage{amsthm}
\theoremstyle{plain}
\NewDocumentEnvironment{exercise}{m}{
\newtheorem*{ex#1}{Exercise #1}
\begin{ex#1}
}{
\end{ex#1}
}
\begin{document}
\begin{exercise}{1.2.1}
Statement
\end{exercise}
\begin{proof}
Cuz I said so.
\end{proof}
\end{document}
Or to achieve the same result with a single environment where the "Statement" is the second argument, and the proof goes in the middle:
\documentclass[12pt]{article}
\usepackage{xparse}
\usepackage{amsthm}
\theoremstyle{plain}
\NewDocumentEnvironment{exercise}{mm}{
\newtheorem*{ex#1}{Exercise #1}
\begin{ex#1}{#2}
\begin{proof}
}{
\end{proof}
\end{ex#1}
}
\begin{document}
\begin{exercise}{1.2.1}{Statement}
Proof here.
\end{exercise}
\end{document}
You can specify the style further using the \newtheoremstyle
command from amsthm if need be. (Feel free to ask if you need help with that.)