4 and 5.1 will mix happily, or they do anyway in my mountain bike which says "DOT 5.1 or 4 only" on the master cylinder.
dont use other grades of fluids as they wont mix or can have unwanted effects on your system for example DOT 5 is a completley different fluid to 4 or 5.1 and shouldn't be mixed with anything else.
here's a brief explanation i found;
Boiling point
Brake fluid is subjected to very high temperatures, especially in the wheel cylinders of drum brakes and disk brake calipers. It must have a high boiling point to avoid vaporizing in the lines. This vaporization is a problem because vapor is compressible and negates hydraulic fluid transfer of braking force.
Quality standards refer to a brake fluid's "dry" and "wet" boiling points. Often times, a car will become flooded with brake fluid. Wet boiling point, which is usually much lower (although above most normal service temperatures), refers to the fluid's boiling point after absorbing a certain amount of moisture. This is several (single digit) percent, varying from formulation to formulation. Glycol-ether/dot three/dot four/dot five point one brake fluids are hygroscopic (water absorbing), which means they absorb moisture from the atmosphere under normal humidity levels. Non-hygroscopic fluids (e.g. silicone/DOT 5-based formulations), are hydrophobic, and can maintain an acceptable boiling point over the fluid's service life, although at the cost of potential phase separation/water pooling and freezing/boiling in the system over time - the main reason single phase hygroscopic fluids are used.
Boiling points for common braking fluids [1]
Dry boiling point Wet boiling point
DOT 3 205 °C (401 °F) 140 °C (284 °F)
DOT 4 230 °C (446 °F) 155 °C (311 °F)
DOT 5 260 °C (500 °F) 180 °C (356 °F)
DOT 5.1 270 °C (518 °F) 190 °C (374 °F)
Wet boiling point defined as 3.7% water by volume.