Let $(R,m)$ be Noetherian local ring which is an imagine of a Gorenstein ring $(S,n)$. Set
$$ K\_R:= Ext\_S^{s-d}(R,S), $$
where $d=\dim R$, $s=\dim S$.
If $K\_R$ is Cohen-Macaulay (i.e. $R$ is a canonical Cohen-Macaulay ring) and $R$ is unmixed (i.e. $dim \widehat{R}/p=d$ for all $p \in Ass \widehat{R}$), is there exist an injective homomorphism
$$ R \overset{\varphi}{\longrightarrow} K\_R. $$
If there exists what is $dim Coker(\varphi)$ ?


Thank you very much for your help.



Ring with Cohen-Macaulay canonical module
It seem to be we should consider the question when $R$ is Cohen-Macaulay and $R\_{\mathfrak{p}}$ is Gorenstein for all minimal primes $\mathfrak{p}$. In this case there exists canonical ideal $I \cong K\_R$ (see <http://arxiv.org/abs/1106.1301>, 2.7) and $\dim R/I = \dim R-1$. If $\dim R = 0$, there is nothing to do. If $\dim R>0$ there is a regular element $a\in I$. So you have an inclusion $0 \to R \to I$, $x \mapsto ax$. Hence we have $\dim K\_R/R \cong \dim I/(a)$ is either $0$ if $R$ is Gorenstein and $I=(a)$ or $d-1$ otherwise.


Note: If I am not wrong, the condition $R$ is Cohen-Macaulay can be replaced by $S\_2$ condition (I think Goto showed me a proof but I can't remember). 


