LLM agents encode literature-derived physical mechanisms as category-theoretic models in Lean, with proofs checked by the kernel and failed proofs repaired from Lean diagnostics.
Abstract
Artificial intelligence (AI) is undergoing a transition from open-ended to formal mathematical reasoning. Can a similar transition be achieved in the physical sciences, where discovery also requires constructing, composing and testing representations of physical reality? Here we introduce FormalGen, a multi-agent framework that brings this paradigm to physics-driven design, applied to multiscale materials. Agents formalize published mechanisms as category-theoretic models, propose mutations with genetic operators, and use Lean to check behavioral claims before finite-element testing. In one mutation, agents couple sunflower phototropism to bamboo graded-wall mechanics through bending-induced fiber reorientation. The model predicts a 2.46-fold increase in flexural rigidity, and simulations yield 2.45-fold between prescribed orientations. Ranking by interface and domain compatibility finds 100 verified connections with 97% fewer candidates than connectivity-based ranking. From 8 to 32 mechanisms, proofs of individual laws increase fourfold while two-mechanism chains certified by proof reuse increase 27-fold, a basis for cumulative discovery.
Problem
AI-driven design in the physical sciences relies on open-ended reasoning, such as knowledge-graph analogies. That reasoning leaves open whether a proposed connection between physical mechanisms is valid, and which quantities pass between laws under which conditions.
Approach
FormalGen is a multi-agent framework with four stages: corpus, compose, discover and test. Agents extract governing laws from published papers and represent them as morphisms between typed interfaces with admissible domains. They compose these laws into string diagrams and propose mutations with genetic operators. Lean checks domain compatibility, commutativity and response claims, a repair agent fixes failed proofs from Lean diagnostics, and accepted designs then undergo finite-element testing.
Figure 2: Verified formalizations of published mechanisms. a , Schematics (top) and string diagram (bottom) of sunflower phototropism [ 29 ] . Transport p_{\mathrm{tr}} maps the light-direction signal e to the auxin asymmetry coefficient q . The growth, section, and rod maps p_{\mathrm{gr}} , g_{\mathrm{sec}} , and g_{\mathrm{rod}} yield the growth coefficient b , intrinsic curvature \kappa , and
Results
A mutation coupling sunflower phototropism to bamboo graded-wall mechanics predicts a 2.46-fold increase in flexural rigidity, against 2.45-fold in simulation. Ranking by interface and domain compatibility finds 100 verified connections with 97% fewer candidates than connectivity-based ranking. Scaling from 8 to 32 mechanisms increases two-mechanism chains certified by proof reuse 27-fold.
Figure 4: Finite-element simulations of the light-driven stem with reorientable wall fibers. a , Light-responsive segment under eight illumination patterns, coloured by light-induced axial contraction (left), and tip deflection u_{\mathrm{tip}} against the mean light strain difference of the two sides, \Delta\bar{\varepsilon} , for 25 patterns and light levels (right). b , Tube wall with its fiberFigure 5: Compositional knowledge graph benchmarking. a , Directed object pairs linked in the knowledge graph (top) and in the compositional knowledge graph (bottom) for 32 source compositions with 295 objects. Dots are objects, and numbers are the mechanisms in b . The knowledge graph links an output field to an input field whose quantities are the same or related. The compositional knowledge gra