This paper argues that the socialist episode in East Germany, which constituted a radical experiment in gender equality in the labor market and other instances, has left persistent tracks on gender norms. We focus on one of the most resilient and pervasive gender gaps in modern societies: mathematics. Using the German division as a natural experiment, we show that the underperformance of girls in math is sharply reduced in the regions of the former GDR, in contrast with those of the former FRG. We show that this East-West difference is due to girls' attitudes, confidence and competitiveness in math, and not to other confounding factors, such as the difference in economic conditions or teaching styles across the former political border. We also provide illustrative evidence that the gender gap in math is smaller in European countries that used to be part of the Soviet bloc, as opposed to the rest of Europe. The lesson is twofold: (1) a large part of the pervasive gender gap in math is due to social stereotypes; (2) institutions can durably modify these stereotypes.