Is IVF Haram in Islam

Is IVF with sperm donation or egg donation prohibited in Islam?

You start your assumptions from the wrong perspective and we know that logic says: ex falso quodlibet.

Zina is indeed a sexual relationship derived from marriage.

What you seem to have overlooked now is that if the eggs were fertilized in vitro where the eggs were not from the woman (while the sperm was from the husband), they would be from another woman. This woman is a foreigner of the husband, so any child that would result from this fertilization by Sharia is not the child of the wife, but only the child of the husband. And here we have a big problem: because a child born out of a legal relationship should have the father's name (33: 5 and in the Sunnah), a child born out of an illegal relationship should have the father's name Wife (from Sunnah a clear statement and a somewhat ambiguous one), now the woman who was pregnant with the child is the father's wife (note that the later hadith even says that a child of a married woman has the name of the husband and of course the father of a typical Zina child can accept his paternity and give him his name, but based on the facts above, he would be considered a child from a Zina relationship since the husband's sperm was introduced in the egg of a stranger Mrs. It is not zina between the husband and another woman, but a production of a zina child, which is the main problem here!

Another problem is the fact that this child actually has two mothers, a problem, and one of the aims of Sharia law is to preserve or preserve the ancestry and the whole of what I mentioned (the purity) or shows that the ancestry thing is ambiguous here, which is against Sharia!

Note that even in the event that this woman who donated an egg or egg was another woman of the husband's scholars, this procedure is more likely to be considered haram. While it is perfectly halal if fertilization has been done in a laboratory, as long as the donated eggs and sperm are from the couple.

Here are some sources for the output and naming of children islamqa # 85043 # 33591 and in Arabic see for example islamweb # 6045.

Of course, divorce is the worst solution, but I know many husbands who didn't even think of marrying another woman (to have offspring) and even treated their infertile wife in the best possible way. So one just has to accept the fact that we can have children, only girls or only boys, or Allah can for reasons (HE only knows) deny us the happiness and joy of having children of our own (42: 49-50). Are we not asked to obey Allah and have faith? Perhaps this is our best (2: 216):

... But maybe you hate something and it's good for you; and maybe you love something and it's bad for you. And Allah knows as long as you do not know.

On the other hand, if an adopted child is generally treated the same as their own, they would act more or less the same as their own, so that they either hold onto those people who raised them or cared for them for a long time, or simply would act like any other disobedient child.