AT first glance it might not be obvious how the chanting and colourful banners outside Vancouver Public Library relate to some rather less lively evidence sessions about census questions at the Scottish Parliament. But the protests in Canada a week ago are part of the same global debate about identity as last month's discussions about whether Scots should be required to declare their biological sex.

To listen to those leading the chants – including “No TERFs, not KKK, no fascists here today!” – you'd be forgiven for thinking headline speaker Meghan Murphy was some kind of racist and colonialist, prone to inciting violent acts against minorities. What would not be immediately clear is that Murphy's crime, in the eyes of those who would silence her, is stating that men cannot become women.

In fact her opponents would argue this is not just a crime in their eyes, but also according to the laws of the land. The reach of these laws – some federal, others provincial – is currently being tested, including in high-profile legal actions that are making headlines around the world.

So why is a discussion on Gender Identity Ideology and Women's Rights so controversial, and what can Scotland learn from Canada about how to legislate around the contentious area of transgender rights? Equally, what might Canada be able to learn from us?

Our two nations have a few things in common. Each has a neighbour to the south with a population about ten times higher, each is led by a self-declared feminist, and each governing party prides itself on being progressive, especially in comparison to those southern neighbours. The leaders of both countries are, accordingly, loudly and proudly committed to promoting LGBT rights.

Canadian Prime Minister Justin Trudeau was already a regular at Pride marches before his election in 2015, while last year Nicola Sturgeon led Glasgow Pride during Donald Trump's visit to Scotland, shortly before the Scottish Government committed to including LGBT issues across the school curriculum. Back in November 2017, weeks after Sturgeon apologised at Holyrood to gay men convicted of sexual offences that are no longer illegal, Trudeau issued a formal apology in the Ottawa legislature for the past oppression of the LGBTQ2 communities.

Incidentally, the “2” stands for two-spirited, a term that refers exclusively to indigenous people with distinct spiritual and ceremonial roles in their communities.

The worldwide gender identity debate is, at heart, a debate about the meaning of words. In particular, the words “woman”, “man” and "lesbian". It is a debate about whether individuals, groups, political parties or governments have the right to redefine those words, then compel others to accept the new meanings.

The meaning of "woman" matters because this has implications for women-only spaces such as toilets, changing rooms and refuges. It matters because of the impact on all-women shortlists and women's sports. It matters because women around the world suffer discrimination as a consequence of being born female.

Because the meaning of words directly affects how people – including the small minority who are transgender – navigate their day-to-day lives, this is a heated debate. And while many women politely nod along with mantras like "transwomen are women", either believing themselves to be progressive or fearful of the consequences of doing otherwise, many feminists are refusing to comply.

It is a sufficiently heated debate that when Murphy and her fellow panellists started to address an audience of around 300 women late on a Thursday night last week, there were more than two dozen security guards in the room and police officers too.

Those who challenge the idea that men can become women (and vice-versa) have been called many things – “TERFs” (trans-exclusionary radical feminists), transphobes, bigots and even Nazis but in Canada “coloniser” is added to the mix, with the implication that such individuals are also anti-indigenous people, anti-immigrant and pro-deportations. This goes down badly with those among their opponents who are indeed radical feminists, aligned to the left.

Murphy grew up in a left-wing household, with a father who campaigned for Canada's New Democratic Party. But in recent years, since “coming out” as critical of gender identity ideology, she has found herself courted by those on the right, even those who strongly disagree with her positions on other issues such as abortion. When she was last year handed a permanent ban from social media site Twitter for questioning gender identity ideology – and then questioning Twitter for punishing her for doing so – she received a flood of supportive messages from right-wingers including Ben Shapiro, the influential US commentator.

“Of course I'm aware that some of those outlets are using me for their own means, which is like, 'look at what the left is doing, it's eating itself', but I don't really care, because they're right,” she says with a wry laugh.

She believes politicians on the left who have backed a steady stream of policy changes informed by gender identity ideology – relating to everything from signage and the census to prisons and hate speech – are poorly informed. “I think the politicians are advised to take a certain line and don't at all understand the implications of the arguments, and don't really think about it very much ... and even if they did I'm sure they would be too scared to say anything.”

Among those who have taken that line is Vancouver's newly elected mayor, Kennedy Stewart, who said of Murphy's event: “I find it despicable ... it's not something I support at all”. Murphy attempted to contact Stewart to find out what, exactly, he found despicable (the website she founded and edits, Feminist Current, covers a wide range of issues), but she received no response. It's clear, however, that Vancouver is very keen to promote itself as an LGBT-friendly city. Signs on lampposts “celebrate queer Vancouver”, stickers on doors announce “safe places” and rainbow and trans flags adorn public buildings.

Unlike in Scotland, where the Scottish Trans Alliance has received government funding since 2007, in Canada there is no national organisation pushing for changes to transgender rights. There are also no national women's rights campaign groups comparable to the UK-wide Fair Play for Women, Women's Place UK (founded by three women from the trade union movement) or For Women Scotland, arguing for the importance of protections based on biological sex. As a result there has been very little public debate about the implications of significant changes – that is, except for the very public opposition of psychology professor Jordan Peterson to the inclusion of gender identity as a prohibited ground of discrimination.

The question of gender identity has been in the news on this side of the Atlantic for months due to proposed changes to the Gender Recognition Act (GRA) 2004 – a piece of legislation that was passed following a European Court of Human Rights case in 2002. The introduction of the GRA meant that people who identified as the opposite sex could change their legal sex by amending their birth certificates. At that time it was already possible to change the sex recorded on documents such as driving licences and passports, but transwoman Christine Goodwin argued that because she had been refused a new National Insurance number that reflected her new identity, an employer had gained knowledge of her past living as a man and discriminated against her on this basis. The court ruled that preventing trans people from changing their legal sex contravened the European Convention on Human Rights.

As the law stands, those applying to change their birth certificates must satisfy a panel of medical and legal professionals that they have experienced gender dysphoria, defined by the NHS as “a condition where a person experiences discomfort or distress because there's a mismatch between their biological sex and gender identity”; have lived in their acquired gender for two years; and intended to live in that gender for life. Concepts such as “living in” a gender were not defined in the legislation, with their interpretation left to those appointed to Gender Recognition Panels. Transgender activists now argue that restrictive, stereotypical notions of gender are used to assess whether an applicant is indeed “living in” a given gender, and that the UK's approach wrongly characterises transgender identities as evidence of psychological problems. These are among the reasons why they argue that the UK (including Scotland, where the relevant legislation is now devolved) should adopt a system of gender self-ID, scrapping Gender Recognition Panels and instead requiring applicants to make a statutory declaration about their identity.

The debate about Scotland's census, changes to which are being considered by the Culture, Tourism, Europe and External Affairs Committee, has become a proxy debate about self-ID, highlighting the fact that the current census format conflates sex and gender (as the guidance states that respondents should choose the sex they believe themselves to be). The Scottish Government consulted on reforms to the Gender Recognition Act last year, and has pledged to bring forward legislation in this area soon.

Official attitudes in Scotland have changed over time, due in large part to the efforts over the past decade of James Morton of the Scottish Trans Alliance. Writing about the challenges of securing and retaining funding for a trans-specific equality project, Morton has noted that the SNP, which inherited his pilot project from the previous coalition government in 2007, “were keen for the rest of Europe to recognise Scotland as a progressive, innovative country”. He also explains the strategic thinking behind working with the Scottish Prison Service to introduce a gender identity policy – if prisons could be persuaded to adopt a policy based on self-declaration in “very challenging circumstances”, other public services would likely follow.

Those challenging circumstances have been in the spotlight since it emerged that Karen White, a male rapist who identifies as a woman but is still legally male, had sexually assaulted female inmates after being remanded in a women's prison in England. White was described as an “alleged transgender female” by a prosecutor who suggested there was little evidence of any meaningful transition, but last week it was reported that the serial sex offender – who is serving a life sentence – is seeking cash from friends to fund gender reassignment surgery, in the belief this will guarantee a transfer back to the female estate.

Trans activists argue that such cases are exceptions and that those who oppose prison policies based on self-ID are unfairly seeking to portray all transgender people as sexual predators. Women's rights groups argue that vulnerable women in prison, many of whom have experienced physical and sexual violence, have the right to be housed separately from males.

They also argue that spaces such as women's refuges should be permitted to refuse males, and in Canada this is a contentious subject. Back in 1995, a transwoman named Kimberly Nixon sought to volunteer as a counsellor for Vancouver Rape Relief, and when she was rejected on the grounds that she had not been born female she took the charity to the British Columbia Human Rights Tribunal. She won the case, and was awarded $7,500 for injury to her self-respect and dignity, but the charity sought a judicial review and the case ended up in the Supreme Court, which ruled against Nixon and asserted that the charity was entitled to apply its women-only policy.

Lee Lakeman, a pioneering feminist and fierce advocate for abused women, worked at Vancouver Rape Relief for 35 years. She joined the panel for Murphy's event in the city and delivered a passionate defence of female-only spaces, warning: “To those who imagine you can bully us into submission: you are clearly unfamiliar with us”.

One might imagine that a transgender person taking a rape charity to court would have damaged the cause of transgender rights, but it appears only to have damaged the charity. When a business in the city recently displayed a poster advertising a Rape Relief fundraiser in its window, its owner received a barrage of abuse and negative Facebook reviews. It remains to be seen whether a male taking more than a dozen female beauticians to the British Columbia Human Rights Tribunal claiming discrimination on gender identity grounds – after they all refused to wax “her” male genitals – will be similarly supported by the transgender community and its allies.

In the end Murphy's event passed without disruption, perhaps unsurprisingly given the muscle on hand to enforce it. By the time the last stragglers left – in pairs for their safety, as instructed – they found that many of those who had been chanting out in the cold had since abandoned their placards and gone home. However, a local trans activist later argued that by allowing the event to be broadcast online, Vancouver Public Library knowingly took part in “publishing to the internet an incitement to discriminate on the basis of gender identity or expression, an action prohibited by section seven of the Human Rights Code”.

As the Canadian left continues to eat itself, Scotland is having an in-depth discussion about what it means to be a woman or a man, in law and in our society. The wording of questions on the census might not seem like a vitally important matter, but the Canadian experience shows just how quickly small changes can have far-reaching effects.