Re: "...it happens a lot earier than college"
"This is then reinforced at school - teachers offering different praise to girls than boys"
Or just offering flat-out bigotry. When I was in grade school (primary school, elementary school), the teachers were very clear that only boys were supposed to be good at math. Luckily, I hated that school and thus felt no need to conform to their expectations.
(The teachers were equally clear that only girls were supposed to be good at spelling and composition, with equally predictable results.)