Note
都市 is more generic than 市 and refers to the concept of a city as a populated and developed area. It doesn't necessarily imply a political or administrative boundary like 市 does. The term 都市 is more comparable to the English use of urban area or metropolis.
Breakdown of toshi
city
市
metropolis
都
If someone is surrounded by walls no matter whether they're inside or outside, they must be in a metropolis.
Usages of toshi
その 都 の は です。

