How to be a Great mathematician in prison/without a master? Is it possible to be a great mathematician in our home with a laptop+poor internet+electronic books+some books+a little food +a little money or not? without having a constant job
without studying P.H.D or going to university or having a good master or traveling to other countries , in real life? i mean the life with all of it's problems?
it's not the whole problem: you don't have to be necessarily a person like "Sir Andrew Wiles" in a short time like 5 years studying. i mean consider a person who is not beginner in math. consider a normal person in Kabul university with Ms.c degree with some experience in math and who wanted to dominate in the book "Advanced topics in the arithmetic of elliptic curves" or "Robin Hartshorne's algebraic geometry" witch are very tough books for his level and he doesn't want to continue P.H.D degree in his/her town or any other countries and he works in a shop, but he has 1-2 hours per day to study one of this books and he expect to realize whole book after 15 months in average and after one year later give an article in "Inven Math" journal!.is it possible?
let me ask in another way: from 0 to 100% give me a distribution of effect of environment V.S personal will to be great superstar mathematician?
is it possible to have a fields medalist from nigeria? chad? syria? yeman? afghanistan?    
(of course he has access to Mathoverflow! -:)))))
if yes, i call him/her a great mathematician
 A: The answer to the title question might well be "yes":
At the start of WWII, the French mathematician André Weil, a pacifist, was charged with failure to report for military duty, and was imprisoned in Le Havre and then Rouen. During his prison time he proved the Riemann hypothesis for curves over finite fields. The letter he wrote from prison to his sister on his research is printed in translation in A 1940 Letter of André Weil on Analogy in Mathematics. Weil describes how he could do math in prison in his autobiography: "Life is a composite of trivial details: perhaps this becomes clearer in prison than anywhere else. [...] I am thrilled by the beauty of my theorems."
A: wasn't there Leray ? i have it oversimplified to: he was in jail when he discovered sheaves. Wikipedia has more detail:
https://en.m.wikipedia.org/wiki/Jean_Leray

From 1938 to 1939 he was professor at the University of Nancy. He did not join the Bourbaki group, although he was close with its founders.
His main work in topology was carried out while he was in a prisoner of war camp in Edelbach, Austria from 1940 to 1945. He concealed his expertise on differential equations, fearing that its connections with applied mathematics could lead him to be asked to do war work.

the French version says he made a school (University) for prisoners. Faisceau is the french word for "sheaf" that's why it's written $\mathcal{F}$. Autriche is Austria.
https://fr.m.wikipedia.org/wiki/Jean_Leray

Il passe sa jeunesse à Nantes et à Rennes, puis fait ses études à l'École normale supérieure et devient professeur à Nancy en 1936. Il effectue ses principaux travaux en topologie entre 1940 et 1945 alors qu'il est prisonnier de guerre en Autriche. Il organise dans le camp à Edelbach une université pour les prisonniers. Il introduit les idées radicalement nouvelles et très fécondes de suite spectrale et de faisceau

In all fairness, he had his PhD already and then went to prison because of the War.  I notice his study of sheaves and spectral sequences are not part of algerbaic geometey or algebraic topology as we know it. He was studying the Navier Stokes partial differential equations. 
A: Poncelet created the field of projective geometry while imprisoned by the Russians. I remember reading in an article I think by David Rowe that this particular historical contingency should give pause to anyone who things mathematical history follows a predetermined course, but I can't find it right now.
