Abstract
Machine-learning methods are gradually being adopted in a wide variety ofsocial, economic, and scientific contexts, yet they are notorious forstruggling with exact mathematics. A typical example is computer algebra, whichincludes tasks like simplifying mathematical terms, calculating formalderivatives, or finding exact solutions of algebraic equations. Traditionalsoftware packages for these purposes are commonly based on a huge database ofrules for how a specific operation (e.g., differentiation) transforms a certainterm (e.g., sine function) into another one (e.g., cosine function). Theserules have usually needed to be discovered and subsequently programmed byhumans. Efforts to automate this process by machine-learning approaches arefaced with challenges like the singular nature of solutions to mathematicalproblems, when approximations are unacceptable, as well as hallucinationeffects leading to flawed reasoning. We propose a novel deep-learning interfaceinvolving a reinforcement-learning agent that operates a symbolic stackcalculator to explore mathematical relations. By construction, this system iscapable of exact transformations and immune to hallucination. Using theparadigmatic example of solving linear equations in symbolic form, wedemonstrate how our reinforcement-learning agent autonomously discoverselementary transformation rules and step-by-step solutions.