Questions & Answers about Za miastem lubię spacerować po lesie.
Because za can take different cases depending on the meaning.
In this sentence, za miastem means outside the city / beyond the city, describing a location, not motion toward a destination. When za expresses location here, Polish uses the instrumental case.
- miasto = city
- miastem = instrumental singular of miasto
Compare:
- Jestem za miastem. = I am outside the city.
- Jadę za miasto. = I am going outside the city.
So za miastem fits because the sentence is about where the walking happens, not about going there.
Miastem is the instrumental singular form of miasto.
The basic form is:
- miasto = city
After the preposition za in the sense of behind/beyond/outside when talking about location, Polish uses the instrumental, so:
- za miastem = outside the city / beyond the city
This kind of case change is very normal in Polish. Prepositions often force a specific case.