I updated my MacBook Pro from Mac OS X El Capitan (El Capitan, 10.11) to macOS Sierra (Sierra, 10.12), connected a 4K external display (clamshell mode), and now the resolution is “3840x2160”. By the way, the connected display is “iiyama 4K Ultra HD (ProLite B2888UHSU)”.

Change resolution of 4K display (like 2560x1440)

3360 x 1890 3200 x 1800 3008 x 1692 2560 x 1440 2204 x 1206