Is f/4 always f/4, even on a Different Sensor Size?
Short Answer:
Yes and No.
Long Answer:
What is "f/4"?
A typical camera lens has a variable size, roughly circular, hole called the "Aperture". When the Aperture is wider, more light is let in. When the Aperture is smaller, less light is let in.
The notation "f/4" means that the diameter of the Aperture hole is the focal length ("f") divided by 4. On a 50mm lens f/4 is a 12.5mm Aperture diameter. On a 100mm lens, f/4 is a 25mm Aperture Diameter.
This notation is often called the "f/stop" or the "relative aperture".
Why We Use Relative Aperture
The reason photographers use relative Aperture is because at the same relative aperture, you get the same light per unit area on the film/sensor, independent of focal length.
If you swap out your 50mm lens with a 100mm lens, but keep the same aperture diameter, you will end up 1/4 the light per unit area hitting your sensor. If you were shooting film, this would be a problem, as you pretty much need to hit the same exposure, no matter what lens you have mounted. However, if you keep the same relative aperture, you maintain the same exposure.
Replace your 50mm 12.5mm diameter aperture lens with a 100mm 25mm aperture diameter lens, and the light per unit area remains the same. Note that a 50mm lens with a 12.5mm Aperture has the same relative aperture (f/4) as a 100mm lens with a 25mm Aperture.
Keeping the same exposure for every shot on a roll is extraordinarily helpful when shooting film.
Implementation Details vs. Results
Focal lengths, sensor sizes, light per unit area, are all implementation details. They are steps along the path to creating our final image. As with many journeys, there is more than one reasonable path to the destination.
At the same Angle of View, same subject, same Aperture Diameter, and same shutter speed, you get essentially the same results (same framing, same motion blur, same Depth of Field, same diffraction blurring, and same overall image noise). The choice of focal length, aperture diameter and sensor size are implementation details along the path.
Many photographers care more about the results than the implementation details.
Consider a full frame camera and a 2X crop body. The full frame has a 50mm lens at f/4, and the crop body has a 25mm lens. Both combinations result in the same 46° Angle of View. Assume the same subject and shutter speed for both cameras.
In terms of implementation details, if the crop body lens is also set to f/4, we get the same light per unit area on the sensor (this would be critical if we were shooting film). From that implementation detail perspective, f/4 on the full frame is the same as f/4 on the crop body.
On the other hand, the f/4 crop body image will have deeper depth of field, more diffraction, and more image noise. In terms of the results, f/4 on a full frame yields a different result than f/4 on a 2X crop body.
Now, if we were to set the 25mm lens on the crop body to f/2, we get four times the light per unit area on the sensor (which happens to have 1/4 the area). If we were shooting film, this would be a problem. If we are shooting digital, we can reduce the ISO setting by two stops to compensate.
By opening up to f/2, the 25mm crop body lens has the same 12.5mm Aperture diameter as the 50mm f/4 lens on the full frame. They also have the same Angle of View. This means the resulting images will have the same Depth of Field, same overall image noise, same framing, same diffraction issues, etc. In other words, you will get essentially the same image from a full frame 50mm f/4, as a 2X crop body with a 25mm f/2. From the perspective of the results, f/2 on a 2X crop body, has an "equivalent f/stop" of f/4.
It's equivalent in the same way as a 25mm lens on a 2X crop has an equivalent focal length of 50mm. The 25mm lens is still a 25mm lens, but the results match what you would expect from a full frame with a 50mm lens. Put a 25mm f/2 on a 2X crop body, and it is still f/2, but the results match what you would expect from f/4 on a full frame.
Conclusion
So is f/4 always f/4? The answer is "Yes, but the results won't be what you would get from f/4 on a full frame".