PSN is linked to both the PS3 and PS4. So whatever games you buy through the PSN Store will be available for you whether you login on your PS3 or PS4 if the game was originally intended for PS3.
I'm not exactly sure how specific it'll work, but the overall understanding I have is:
So if you a digital game that was originally for PS3, PS4 will be able to play it for you digitally. But if you get a digital game that is made for the PS4, then it'll only be exclusive for PS4 and not the PS3. So it'll only work one way. So PS3 games can go up, but PS4 games cannot go down.