I think what imam ar-razi states in his tafsir on this ayat is really good alhamdulillah, took me time scanning this and editing it so the english isnt too tough (i tend not to use wahabi sources i would like to make that clear!):
Tafsir: Mafatih al-Ghayb, by Imam Fakhr ud-Deen ar-Razi (Cairo Edition), XXII, 25-31
The verse used here: Your wali is only God, his Apostle, and those who believe, who keep up the prayer and pay zakat while they bow (in prayer). Qur’an v. 55.
[order of arrangement is: that God, having forbidden, in the preceding verse, the muwălah of disbelievers, enjoined in this verse the muwalah of those whose muwalah is necessary, when He says: “Your wali is only God and His Messenger and those who believe,” that is, the believers who are described by the qualities. There are (many) problems on the verse:
(I) In His statement “and those who believed.” there are two statements: first, that it is meant for all the Muslims because when ‘Ibădah b. al-Sămit withdrew from the Jews, and said: “I am free from my oath to Qurayazah and al-Nadir (to be devoted) to God and I take God and His Messenger as my wali,” this verse was revealed in agreement with his statement.
It is also related that ‘Abdallăh b. Salăm said: “0 Messenger of God, our people have boycotted us and have sworn not to sit in assembly with us. We are not able to share the assembly of your Companions because of the distance of our abodes.’ so this verse was revealed, and he said: “We are pleased to have God and His Messenger and the believers as our awliya ‘.“ For this reason, the statement is general to all Muslims, and everyone who is a Muslim is a wali of every other Muslim; similar to it is His statement “The Muslims, men and women, are awliya one of the other” (Qur’an ix. 71). Accordingly the statement “those who perform prayer and give alms” is a description for all the believers; and the purpose for the mention of these descriptions is to distinguish the believers from the hypocrites because the latter used to claim to believe whereas they were not persistent in prayers and zakat. To describe their prayer God said “. . . and they come not to prayer save lazily” (Quran ix. 54) and “. . . showing off to people and not remembering God save a little” (Qur’an iv. 142). In describing their zakat God said also “... being *****rdly to possess the good things.” (Qur’an xxxiii. 19). As to the statement “while they bow down,” there are accordingly many views:
(a) Abu Muslim said that ruku’ here means humbleness, that is, they perform prayer and give alms with submission and humility to all the injunctions and prohibitions of God.
(b) That it refers to their position while performing prayer; (the position of) ruku is given special mention here as a distinction as (it is also) In the verse “and bow with those who bow.”
(C) Some of them said: The Companions, when this verse was revealed, were in different positions of these descriptions: there were some of them who had finished with the prayer; there were those who had given money to the poor, and there were those who kept longer in prayer and were in the state of ruku’. Because of these different positions God certainly mentioned all the descriptions.
Secondly, that this verse refers to a specified person: there are accordingly many views:
(a) ‘Ikrimah (his name is Abu Abdallah Ikramah was a mawla of Ibn Abbas; he was one of the principal tabi’un and jurists of Mecca as mentioned in Ibn Kallikan, op. cit, II, 207 f.) related that this verse was revealed concerning Abu Bakr, may God be pleased with him.
(b) ‘Ată’ related from Ibn ‘Abbăs that it was revealed concerning ‘Ali b. Abi Talib. Upon him be peace. It is related ‘Abdallăh b. Sa1am said to the Prophet when the verse was revealed that he saw ‘Ali make a gift of his ring to a beggar while he was in ruku and we were close to him. It is related that Abu Dharr, may God be pleased with him, said that he performed the prayer with the Prophet one day when a beggar begged for charity in the mosque and no one gave him anything; so he raised up his hands to the sky and said: “Be my witness, 0 God, that I begged for charity in the mosque of the Prophet and no gave me anything.” ‘Ali who was in ruku’ stretched out his. Right hand little finger on which there was a ring; then the beggar approached and slipped it; (this happened right) in front the Prophet who (said immediately): “0 God, my brother Moses asked Thee and said: ‘Lord, open my breast... and associate him with me in my task,’ and Thou caused to descend a clear verse (reading) (saying) ‘We will strengthen thy arm by means of thy brother and We shall invest both of you with authority.’ 0 God, I, Muhammad Thy Prophet and sincere friend, to request Thee to open my breast and ease my task: give me a wazir from my family, ‘Ali; by him strengthen my back.” Abu Dharr said: “By God, hardly had the Prophet finished his statement when Gabriel descended and said: ‘0 Muhammad read: Your wali is only God and His Messenger...” These are all that are connected with the narrations in this (first) problem.
(2) The Shi’ah said: This verse indicates that the imam after the Prophet was ‘Ali b. Abi Talib, and to prove it we say:
This verse indicates that what is meant is the imam and since this is so, it necessarily means that that imam should be ‘Ali b. Abi Talib.
The explanation of the first proof (is as follows): The word al-Wali in language comes to mean the helper and the friend “The believers, men and women, are awliya’ one of the otherr”; it means also an administrator (or a guardian); the Prophet said:
“Whichever woman who married without the consent of her wali (guardian).” We, therefore, say that there are two views:
(a) The word wali comes with these two meanings; God did not specify its purport, nor is there any contradiction between the two meanings; it necessitates its being predicated of both of them; so, the verse indicates that the believers referred to in the verse are administrators of the community.
(b) The word wali in this verse cannot mean the helper but the administrator. We say it is not possible to mean helper because the walayah referred to in the verse is not a general one (applicable) to all the believers, the proof being that God mentions in the word innama which is a word for limitation as in the verse “Certainly God is only’ One God.” (Qur’an, iv. 171) The word walayah with the meaning of help is general as (indicated) in the verse “The believers, men and women, are friends one of the other.” This conclusively proves that the walayah mentioned in this verse is not with the meaning of help; and, since it is not with the meaning of help, then it is with the meaning of administration, because there are only these two meanings for wali. The rendering of the verse, therefore, shall be: “The only administrator over you, 0 believers, is God, and His Messenger and the believers with such and such descriptions.” This requires that the believers with the description mentioned in this verse are the administrators over all the community; and there is no other meaning for the imam than one who administers the affairs of the community. Thus the above statements confirm the proof that this verse indicates that the person referred to in it should necessarily be the imam of the community.
The explanation of the second “claim”—that if that which we have mentioned is established it necessarily follows that that person should be ‘Ali b. Abi Talib. There are many points for the proof:
(a) That everyone who establishes by this verse the imamate of a specified person says that that person is ‘Ali. We have previously proved that the verse refers to the imămate of a specified person; that person should, therefore, be ‘Ali, necessarily because no one else differs.
(b) There are narrations (converging on) that this verse was revealed concerning ‘Ali and we cannot go back to the statement of one who refers it to Abü Bakr, because if it were to be, it would have been a proof for his imămate but the community is unanimous that the verse does not indicate his imămate and this disproved that statement.
(c) That the statement “while they bow in prayer” cannot be conjoined to what precedes it, because the prayer, which precedes it, includes (the posture of) rukü’, and to mention ruku again will be repetition. It should, therefore, be treated as a haal, that is, giving zakat while in the position of rukü. There was unanimous opinion that the making of zakăt in that position was true only of ‘Ali; so, that verse is specifically for him, and it indicates his imămate from the point of view of what we have established. This is the sum total of the proofs by the people (that is, the Shi’ites) based on this verse for the imămate of ‘Ali.
The reply to the above claims is as follows:
First, according to Principles of Jurisprudence it is not permissible to predicate an equivocal word of two meanings at the same time; hence, the word wali’ cannot be predicated of an aider and an administrator at the same time.
Secondly, we say: Why is it not possible that the word wali, as used in this verse, should mean the helper or the friend? We shall adduce proof that it is more proper with this meaning than with that of an administrator, then we shall reply to their claims. We say: That which indicates that its being predicated of helper is better (is as follows):
(a) It is only this meaning which agrees with what comes before and after it. The verse “0 ye ‘believers, do not take the Jews and the Christians as your awliyâ” (Qur’an, v. 51) which precedes it does not mean “Do not take the Jews and the Christians as the imams to control your souls and your property.” because the falsity of this is necessarily apparent; rather, it means “Do not take the Jews and the Christians as friends and helpers; do not Intermingle with them nor give them any help.” When He has stressed the prohibition (well enough) He said: “Your wali is only God and His Messenger and the believers” who were described (in the above verse). It is apparent that the enjoined walayah here is what is forbidden previously; since the forbidden walayah carries the meaning of assistance then, the walayah which is enjoined is with the meaning of help which is enjoined. The verse “0 ye who believe, take not as your awliya’ those who take your religion for a mockery and a sport, among those who received the Scripture before you, and among disbelievers, and fear God if you believe” (Qur’an, v. 57), which follows the verse (in question), repeated the warning against taking as awliya’ the Jews and the Christians and the disbelievers.
Undoubtedly, the prohibited walayah is that with the meaning of help. Similarly, the walayah in the verse “Your only wali is God” is necessarily that with the meaning of help. One who treats the verse with justice and leaves aside bias and who ponders over both the preceding and the succeeding verses, will Conclusively know that the wali in the verse “God is your only wali” has no other meaning but that of a helper and a friend and cannot be with the meaning of an imam; otherwise it will result in introducing a strange word in-between two words sharing one (and the same) goal: this is the most unsound and invalid reasoning which must be kept away from the word of God Almighty.
(b) Take for granted that the walayah refers to control and imamate. At the time the verse was revealed none of the believers mentioned therein could be described as having the walayah; even ‘Ali b. Abi Talib was not holding any position of rule in the lifetime of the Prophet. But the verse requires that these believers be described as (being in possession) of the waliyah at that time. (On the other hand), if we were to predicate the walayah of love and help, this walayah was actualisable at that time. It is proved, therefore, that to predicate it of love would be better than of rule. What we said is supported by the fact that God warned the believers against taking as awliyá’ the Jews and the Christians, and then enjoined on them the muwalah of the believers. The muwalah of the believers at the time can certainly be actualised, so that both the order and the prohibition would come to (mean) the same thing. It is, therefore, not possible to predicate walayah of control since this could not be actualised at the time the verse was revealed. (Muhammad Ali provides further arguments on this issue. The Holy Qur’an: Translation and Commentary (Working Surrey, The Islamic Review 1917), p. 269, n. 711).
(c) God mentioned the believers who were described in this verse in the plural form in seven places which are: Those who believe, who perform prayer and (who) give zakat while they bow. If it is possible to predicate the plural word of a singular object by way of respect, it is majazan (metaphorically) and not haqiqatan (the original meaning appointed for it). The principle is to predicate the statement of the haqiqah.
(d) We have already proved with clear proofs that the preceding verse “0 ye who believe, if any from among you turn back from his faith . . .”(to the end of the verse) (Qur’an v. 54) is one of the strongest proofs for the soundness of the imămate of Abü Bakr. If this verse (in question) were to indicate the propriety of the imămate of ‘Alo after the Prophet, then there will necessarily be a contradiction between the two verses; and this is false. It is, therefore, conclusive that there is not in the verse any indication that ‘Ali is the imam after the Prophet.
(e) That ‘Ali b. Abi Talib knew the Qur’ăn more than these fanatics. If the verse had indicated his imămate, he would have argued with it in one of the assemblies. There is no point in the people saying that he refrained from it because be was practising taqiyyah 1 for they related from him that he held out (that is, he based his claim to the Imamate) on the day of consultations, on the report of al-Ghadir 2, the Mubahalah 3, all his excellences, and his virtues; but he did not make a claim on this verse to establish his imămate. This conclusively rules out the statements of these fanatics. May God curse them!
(f) Assuming that the verse indicates the imămate of ‘Ali, even though we have concluded that at the time the verse was revealed it did not indicate that the imămate was actualisable, and ‘Ali was not holding a position of authority in the community in the lifetime of the Prophet; then the only probability is that it indicates that ‘Ali would become an imam some time later. If they were to say this, then we would say in reply that we predicate it of his becoming imam after Abü Bakr, ‘Umar and ‘Uthman, since there is nothing in the verse which indicates a specified time. If they say that the community divided into two on this verse: one said that it did not indicate the imărnate of ‘Ali; and the other said that it did, and even immediately after the Prophet; the statement that the verse indicates the imâmate of ‘Ali was not on this view; it is a third statement which is void because we would say in reply to it:
“one who told you that no one among the community made this statement, even though it is probable, yet it is apparent that anyone, who examines the claim of the Imămate of ‘Ali through this verse, would come to the proof of these problems, then the mention of this probability and this problem go together with the mention of the proof.
(g) That the statement “Your wali is only God and His Messenger” is undoubtedly an address to the people (in general), who certainly knew that only God and His Messenger had control of their affairs. That statement was made by God only to gladden the believers, and with a view to making them know that they had no need of taking close friends and helpers from among the unbelievers, for whoever had God and His Messenger as helpers and supporters, what further need had he to seeking assistance and love from Jews and Christian? Therefore, the purport of the statement “Your only wali is God and His Messenger” is that the walayah is with the meaning of help and love. The word wali was no doubt mentioned only once. Since the meaning of it here refers to assistance, the (other) meaning of “rule” drops out because it has been established that it is not permissible to predicate an equivocal word of two meanings at the same time.
(h) in the preceding verse “He loves them and they love Him, humble towards the believers, disdainful towards the unbelievers” (Qur’an v. 54) God praises the believers and when that is related to the statement “Your wali is God only and His Messenger” with the meaning of love and assistance, the latter statement makes sense with the former; similarly, the statement “Men who struggle in the path of God” (Qur’an v. 54) makes sense with the statement “Men who perform prayer and give alms while bowing.” This verse is based on what precedes it stressing its meaning; that is more proper. This view proves that the walayah referred to in the verse should be with the meaning of assistance and not of control.
As to the point which they relied upon, that the walayah referred to in the verse is not general whereas the walayah with the meaning of assistance is general, the reply comes in two points as follows:
(a) We do not agree that the walayah referred to is not general, nor do we accept that the word “innama” is meant for limitation; the proof for it is His statement: “Certainly likeness of this present life is as water which we send down out of heaven.” (Qur’an x. 24) This present life has other similarities than this (of rain). “This present life is only a sport and a diversion.” There no doubt that sport and diversion may sometimes be actualised without it.
(b) We do not agree that the walayah with the meaning of assistance is general to all believers: Its explanation is that God divides the believers into two groups: those for whom leaders are appointed and to whom He addressed “Your wali is only God,” and the saints (the awliyă’ of God); they are the believers who perform prayer and give zakăt while they bow. When the waläyah here is explained in term of assistance, the meaning will be that God made the group helpers one to another. The assistance of the second group is not actualised in all the believers.Even is it were, there is necessarily in the division those that are made to help themselves; this is impossible. It is proved, therefore, that the assistance of one of the two groups of the Muslims is not applicable to all the Muslims, but is specific to the second group of the community. Nothing necessitates, therefore that the walayah in the verse cannot be with the meaning of assistance; this is an answer, good enough for anyone who ponders over it.
The arguments that this verse was revealed concerning ‘Ali is not acceptable. We have explained that most of the exegetes have asserted that it is revealed concerning the community and what is meant by it is that God ordered that the Muslims should take as friends and helpers only the Muslims; some of them (exegetes) say that it is revealed concerning Abu Bakr.
As to their argument that the verse specifically refers to him who Made zakat while he was in the position of ruku’, and who was ‘Ali, we say also that this argument is weak for many reasons:
(a) The word zakah is name for an obligatory duty—wajib—and not for a voluntary one—mandüb 4 according to the verse
“And give zakat” (Qur’an ii. 43) If he were to give the obligatory zakat while he was in the position of rukü’, he must have delayed performance of that duty out of its time, and that, in the opinion of most learned men, is a sin which ought not be related to ‘Ali. To predicate zakat of voluntary charity is contrary to the origin of it as we have explained that the statement “And pay ‘zakat” in its apparent meaning indicates that whatever is referred to as zakat is obligatory.
(b) What befits ‘Ali is that he should be deeply absorbed in the praise of God while in prayer; and it is obvious that anyone’ who is as such cannot be disengaged as to listen to the statement made by someone else, much less to understanding it. This is why God says “Men who remember God, standing and sitting and on their side and reflect upon the creation of the heavens and the earth.” (Qur’an iii. 90) How can one who is deeply absorbed in thoughts afford to listen to the statement made by someone else?
(c) Pushing a finger-ring out to a beggar during prayer entails much action. What befits ‘Ali is that he would not do such a thing.
(d) It is well known that ‘Ali was poor and had not money on which, zakat was due. Thus, they say, concerning that, for his making zakat of three loafs of bread, there was revealed the Sürah Hal Ata (chapter lxxvi.). This is so because he was poor. And even one who had enough money to pay the zakát was not allowed to obtain such great praise, mentioned in the sürah for making zakat of three loafs of bread. Since he had not enough money on which zakăt was due, it is not possible to predicate of him the statement “and gave zakat while in the position of ruku”.
(e) Assuming that this verse refers to ‘Ali yet the proof with the verse cannot be complete except that the meaning of wali is complete (agreed upon) to be that of administrator and not of helper and friend. We have discussed this above.
(3) Those who say that the verse “and those who gave zakat ‘ bowing” means they gave zakah while in the position of ruku, argued, basing it on the verse, that little action (during prayer) does not render the prayer invalid; for he gave the zakät ‘the beggar while in prayer. He must have had an intention for making a gift even though he was on prayer; that indicates t such actions does not invalidate the prayer.
There are two other questions to be dealt with, namely:
(a) Mentioned in the verse are God, His Apostle, and the believers. Why is the word awliya’ not used? The answer is that the origin of the statement is “Your wali is only God”; this places the walayah for God by way of clarity and, then, it is adjusted to establish same for the Messenger of God and the believers in succession. Even if it were to be rendered “your awliyah’ are God and His Messenger and those who believe.” it would not be possible to render to the statement a sense of origin and succescion. ‘Abdallăh reads it as “Innamă mawlakum”.
(b) What is the position of “al-ladhina yuqimuna”? The answer is: the nominative case renders it in apposition to “those who believe,” or it may be said that the supposition is: They are those who perform (prayers); or, in the accusative case which makes it (in apposition to) praise. The purpose for its mention is to distinguish a sincere believer from one who only claims belief whereas he is a hypocrite. That sincerity can be recognised only by being persistent on prayer in the position of ruku’, that is in a state of humbleness and submission and modesty before God.]
1. The word by itself means “caution.” “fear.” but “disguise” in its technical term; It is a term for dispensation from the requirements of religion under compulsion or threat of injury. The Prophet ‘was said to have practised a form of taqiyyah when he immigrated for his life’s safety to Medina; he also allowed it in eating forbidden foods under circumstances (Qur’an iv, 119; v, 5). and also in the denial of the faith as it is the case of ‘Ammar b. Yasir who was worried about his forced worship of Idos. and objurgating of the Prophet and about which the verse “If anyone after accepting faith in God, under compulsion, professed unbelief with his tongue while his heart remains firm in faith, no blame falls on him” (Qur’an. xvi. 108). (Tabari, Tafsir al.Qur’an [BuIaq. 1328/1910], XIV, 121 f.; cf. Muhammad ‘Ali, The Holy Qur’an, p. 3556, n. 1402).
The taqiyyah is of special significance for the Shi’ah; It is considered their distinguishing feature. The peculiar fate of the Shi’ah—that of a suppressed minority with occasional open, not always un-heroic, rebellions— makes them practise even extreme taqiyyah. The Ismailites usually disguise their creed. The Twelver’s, in particular, while representing the imams as examples, compelling one to resoluteness, appeal on the other hand to the conduct of ‘Ali during the reign of the first three Caliphs and the ghaybah of the Mahdi., the twelfth imam as the typical taqiyyah. ‘Ali was said to have feigned allegiance to the three caliphs while disguising his hatred for them as usurpers, for the safety of his life. In Shi’ah biographies concealment is a regular feature. Among the Sunnite authorities, the question of taqiyyah was not such a burning one. Cf. R. Strothmann, “Takiya,” Encyclopaedia of Islam, IV, 2. 626 f.
2. hadeeth of ghadeer al khuam, It may be added here that the Prophet once said to an assembly of his Companions that ‘Ali was mawla of all those of whom he was a mawla. This term has several meanings; the Shi’ah’s interpret it as meaning a wali, but this has been questioned by Sunni scholars. shaykh ‘Abd al-Haqq has discussed this problem in some detail and stated on the authority of Ibn Hajar that ‘here it means one who is loved’.’ Ref: See Madarij al-Nubuwat (Urdu Tr., Karachi, 1970), Vol. 2 pg 678-83)
3.The story of the mubahalah (swearing an oath) centres round the verse “say : Come, let us gather together our sons and your sons, our women and your women, ourselves and yourselves, then, let us earnestly pray and invoke the curse of God on those who lie” (Qur’an, iii. 60). The story, in brief, goes as follows: “When Muhammad sent letters to the kings of Rum, Persia, etc.. summoning them to embrace Islam, the Christians of Najran in South Arabia assembled in their church to decide what they aught to do. After various proposals had been made as to whether they should fight or yield or become Muslims, someone arose and quoted Jesus’s words to Simon Peter promising to send Abmad the Far’qali (the Parakletos, the Comforter), whose son should conquer the world. But it was replied that Muhammad had no offspring, and so this could not refer to him. Then they brought out the book of Jami’ and read from the story of Adam, how Adam once saw a brilliant light with four other lights about it, and was told by Allah that these lights were five of his descendants who would succeed him. Ibrahim also saw a similar vision, and the same thing was predicted by Moses and Jesus.
So it was decided to send all their princes and doctors to Medina to see whether Muhammad was the one whom Jesus had predicted. Accordingly they entered Medina in great pomp, found Muhammad in the Mosque, and debated the question of the person of Christ with him. At last, unable to convince one another, they proposed to him that they refer the matter to Allah, and call down His curse on whoever lied. Then the verse was revealed. Muhammad agreed, and the contest was set for the following day. The Christians said to one another: “If Muhammad comes out with royal pomp, then we shall conquer, for he is only an earthly ruler; but if he comes out with only a few godly people, then he is a prophet and will prevail.”
The next day the Christian leaders came forward with their sons and wives. All the people of Medina came out with banners waving to witness the conflict, Late In the morning Muhammad came forth with only the holy Family, AIi, Fatimah, Hasan and Husayn’—and took his place with them under a cloak hung between two small trees The Christian, asked why he brought out those people and not the chief men of his religion. He replied that Allah had so commanded. Then the Christians remembering that they had read in the Jami’, turned pale and retired, fearing to make the trial, for they recognised Muhammad as the Prophet whom Jesus had Predicted” (‘Allamah al-Hilli, Bab al-hadi ‘ashar, tr, W.M. Miller London. Luzac & Co, 1958], pp. 99 f. a, (b) par. 193).
For a fuller account of the incident referred to above see Muila ‘Muhammad Majlisi, Hayat al-qulub, trans. James L. Merrick (Boston, Phillips, Samson & Co. 1850) chap xviii. The Shi’ah attached great importance to this incident, not only as proving the Prophetic mission of the Prophet, but also because it establishes their doctrine of imamate and the ‘Ali, Fatimah, Hasan and Husayn, next to the Prophet, were the most exalted of mankind.
4. There are five established rules in relation to an act; these are known as al-ahkam al-khamsiyyah and are: (i) where the act is obligatory, that is the leaving it undone is forbidden, it is called wajib; (ii) where the doing of it is absolutely forbidden, it is haram; (iii) where doing it is preferable although there is no sin in leaving it undone, it is mandub; (iv) where not doing it is preferable, although there is no sin in doing it, it is makruh; (v) where doing and not doing are equal, it is called mubaha.