Generally, rooting a phone is complicated and voids the warranty, but it is not the case if you own a Xiaomi device.
How to root the Xiaomi Mi 4
First, go to this thread at the MIUI Vietnam Forums and download the zip file. (from post #22)
Copy it to the main folder of the Mi 4.
Open the Updater App, and tap on the menu.
Choose the option which says “Update package to install”, and select the file you downloaded
Once the process is done, you will be prompted to reboot the phone.
How to enable Root access on the Xiaomi Mi 4
Once you have completed the above steps, open the Security app, and navigate to Permissions > Root Access.
You will be able to enable root for any apps which are listed at this screen.
Tested with the Global Stable ROM MIUI v184.108.40.206 (KXDMICF).
Updated for the MIUI v220.127.116.11 (KXDMICF) Global Stable ROM