An example is the address of the Almighty to Virgin Mary...
An example is the address of the Almighty to Virgin Mary (as) in which He commanded her, when confronted by others who resented the birth of Christ (as), to say: "I have surely vowed [to observe] a fast to the Beneficent God, so I shall not speak to anyone today’ (Holy Qur’an, 19:26).
Muslims have learned from their Lord, the Praised and the Exalted One, that fast is one of the atonement’s for: Shaving the head during the pilgrimage (while one is still wearing the ihram) due to a valid excuse such as sickness or a head injury, The inability to offer sacrifice (i.e., hadith), Killing an ally by mistake, Violating an oath, Hunting while still wearing the ihram, In the case of zihar.
("Your back," an Arab during Jahiliyya may say to his wife, "looks to me like the back of my mother!" Striking such a similitude is called zihar.) Chapter 9 :Forty types of Fast Although the above chapter dealt with the types of fast, we decided to expand this discussion and quote for you from "Bab al-Sawm," chapter dealing with fast, on pp. 52-54, Vol.
2, of Man Ia Yahdunihu al-Faqhi by the nation’s mentor Shaikh Abu Ja’fer Muhammad ibn Ali ibn al-Husain ibn Babawayh al-Qummi al-Saduq who indicates the following: Al-Zuhri (one of the companions of our fourth Imam Ali ibn al-Husain ibn All ibn Abu Talib Zainul-Abidin al-Sajjad, peace be upon him and his posterity as well as progeny) is quoted saying, "Ali ibn al-Husain, peace be upon them, asked me once, ‘Where did you come from, O Zain?’ I said, ‘From the [Prophet’s] mosque.’ ‘What were you discussing?’ he asked me ‘We discussed the fast,’ said I, ‘and we all agreed that the only obligatory fast is the fast of the month of Ramadhan.’ He said to me, ‘O Zuhri!
It is not as you all say. Fast is of forty different types: ten are as obligatory as the fast of the month of Ramadhan; ten are prohibited; fourteen are optional: one may fast during them or he may not; add to that the three different kinds of conditional fast. Add also: disciplinary fast, permissible fast, and the fast making up for one who had to go on a journey or who fell sick.’ Said I, ‘May I be sacrificed for your sake!
Please explain them to me." The Imam (as) stated the following: "Obligatory fast includes the fast of the month of Ramadhan and of two consecutive months for each one day deliberately missed of the month of Ramadhan, and the fast of two consecutive months as an atonement for zihon.