Mathematical and reasoning corpora are specialist collections of proofs, problem sets, and worked solutions, and they matter because general web text teaches a model very little about how to reason quantitatively. If your RAG system needs to explain a derivation, retrieve a relevant theorem, or check the steps in a solution, generic knowledge bases will let you down. This kind of data carries the structured, step-by-step thinking that maths and technical work depend on, which is exactly what most corpora strip away as noise.
The main choice is between naturally occurring maths and synthetic maths. Sources like OpenWebMath and Proof-Pile-2 gather real writing from the web, textbooks, and formal proof libraries, so the language is authentic but uneven in difficulty. Sets like AMPS and AutoMathText lean on generated or auto-labelled problems, which gives you clean, plentiful examples at the cost of some variety and the occasional machine-made mistake. Think about whether you want breadth of style or predictable, well-labelled structure.
Watch out for how the maths is encoded. Some datasets keep formulae as LaTeX (a typesetting language for equations), others as plain text or images, and a formula that renders correctly in one format can turn to gibberish in another, so check that your chunking and embedding steps preserve the symbols. Correctness is the other worry: not every solution in a scraped set is right, and formal proof libraries, though rigorous, cover only the theorems someone has bothered to formalise.
The sources below span raw web maths, formal proof collections, and curated problem-and-solution sets.