*This is not a community diary or a safe space. I am willing to engage conflicting opinions and evidence in the comments, even when expressed insensitively. Please only HR comments that are off-topic, deliberately inflammatory, or personal attacks.*
LGBT advocates are often accused of being anti-science. It's claimed that we operate from a 'faith-based' position in which individual experience is granted precedence over objective reality and scientific facts.
Since I am a science student and active researcher, the son of a professional scientist, and an activist for science education and science in public policy, this accusation cuts deeply for me in particular. There are many other LGBT people working in scientific fields who probably feel similarly.
I am not a biologist or psychologist or formally educated in either field. But over the years of coming to accept myself as trans, I took an active interest in the science of sexuality and sexual development because it bothered me that the things I could not help believing about myself clashed with what I had been taught about biological reality. When I was young, I dismissed my male identity as some sort of crazy delusion because it didn't match with what I knew about the world. So I can understand where those of who who think trans activism is anti-science are coming from; I was there once.
However, over the years I've spent more time reading the relevant science and come to the conclusion that the world is a lot more complicated than what we are taught in high school biology. Human development is a sequence of extremely complicated, time-sensitive interactions between genes and the environment, where things can (and do) often go differently than predicted. I'd like to share what I know about the details of human sexual development and why "XY = male, XX = female" is not a simple scientific fact.
1: Life Begins at Erection
Or actually, a few months before. Spermatozoa form in the testes of the father of the person-to-be. Every sperm contains half of the genetic material in its father's DNA, more or less, carried on the standard 23 chromosomes, more or less, but sometimes something goes wrong in the meiosis process and one little spermatid ends up with an extra chromosome, or part of one, while its partner is short one, or part of one. And other oddities can happen, such as abnormal chromosomal crossover, wherein chromosomes can end up with genes they wouldn't normally have by exchanging material with chromosomes they're not supposed to.
A similar-ish process happens in the mother's ovaries, with the same potential for mistakes.
Now, most viable embryos will end up with the standard 23 pairs of chromosomes. But some don't, in which case if the embryo is viable you may end up with a case of trisomy or monosomy. And others get the standard 23 pairs but with unusual arrangements of genes, in which case you might get other genetic anomalies. Most of these aren't of particular concern for sexual development specifically; however, anything that happens to the 23rd pair of chromosomes has potential implications for the person-to-be's sex. Of particular interest are things like trisomy-23 and chromosomal crossover between the X and Y chromosomes.
2: The SRY Factor
The SRY gene is probably the closest thing there is to a black-and-white dividing line between males and females. If you have a functioning copy of it, you get testes. If you don't, you don't. Y chromosomes usually have a copy of the gene; X chromosomes usually do not. However, abnormal chromosomal crossover events sometimes cause the father's SRY gene to end up on an X chromosome, so there are X chromosomes that have it, and correspondingly, Y chromosomes that do not.
Therefore, a fetus with an XY, XXY, or XXXY karyotype will usually develop testes, whereas a fetus with an X, XX or XXX karyotype will usually not. However, there are documented exceptions for most if not all of those karyotypes: XX people with testes, XY people without, and so forth. Gonadal differentiation is predicted by the presence or absence of the SRY gene itself, not by the Y chromosome that usually carries it.
There are complications here as well, as evidenced by this study of a fertile 46,XY woman with a normal SRY gene. There are also instances of otherwise normal XY embryos failing to develop gonads. But these are much rarer than the other unusual genetic stuff.
3: It's All About the Hormones
So now we have an embryo with differentiated gonads. It's important to note here that the only thing that's sex-differentiated at this point is the gonads. Other sexually-dimorphic structures, including the brain and the genitalia, are still undifferentiated at this point. These structures are masculinized in male children not by the embryo's genes, but by hormones. So it is hormones, not genes, that are in fact responsible for the features that are socially and culturally relevant to sex and gender.
The genitalia go first. In most cases, if an embryo has testes, they will secrete androgens, including testosterone and anti-Müllerian hormone. Anti-Müllerian hormone prevents the development of the female reproductive system from the Müllerian ducts; testosterone is metabolized into dihydrotestosterone (DHT), which causes masculinization of the genitalia and growth of the male reproductive system from the Wolffian ducts. In the absence of these hormones, the female reproductive system and genitalia develop.
Tons of unpredictable stuff can happen here. If the embryo is not sensitive to androgens, masculinization may completely or partially fail to occur. If it lacks the receptor for anti-Mullerian hormone, the female reproductive organs may continue to develop. If the adrenal gland malfunctions, it may secrete additional androgens that cause the genitals to masculinize partly or completely. And if the embryo is exposed to exogenous hormones, especially progestins or androgens, or even some other chemicals that affect the endocrine system between about the 8th and 12th weeks of gestation, it may develop partially or fully-masculinized genitalia even in the absence of testes.
The end result is that some SRY-negative embryos with ovaries develop a penis, some SRY-positive embryos with testes develop a uterus and vagina, and many more wind up with ambiguous or intersex genitalia.
4: The Brain
The mammalian brain is a sexually-dimorphic structure. Because brains are complicated and difficult to study, it's harder to sex a person by their brain than by their genitalia, but the brain plays a central role in people's personality, sense of identity, sexual attraction,and subjective perception of their body and their social role, so it's important to understand that it is sexually-dimorphic. Brain development continues well into adulthood, but like other structures, it is most sensitive to certain triggers at certain times.
Normally, a fetus with testes will secrete testosterone, which crosses the blood-brain barrier. Testosterone may masculinize some brain structures directly, and is also metabolized to estrogen which masculinizes other brain structures.
A fetus without testes normally has very low levels of sex hormones in its blood, so the brain is not masculinized.
But like with all the other structures, unpredictable things happen. Exposure to testosterone late in gestation causes masculinization of behaviour in primates. Exposure to estrogen even shortly after birth causes brain masculinization which in mice is sufficient to suppress ovulatory cycles.
On the other side, certain exogenous substances can prevent masculinization of certain brain structures. Androgen insensitivity generally prevents brain masculinization, although there are reports of people with CAIS who have male gender identities, possibly due to brain masculinization from testosterone metabolites or exogenous estrogen.
There are other complexities. Not all fetuses exposed to sex hormones develop male gender identities or masculinized brains. It seems that in most female fetuses, a protein called alpha-fetoprotein defends the brain against masculinization even in situations where testosterone is present (for instance, in multiple pregnancies). It is possible that unusual levels of this protein (low in SRY-negative fetuses, high in SRY-positive fetuses) may cause unusual patterns of brain masculinization.
Masculinization of the brain is implicated strongly in the development of gender identity during childhood. Humans with ovaries who are known to have been exposed to elevated levels of testosterone in utero are significantly more likely to develop a male gender identity than other ovary-having humans, although it is impossible to control for the exact timing of elevated testosterone levels. Pre-treatment FTM transsexuals show male-typical patterns of white matter distribution in the brain, probably due to sex hormone exposure. A similar study which I can't find showed that pre-treatment MTF transsexuals had white matter patterns intermediate between typical male and female distributions.
It seems that different structures of the brain are masculinized at different times, possibly through different mechanisms. For instance, while gender identity and sexual orientation are closely-correlated, a significant fraction of male-identified people are androphilic (attracted to men) and a significant number of female-identified people are gynophilic (attracted to women). This is true for all genital configurations.
5. Why it Matters
So you accept that there are a vast array of ways to end up with a brain that's typically male, female, or intermediate between the two. You know that a fetus can get any type of brain with almost any combination of sex chromosomes, gonad type, or genital configuration. Why should you care? It's much easier, as a person who values science, to draw the dividing line between men and women at some structure that differentiates earlier, that's more amenable to objective measurement, that's not as messy and fuzzy, that doesn't require you to wait until the subject is old enough to be asked and doesn't rely on their subjective perception of themselves.
But you should care, because in the end, it's the brain that determines who a person is. Their body might affect their experiences, how they're treated, who finds them sexually attractive - but it's their brain that determines who they are. A person who has female genitalia and a male brain is male. He's just as male as someone who arrived at his male brain by a more traditional route. And the reverse is also true.
A trans person is not lying to you when they tell you their gender. They are not hiding a past as the opposite sex. They never changed genders or sexes; they are who they have always been, at least since they were born. They cannot change sex, because they are, as a person, the sex they were born - the sex they identify as. Just like everyone else. And there's nothing anti-science about that position.