If a person prostrates on a very soft mattress where their forehead keeps sinking without finding a stable resistance, the prostration is valid.

Prayer Pillars: Ruku and Sujud