How is free-will formally defined as distinct from determinism, randomness and determinism-randomness hybrid to support moral responsibility? Usually free-will is assumed by most faith traditions as a prerequisite for moral responsibility in order to justify eternal punishment. The argument goes as "you are truly responsible for your immoral deeds because you were perfectly capable of acting morally, but chose not to, and therefore you are guilty and deserve punishment". In other words, there is an assumption of a self capable of having chosen otherwise. But this definition sounds kind of handwavy to me. What do they really mean by "capable of having chosen otherwise"? Does this mean that if we somehow go back in time and press the "univere's play button" again, a different decision would have come out of the same self? But how would that be different from randomness?

I would appreciate a formal (hopefully, mathematical if you can) definition of free-will that clearly differentiates it from determinism, randomness and any kind of determinism-randomness hybrid. Furthermore, I would love to read a logical discussion of how the formal definition provided would support the existence of true moral responsibility. Let me explain why. If the only options available were determinism, randomness and determinism-randomness hybrid, I cannot see any hope for true moral responsibility:


Determinism: your actions, either moral or immoral, are just the ripple effect of past events, you cannot help but do what the laws of Physics make you do, you had no choice, it's not your fault, therefore there is no true moral responsibility on your part.
Randomness: your actions are random, chaotic, there is no control, you are lucky/unlucky that you behave morally/immorally by random chance (e.g. because of weird quantum randomness in the brain, for example). In other words, it's just a matter of luck, a matter of winning the morality lottery. If you behave immorally, it's not really your fault, it's just your bad luck. Therefore there is no true moral responsibility on your part either.
Determinism-Randomness Hybrid: your actions are the result of a combination of deterministic rules applied to past events combined with random quantum noise or something along those lines. Depending on how strong are the causal ripple effects from past events and how strong are the random noises altering them, you end up acting either morally or immorally. In part you are unlucky, in part you have no choice. Anyway, it's not your fault. Therefore there is no true moral responsibility on your part either.


So, somehow, free-will is supposed to have a mysterious formal definition that distinguishes it from determinism, randomness and determinism-randomness hybrid that allows for true moral responsibility in a way that these other concepts can't. I would really appreciate such a formal definition.
Julian Baggini has written a book called Freedom Regained: the Possibility of Free Will. In it the idea emerges that Philosophers working on free will and moral responsibility proceed almost exclusively by appealing to intuitions.
Richard Oerton in his book The Nonsense of Free Will gives, I think, a good,
not-too-technical-for-the-average-reader discussion of the incoherence of the
free will idea.  When something is essentially illogical it means that the sort of formal mathematical definition you seek is actually impossible.  That's the thing about free will, it is free of formal definition.  If we could define it it would not be free. It just fills a gap people want to fill. The human will is not free of how God made it or why God made it. We are free to be ourselves but not free to be anything else. We make choices based on who we are. Who we are depends upon how we were made. Nothing has ever made itself. All our choices depend on how we were made. Free will needs a gap between what we are and how we behave. This gap does not exist.