If a Christian denies his faith while being tortured, has he committed apostasy?
Objectively speaking, anyone who totally repudiates the Christian faith has committed apostasy (CCC 2089), which is a grave matter. In this situation, though, the torture could mitigate his ability to choose purposefully. For grave matter to be a mortal sin, it must also include “full knowledge and deliberate consent” to the action (CCC 1857). So, while the person would not have demonstrated the heroic virtue of a Christian martyr, it is possible that he would not be culpable for apostasy.
It is also possible for a person who is facing martyrdom to first deny his faith but later repent and go to his martyrdom, as was the case of St. Joan of Arc, who first tried to save herself from the flames but then repented. Perhaps she might be considered the patron saint of reluctant martyrs.