In some fields, sure, cite the 4chan source, ideally with an archived link.
Pure math tends to be much more conservative in citations than other fields though, and even when writing a paper about a longstanding math problem you wouldn't necessarily bother to include existing solutions. You reference the things you actually used, and even then you assume some common background knowledge for your audience and don't reference every little undergrad topology theorem or whatever. The point is to be honest with the reader about what was helpful for this work in particular, both to properly attribute things you actually used and to make any searches based on your work more targeted and fruitful.
You cite the form you encountered and if you're any good of a researcher you will have encountered the original 4chan anon post, Borges' short story, or Chomsky's linguistic paper.
It happens way more than you expect. In my PhD I used to cite unreviewed preprints that were essential to my work but simply for whatever reason hadn’t been pushed to publication. More common for long review like papers
And people who care more for gatekeeping will stick to academic echo chambers. The list of community driven medical discoveries encountering entrenched professional opposition is quite long.
Both models are fallible, which is why discernment is so important.