Lean 4.36 and broader Python graph import
We moved to Lean 4.36 and FloatLib 4.1.0. Imported graphs can now retain supported branches and loops and record the order of a reduction. Captures from the previous wire format must be regenerated for operator-record version 5.
- Control flow. Supported PyTorch structured control flow and JAX
laxcontrol flow can stay in the captured IR and run on the supplied inputs. Branches and loops - Reduction order. Store a left fold, blocked or pairwise sum, or an explicit tree. The same four binary32 values now make a short example of why that choice matters. Choosing a reduction order
- Linear algebra. JAX capture handles Cholesky and its updates, triangular and tridiagonal solves, Householder products, and LU-pivot permutations. The Lean library also gives mathematical specifications and existence theorems for factorizations such as SVD and real Schur. Connecting an imported computation to one of those specifications is a separate proof. Linear algebra
- More PyTorch operators. Capture covers more indexing and sorting on integer and Boolean tensors, transposed convolution, and graph-valued convolution weights and normalization parameters. PyTorch operator coverage
PyTorch graphs can move and convert the four supported float8 formats. JAX captures can also
compute over those formats for supported operations. JAX complex captures keep paired real and
imaginary components through supported FFTs and elementary functions. Special functions such as
igamma and betainc have real-valued specifications and derivative proofs on stated domains.
Those special functions have no binary execution rule, so a binary reference run refuses a step
that reaches one.
The operator table
shows which rules, CUDA entries, and certificates each operator has.
At IEEE scalar types, LayerNorm, RMSNorm, GroupNorm, and BatchNorm use the raw square root in their normalization denominator. A negative argument therefore produces NaN, as in PyTorch.
Policy KL divergence uses an expm1x formulation adapted from Section 4.1 of
Amos (2026). Over $\mathbb{R}$, klFromLogits is proved equal
to the usual categorical KL. Selected floating-point tests cover close policies, widely separated
policies, and underflowing old-policy probabilities. The
implementation notes
state its range caveats and remaining rounding limits. klFromLogits no longer takes an epsilon
argument.
The numerical-runtime walkthrough explains which computations have roundoff bounds, their assumptions, and what happens when an analysis cannot produce a bound.