Exactly. Math has in the past been classified as an export-controlled 'munition'. No matter where you learned it, a US citizen could be arrested for talking about it outside of the US. People were printing it on t-shirts and in books as a form of free speech protest.
https://en.wikipedia.org/wiki/Crypto_Wars
"the encryption technology (techniques as well as equipment and, after computers became important, crypto software) was included as a Category XIII item into the United States Munitions List."
And see the Free Speech Flag: https://en.wikipedia.org/wiki/Free_Speech_Flag
The concept of “where” you do or have a thing is well enshrined in law. Here for example knives that are perfectly legal to possess in your kitchen become illegal if you were to walk down the street holding one. It’s exactly the same with some forms of IP, these are often called “dual use” in legal terminology.