I am not asking about inflection, but about "dem" being part of "demselben", or so it is suggested by writing it not separated (?), but contracted, "dem" forms prepositon "im".
Is this something exclusive to "derselbe"? Or are there more occurences of an article (?) being "part" of another word but then forming a contraction with the preposition?
And either way, how can it be argued looking at this usage that "dem" does not have to be written separately? Intuitively, seperating it is one of the most common mistakes of Germans. Thinking of "der gleiche" also shows why it could be this way.