Ottoman is besieged, has 4 regulars in fortifications, sends in Mehmed with 7 units as a relief force. In the ensuing battle, the Ottoman fights will all units in the space including those in fortification, takes 7 hits. Per rules 15.2 third bullet:
"If the active player loses the battle and the number of hits he scored was less than his opponent, only units that started the impulse inside the fortification may retreat back inside. All other attacking units retreat as per Section 14.1. If all attacking units in the relief force were eliminated, any attacking army leaders in the relief force are captured and there is no retreat."
Must the 7 hits scored against the Ottoman be taken against the 7 unit relief force?
We played that the maximun cap to the units that can retreat into the fortifications is equal to the uits that started into it, in your example 4, so you have to choose to leave only 3 units in the fort or lose Mehmed.