I've recently encoutered usage of the word "einer" in a context I don't quite understand, where it seems to refer to any 'single entity'.
1) Einer für alle, alle für einen
2) Der Traum ist dann deiner, dein einer, alleine, den keiner vorher geträumt
Firstly, I am confused regarding case, since I'm used to "einer" being used in Dativ or Genitiv, but both examples above seem to be Nominativ.
Secondly, up until now I've known "einer" only as an Unbestimmt Artikel, but here it appears to function like a Substantiv, even though it isn't capitalized.
So what exactly does the word "einer" mean here and how should I use (and decline) it?