01
The model
| System | Binary A–B at fixed temperature and pressure; composition x = xB ∈ [0, 1]. Each phase has a Gibbs energy G(x) per mole of atoms, as pycalphad’s GM. |
| Solutions | One mixing sublattice, the others vacancies only: ideal mixing RT(x log x + (1 − x) log(1 − x)) plus a Redlich–Kister excess x(1 − x) Σ Lk(1 − 2x)k. |
| Magnetism | Optional Inden–Hillert–Jarl term RT log(1 + β(x)) g(Tc(x)/T), with Tc and β Redlich–Kister sums of the TC and BMAGN parameters, divided by the antiferromagnetic factor where negative. The two branches of g meet at T = Tc with equal value and slope — an identity Lean proves for every structure factor p. |
| Compounds | Stoichiometric: they exist at one exact composition, such as 2/3. |
| Sublattice phases | Compound-energy-formalism phases with one or two mixing sublattices (A,B), the other sublattices filled by A, B or vacancies (CAL-C06, C07), such as θ = (Al)2(Al,Cu)1 or the Laves phase C15 = (Cu,Mg)2(Cu,Mg)1. With one mixing sublattice the composition is an affine function of its site fraction; with two, the Gibbs energy of the phase is the minimum over the internal states (two site fractions) that satisfy the composition constraint, as in pycalphad, and the checker runs a two-dimensional branch and bound on the square of internal states. |
| Parameters | Piecewise SGTE expressions in T. The range valid at T is picked (Tlo ≤ T < Thi, as in pycalphad) and function references are expanded; each term is c·Tn or c·Tn log T, with c the exact product of the TDB’s decimal strings. |
| Not yet | The ordered phase of an order–disorder pair (the disordered phase is computed as in pycalphad), interstitial phases, three or more mixing sublattices, sublattice phases with missing endmembers or reciprocal parameters, magnetic sublattice phases, molecular species made only of A and B, more than two components. Such phases are skipped and listed in the report; the conclusions hold for the phases taken into account. |
Since 4 October the checker reads the TDB file itself. With --tdb — the mode the driver uses whenever it verifies a run from a TDB file — Lean’s modelOfTdb builds the model from the file (temperature ranges, function references, species, phase types, site ratios, magnetic constants) and the checker requires it to equal the certificate’s model (CAL-I01, B02), so the driver’s translation is no longer trusted. What remains trusted (assumption A-CAL-01) is that this Lean definition, about 800 lines, reads a TDB file as intended; the benchmark compares it with the driver on every binary system of COST 507 and checks every phase’s G(x) against pycalphad to a relative 5×10⁻¹² (pycalphad adds 10⁻⁹ to Tc to avoid a singularity; the certificate uses the exact continuous form). Without --tdb a certificate certifies the exact model written in it.
02
What is certified
The equilibrium Gibbs energy G*(x₀) is the infimum of the total Gibbs energy over all feasible configurations: any finite collection of phases, compositions and amounts with the right overall composition. Geometrically it is the lower convex hull of all phase curves at x₀.
An equilibrium is a feasible configuration together with a common tangent ℓ(y) = μA(1 − y) + μBy that lies below every phase and touches the configuration; μA and μB are the chemical potentials. Lean proves that equilibria minimise the total Gibbs energy (CAL-C02) and that one always exists (CAL-C03).
A Gibbs-energy minimiser can stop in a local minimum, miss a phase or miss a miscibility gap. The checker’s statements are about every feasible configuration and every equilibrium, so such a mistake can only make the check fail or widen the intervals — never produce a wrong statement.
| Line | What the Lean theorem guarantees |
|---|---|
| G_OK lo hi | G*(x₀) ∈ [lo, hi]: every feasible configuration has total Gibbs energy ≥ lo, and the certificate’s configuration has ≤ hi. |
| MU_OK A|B lo hi | The chemical potentials of any equilibrium lie in these intervals. |
| WINDOW phase a b | In any equilibrium, every composition of this phase lies in one of its windows. |
| ABSENT phase | The phase appears in no equilibrium. |
| DF_OK phase lo hi | The driving force maxx (ℓ*(x) − G(x)) of the phase — pycalphad’s DF, negative for metastable phases, 0 for stable ones — for the tangent ℓ* of any equilibrium. It is the global maximum over all compositions. |
| EXISTS | An equilibrium exists, so the statements above are not vacuous. |
| REF_OK lo hi | With a prescribed activity a of B (--acr B=a --ref PHASE, since 6 October): the reference energy Gref(1) of pure B in the reference phase, computed by the checker; μB = Gref(1) + RT ln a is irrational in general, so the remaining lines hold for every μB in the resulting rational interval, and with it for the true one (CAL-B06). |
| PROP phase x G … S … H … CP … | From a separate property certificate (--calc n, since 6 October): at fixed composition — for a phase with two mixing sublattices, at a fixed internal state, as in pycalphad’s calculate — the phase’s Gibbs energy per mole of atoms is twice differentiable in T, and G, S = −∂G/∂T, H = G − T∂G/∂T and Cp = −T∂²G/∂T² lie in the four intervals. The derivatives are exact and symbolic: a parameter’s derivative is again a sum of terms c·Tn(log T)l, the mixing term is proportional to T, and the magnetic term is one branch of the Inden–Hillert–Jarl function on one side of Tc (CAL-C11, B07). |
| TRANGE l h | In --tdb mode with a property certificate: at every rational temperature in (l, h) the TDB file defines the same parameters, so the derivatives of the model are those of the database; a temperature exactly on a breakpoint of the piecewise expressions used is rejected (CAL-I02). |
| PROBLEM, UNSUPPORTED, MODEL_OK | In --tdb mode: PROBLEM echoes the TDB file, the components, T, x₀, R and the phases; UNSUPPORTED lists the phases left out and why; after MODEL_OK every line is a statement about the model the TDB file defines (CAL-B02). |
| CONVEX phase T | From a separate convexity certificate: the phase has no miscibility gap at T (section 06). |
| TANGENT, EPS, KAPPA, FRAC | Diagnostics: whose tangent was used (in single-phase regions the checker computes its own), how far below the phases it lies, the tangent error bound used for the windows, and the certificate’s own configuration. |
03
Worked example: a miscibility gap in Al–Zn
Al–Zn at 600 K and x(Zn) = 0.3, with the Mey (1993) database shipped with pycalphad. At this temperature the fcc solution splits in two: the equilibrium is two fcc phases with about 22% and 49% zinc. The checker proves that LIQUID and HCP_A3 appear in no equilibrium, confines the fcc compositions of every equilibrium to two windows at most 3×10⁻⁷ wide, pins G* and both chemical potentials to the last printed digit, 10⁻⁹ J/mol, and gives each phase’s driving force to the same precision. The run, check included, takes about one second.
…
Lean G_OK -22985.126672267 -22985.126672266
Lean TANGENT cert
Lean EPS -0.000000000002425
Lean FRAC FCC_A1 0.220126286673 0.705704921583
Lean FRAC FCC_A1 0.491533181263 0.294295078416
Lean MU_OK A -20590.725231961 -20590.725231960
Lean MU_OK B -28572.063366314 -28572.063366313
Lean KAPPA 0.000000000022
Lean ABSENT LIQUID
Lean WINDOW FCC_A1 0.220126163802 0.220126409545
Lean WINDOW FCC_A1 0.491533032729 0.491533329798
Lean ABSENT HCP_A3
Lean DF_OK LIQUID -896.512026734 -896.512026733
Lean DF_OK FCC_A1 -0.000000001 0.000000001
Lean DF_OK HCP_A3 -379.321840947 -379.321840946
Lean EXISTS
Al–Zn at 600 K: the fcc phase against the certified tangent
Gibbs energy of FCC_A1 minus the common tangent ℓ, in J/mol. The curve touches ℓ twice — a miscibility gap — and the dots mark the two Lean windows, each at most 3×10⁻⁷ wide. LIQUID and HCP_A3 stay 896.5 and 379.3 J/mol above ℓ at their closest (their certified driving forces), far off this scale. The curve is computed with pycalphad for illustration; the tangent and windows come from the Lean report.
Show the numbers
04
Magnetism: the Cr–Fe miscibility gap
In Cr–Fe the bcc solution is ferromagnetic on the iron side (Tc = 1043 K, β = 2.22) and antiferromagnetic on the chromium side, where TC and BMAGN are negative and are divided by the antiferromagnetic factor. The magnetic energy is what splits the bcc phase into a Cr-rich and an Fe-rich solution below about 860 K. At 600 K and x(Fe) = 0.5 the checker certifies the two compositions to windows 10⁻⁷ wide in about two seconds.
The magnetic term is not a polynomial and has no convenient second derivative, so the checker bounds it on each interval with secant slopes instead of derivatives: log(1 + β), the antiferromagnetic convention, the powers tn and t−n, and both branches of the Inden–Hillert–Jarl function each have rational bounds on the slope between any two points of an interval, proved in Lean (CAL-C04). The resulting lower bound is exact up to a term of the order of the interval width squared, which is enough for the branch and bound to converge.
… 相: BCC_A2(磁性)
Lean G_OK -19793.346508744 -19793.346508743
Lean MU_OK A -19642.803579468 -19642.803579467
Lean MU_OK B -19943.889438020 -19943.889438019
Lean WINDOW BCC_A2 0.432097736118 0.432097836657
Lean WINDOW BCC_A2 0.903631494701 0.903631563012
Lean DF_OK BCC_A2 -0.000000001 0.000000001
Lean EXISTS
Cr–Fe: certified boundaries of the magnetic miscibility gap
Composition x(Fe) of the two bcc solutions in equilibrium, from 400 K to 850 K in steps of 25 K. Each point is the centre of a Lean window, at most 2×10⁻⁶ wide, from one certificate per temperature (57 certificates in all with the single-phase regions). The two boundaries meet near 860 K, where the gap closes. pycalphad’s binplot draws the same curves.
Show the numbers
05
Phase diagrams
--map T1:T2:dT computes an isothermal section at each temperature of a grid: the driver walks the lower convex hull and splits [0, 1] into single-phase regions and common tangents, refines each tangent by Newton’s method, and writes one point-equilibrium certificate at the midpoint of every region. For a two-phase region the two windows of its certificate are the certified phase boundaries at that temperature, and every other phase is proved absent there.
Benchmark: Pb–Sn 300–600 K (43 regions), Al–Zn 400–900 K (35, including the fcc miscibility gap), Cu–Mg 600–1300 K (31), Cr–Fe 400–900 K (31) and Al–Fe 700–1700 K (63 regions, 34 common tangents, with the γ loop near pure iron). All 203 certificates pass, every boundary window is at most 2×10⁻⁶ wide, and pycalphad’s equilibrium gives the same phases and compositions at every certificate point. The certified boundary points lie on pycalphad’s binplot curves; in Al–Fe between 1300 and 1430 K binplot omits the Al2Fe region, which pycalphad’s own equilibrium and our certificates both show.
Since 5 October each grid temperature also gets a partition certificate (CAL-C09, B05). The slope of the equilibrium tangent is monotone in the overall composition, so point-equilibrium anchors bracket the tangent at every x₀ in between, and the checker proves, for every x₀ in [0, 1], which phases any equilibrium can contain: a table of single-phase regions, two-phase regions with their boundary windows, and narrow unresolved strips at the phase boundaries, covering [0, 1]. Benchmark: 7 systems at 67 temperatures, 174 single-phase and 201 two-phase regions, the widest unresolved strip 5.4×10⁻⁸; pycalphad’s equilibrium at 3346 points of a composition grid falls in a certified region with the same phases every time.
The partition is certified at each grid temperature; what happens between grid temperatures is not. A single-phase region proves “only this phase, at compositions in the window”; a miscibility gap inside that window is excluded only by a convexity certificate.
06
No miscibility gap: convexity certificates
A point-equilibrium certificate can prove that a phase has a miscibility gap at (T, x₀) — its windows exclude x₀ — but not that it has none at a lower temperature, so the temperature at which a gap appears had a proved bound on one side only. Since 4 October a second kind of certificate supplies the other side: for a non-magnetic substitutional solution it proves a·G″(x) > 0 on (0, 1), so G is strictly convex on [0, 1] (CAL-C05).
At a fixed T the parameters split exactly into P₀(x) + (log T)·P₁(x) with exact rational polynomials, so a·G″ = P₀″ + (log T) P₁″ + aRT(1/x + 1/(1 − x)); log T enters only as a coefficient between rational bounds. The checker runs its own branch and bound over [0, 1] — the driver supplies only the model, again bound to the TDB file — and prints CONVEX phase T (CAL-B03). Lean then proves that in any equilibrium, at any composition, all parts of that phase have the same composition, and that if it is the only phase, the single-phase state is the equilibrium at every x₀. A certificate takes 0.1–0.2 s to check.
Together with the point-equilibrium certificates this brackets the onset of a gap from both sides. In the benchmark — the liquid gaps of COST 507 Al–Ce, Fe–Si, Mg–Si and Cu–Si and of the Al–Ni database of Dupin (2001), and the fcc gap of Al–Zn — the highest temperature at which the checker proves convexity is located to 1 K (for Al–Zn, whose gap lies below, the lowest), and pycalphad’s G″ changes sign within the next kelvin every time.
CONVEX is a statement about one temperature; nothing is certified between two temperatures, so whether the phase changes only once inside a bracket is not proved. CAL_FAIL is not a proof that a gap exists — that comes from the windows of a point equilibrium. Magnetic phases are not covered yet: they would need bounds on the second derivative of the magnetic term, while CAL-C04 bounds only secant slopes.
07
How the checker works
Everything is exact rational arithmetic. The driver contributes only a candidate tangent, a candidate configuration, probe points and a point near each phase’s minimum.
- 1
Parameter intervals and the tangent
log T is enclosed by rational series bounds shared with mini-DFT; each solution phase becomes a rational polynomial plus the ideal mixing term (and the magnetic term), with a uniform rounding error. In single-phase regions the checker replaces the driver’s double-precision tangent by its own rational tangent at x₀ — soundness holds for any tangent, so this needs no new proof, only sharpens the result.
- 2
Branch and bound below every phase
On each interval, a lower bound for G − ℓ comes from exact Taylor coefficients of the polynomial, the proved quadratic bound on the mixing term (CAL-C01), the secant-slope bound on the magnetic term (CAL-C04) and the exact minimum of a quadratic. Each phase gets its own lower bound ei; their minimum e ≤ 0 bounds all phases from below.
- 3
Interval for G*
Every feasible configuration has total Gibbs energy ≥ ℓ(x₀) + e (CAL-C02); the certificate’s configuration, with amounts from the lever rule, gives the upper end.
- 4
Chemical potentials
Any equilibrium tangent passes through the G* interval at x₀ and stays below the phases at probe points on both sides; that pins its slope, hence μA and μB — to about 10⁻⁹ J/mol in two-phase regions and 10⁻⁸ to 10⁻⁷ J/mol in single-phase regions.
- 5
Driving forces
Any equilibrium tangent is within κ of the certificate’s on [0, 1], so min (Gi − ℓ*) ≥ ei − κ, and the driver’s point near the minimum gives the other end.
- 6
Composition windows
Phases present satisfy G − ℓ ≤ κ. A second branch-and-bound pass excludes every interval whose lower bound exceeds κ; what remains are the windows.
The bisection rule affects only speed and sharpness. Soundness depends only on two facts the proof checks: every excluded interval has a lower bound above the threshold, and the intervals cover [0, 1].
08
Claims in the trust ledger
| Claim | Statement | Tier |
|---|---|---|
| CAL-C01 | Quadratic lower bound on the ideal mixing term S(x) over any interval | T3 |
| CAL-C02 | Equilibria minimise the total Gibbs energy; every phase present touches the tangent; a lower bound on G − ℓ bounds every feasible configuration | T3 |
| CAL-C03 | An equilibrium exists for 0 < x₀ < 1 with at least one solution phase, magnetic phases included (their Gibbs energy is continuous) | T3 |
| CAL-C04 | Interval bounds on the Inden–Hillert–Jarl magnetic term from secant slopes: a polynomial lower bound with second-order error on any interval, and an upper bound at rational points | T3 |
| CAL-C05 | No miscibility gap: if a·G″ > 0 on (0, 1) for a non-magnetic substitutional solution, G is strictly convex on [0, 1]; then in any equilibrium all parts of that phase have one composition, and a single such phase is the equilibrium at every x₀ | T3 |
| CAL-C06 | Sublattice phases with one mixing sublattice: the composition is an affine function of the site fraction y, so the mixing bound and the existence argument carry over on y ∈ [0, 1] | T3 |
| CAL-C07 | Sublattice phases with two mixing sublattices: G(x) is the minimum of H/m over the internal states on a constraint line, attained and continuous; lower bounds on boxes of the internal-state square and composition windows from an ellipse projection | T3 |
| CAL-C08 | At a given chemical potential μB: an equilibrium exists once a line through (1, μB) lies below every phase and a point of some phase lies below a higher such line | T3 |
| CAL-C09 | Isothermal sections: the slope of the equilibrium tangent is monotone in x₀; every feasible configuration has a part on each side of x₀; an affine function bounded at increasing points lies below one of their chords or the two end rays | T3 |
| CAL-C10 | Monotonicity under chemical-potential and activity conditions (Gibbs–Duhem): raising μB does not raise μA and does not lower the overall composition; an activity condition is the chemical potential μB = Gref(1) + RT ln a | T3 |
| CAL-C11 | Thermodynamic properties in closed form: at fixed composition (or fixed internal state) every phase’s Gibbs energy is (P(T) + KT + ΛT h(tc/T))/m near T, with P a sum of parameter terms and h one branch of the magnetic function; it is twice differentiable there, and S, H, Cp have explicit formulas in P′, P″, h′, h″ | T3 |
| CAL-B01 | Checker soundness: the interval for G*, and for every equilibrium the chemical potentials, composition windows, absent phases and driving forces; existence | T4 |
| CAL-I01 | Reading TDB files: modelOfTdb, the binary model a TDB text defines at T for two components and a list of phases. A definition, not a theorem: whether it is faithful to the database can only be cross-checked, against the driver and pycalphad | T0 |
| CAL-I02 | The model a TDB file defines is constant on an open temperature interval: if no breakpoint of a parameter in use, or of a function it references, equals T, the TDB file defines the same parameters at every rational temperature between the nearest breakpoints, so the model’s derivatives in T are the database’s | T3 |
| CAL-B02 | Problem binding: when the checker accepts in --tdb mode, the model built from the TDB file equals the certificate’s model, and every conclusion of CAL-B01 holds for it | T4 |
| CAL-B03 | Convexity checker soundness: CONVEX implies strict convexity and no miscibility gap (CAL-C05), also for the model built from the TDB file | T4 |
| CAL-B04 | Chemical-potential checker soundness (pycalphad’s v.MU('B')): intervals for the other chemical potential μA, the overall composition and the Gibbs energy of every equilibrium at the given μB, composition windows and driving forces; existence | T4 |
| CAL-B05 | Partition checker soundness: the regions cover [0, 1], and every equilibrium at every x₀ in a region has the stated phases, at compositions in the stated windows | T4 |
| CAL-B06 | Activity checker soundness: for a prescribed activity a of B with pure B in a reference phase as reference state, the interval for Gref(1) and μB, and for every equilibrium at that μB the conclusions of CAL-B04; existence | T4 |
| CAL-B07 | Property checker soundness (pycalphad’s calculate with GM, SM, HM, CPM): each row’s phase, at its composition or internal state, has a Gibbs energy twice differentiable in T with G, S, H, Cp in the stated intervals; in --tdb mode, for the model the TDB file defines throughout TRANGE | T4 |
| CAL-B08 | Checker soundness: phase names in the output are pairwise distinct, so each name denotes one phase | T4 |
| CAL-B12 | Pinned statements of the existence theorems behind EXISTS, with and without --tdb | T4 |
| CAL-I03 | The certified problem is echoed in every mode; repeated certificate lines are rejected | T0 |
| CAL-I04 | SHA-256 of the TDB file, computed in Lean by the checker (unproved; matches sha256sum and hashlib) | T0 |
| CAL-I05 | Output escaping: names escaped to printable ASCII, only newlines and spaces as separators; convex mode prints CONVEX only with exit code 0 | T0 |
| CAL-I06 | Complete phase table in --tdb mode (round-1 record R3): an equilibrium, chemical-potential, activity or map certificate must list every computable TDB phase of the system, or the user names the subset with --phases on the checker’s command line | T0 |
| CAL-I07 | The first line is exactly a known kind and version (fis-calphad 1, -convex 1, -mu 1, -acr 1, -map 1, -prop 1) | T0 |
| CAL-I08 | One exit-code rule (second adversarial review, 7 October): 0 only if no line starts with a tag ending in _FAIL or _PARTIAL; 3 when the main check passed and a secondary one failed; 1 rejected, 2 unreadable | T0 |
09
Proof dependencies
Which claims are built on which, read from the Lean proof terms themselves (not from the ledger’s hand-written dependency column). The graph starts with this domain only; click the legend to add the others, or switch to “All Lean theorems” for the theorem level. All domains together are on the programme page.
- a claim or theorem, coloured by domain
- uses — points at what the proof relies on
- bigger — used by more results
- what the selection uses
- what uses the selection
Drag to pan, scroll or pinch to zoom, drag a node to move it; click a node to see what it uses and what uses it, and “Only its chain” to keep just those, directly or not. An arrow from claim A to claim B means that a proof behind A uses a theorem behind B (through lemmas that belong to no claim); two claims can use each other. Claims without a Lean theorem (tests, T0–T2) are not drawn. Generated by scripts/depgraph.py; a reading aid, not part of the trust chain.
10
Goal G3 — certified CALPHAD against pycalphad
Reference: pycalphad 0.11.1 on the same database and the same set of phases. Same completion standard as G1 and G2, and the certificate must speak about the true global equilibrium of the database model. Order: complete the binary case (C0–C1), where branch and bound runs over one composition variable; then multicomponent and sublattice models (C2), where it runs over products of simplices; then derived calculations (C3).
C0 · binary point equilibrium — complete
| Feature | pycalphad | Status | What is certified |
|---|---|---|---|
| TDB reading: functions, piecewise ranges, references, parameters | Database | Done | Also read in Lean since 4 October: with --tdb the checker builds the model from the file (CAL-I01, B02). The reading itself is a definition, cross-checked against the driver and pycalphad’s calculate (A-CAL-01) |
| Substitutional solutions: ideal mixing + Redlich–Kister | Model (GM) | Done | Quadratic mixing bound CAL-C01; checker CAL-B01 |
| Stoichiometric compounds | Model | Done | Composition is an exact fraction such as 2/3; at x₀ exactly on a compound of the hull, the chemical potentials are an interval whose width is the genuine non-uniqueness |
| Point equilibrium: phases, compositions, amounts | equilibrium (Phase, X, NP) | Done | WINDOW and ABSENT for every equilibrium; the certificate’s amounts are exact by the lever rule |
| Equilibrium Gibbs energy | equilibrium (GM) | Done | G_OK: a global lower bound over every feasible configuration |
| Chemical potentials | equilibrium (MU) | Done | MU_OK, for every equilibrium |
| Miscibility gaps (two compositions of one phase) | equilibrium | Done | One window around each composition |
| Existence of an equilibrium | — | Done | CAL-C03: EXISTS, so “for every equilibrium” is never vacuous |
C1 · binary extensions — 6 of 8 done
| Feature | pycalphad | Status | What is certified |
|---|---|---|---|
| Binary phase diagrams on a T–x grid | binplot, map | Done | One certificate per region and temperature; boundaries from the windows of the common-tangent certificates; a partition certificate per temperature (next row) |
| Magnetic contribution (Inden–Hillert–Jarl) | Model (TC, BMAGN) | Done | CAL-C04 (secant-slope bounds) and CAL-C03 for magnetic phases; Cr–Fe and Al–Fe in the benchmark |
| Driving forces | DormantPhase(…).driving_force | Done | DF_OK for every equilibrium; the global maximum over compositions, where pycalphad finds a local one |
| Sharp chemical potentials in single-phase regions | equilibrium (MU) | Done | The checker’s own rational tangent: widths from about 10⁻⁴ down to 10⁻⁸–10⁻⁷ J/mol |
| Completeness of an isothermal section | — | Done | CAL-C09, B05: the phases of every equilibrium at every x₀ in [0, 1], from monotone tangent slopes between anchors |
| Invariant reaction temperatures (eutectic, peritectic) | map | Not started | |
| Thermodynamic properties H, S, Cp | calculate (HM, SM, CPM) | Done | CAL-C11, I02, B07: --calc n; G, S, H, Cp of each phase at fixed composition (fixed internal state for two mixing sublattices, as in calculate) from exact symbolic derivatives; 713 points in 21 systems agree with pycalphad. Equilibrium-level values (equilibrium HM, SM, CPM) not yet |
| Interstitial solutions | Model | Not started |
Planned: C2–C3 (9 items, 4 done)
C2 · multicomponent and sublattice models
- Ternary and higher solutions (Muggianu extrapolation, ternary parameters)
- Several sublattices (compound energy formalism): one or two mixing sublattices done (CAL-C06, C07, October 4–5); more mixing sublattices and reciprocal parameters not started
- Order–disorder
- Conditions on a chemical potential: done (CAL-C08, B04, 5 October),
--mu B=certifies μA, the overall composition and the phases of every equilibrium - Conditions on an activity: done (CAL-C10, B06, 6 October),
--acr B=a --ref PHASEwith pure B in the reference phase at the same temperature as reference state, pycalphad’s convention; the reference phase must take part in the calculation and be able to be pure B
C3 · further calculations
- Scheil solidification
- Parameter fitting (ESPEI): the fit stays untrusted, conclusions depend only on the final database
- Ionic liquid and quasichemical models
11
Cross-checks and supporting evidence
- Every phase’s G(x) at x = k/20 against pycalphad’s
calculaterelative ≤ 5×10⁻¹² - 29 equilibria in Al–Zn, Pb–Sn, Cu–Mg, Cr–Fe and Al–Fe against pycalphad’s
equilibrium: compositions / Gibbs energy< 10⁻⁶ / < 10⁻⁵ J/mol - pycalphad’s
GM,MUand phase compositionsinside the Lean intervals and windows - 141 driving forces: pycalphad’s
DormantPhasevalue inside the Lean interval, or, in 6 cases where pycalphad stops at a local optimum, pycalphad’s owncalculateat our point inside itall consistent - Phase diagrams: 203 certificates in five systems; pycalphad’s phases and compositions at every certificate pointall pass, windows ≤ 2×10⁻⁶
- Partition certificates: 7 systems at 67 temperatures; pycalphad’s
equilibriumat 3346 points of a composition gridall in a certified region with the same phases - Conditions on μB: 16 points in Al–Zn, Cu–Mg, Cr–Fe and COST 507 Al–Cu and Cu–Mg at pycalphad’s
MU(B); pycalphad’sMU(A), phase compositions, overall composition andGMunder the same conditioninside the Lean intervals and windows - Conditions on an activity: 17 points in Al–Zn, Cu–Mg, Cr–Fe and COST 507 Al–Cu and Cu–Mg, the activity converted from pycalphad’s
MU(B); pycalphad’s referenceMU,MU(A), phase compositions, overall composition andGM; a closed-form known answer with a pure-Ni reference compoundinside the Lean intervals; widths ≈ 10⁻⁹ J/mol - Thermodynamic properties: 713 points of
--calcin 21 systems (Al–Zn, Pb–Sn, Cu–Mg, Cr–Fe on both sides of Tc, Al–Fe, COST 507 Al–Cu and Cu–Mg with the Laves phase at fixed internal states, Al–Mg, and 12 binaries drawn from COST 507), every phase type; pycalphad’scalculateGM,SM,HM,CPM: largest relative distance to the Lean interval, non-magnetic / magnetic (inCPM, from pycalphad’s regularisation T/(Tc + 10⁻⁹))< 3×10⁻¹⁴ / 3.3×10⁻¹² - Properties: known answers from
regular_ref.tdb(liquid H = L₀x(1 − x), Cp = 0; a compound with Cp = 0.01); COST 507 Al at the breakpoint 933.47 K and just below it; tampered coefficients, missing internal states, site fractions above 1inside the Lean intervals; breakpoint rejected; tampering caught - Lean’s TDB reading against the driver’s: every database, phase set and equilibrium of the benchmark, and all binary systems of COST 507 at 800 K and 1300 K (595 certificates, 6518 phases)identical models; same phases left out, for the same reasons
- A model coefficient in a certificate changed by 0.01%accepted without
--tdb, rejected with it - Convexity certificates for six gaps (liquid Al–Ce, Fe–Si, Mg–Si, Cu–Si, Al–Ni; fcc Al–Zn): temperature bisected to 1 K; pycalphad’s G″ and its single-phase
equilibriumon either sideagree in every case - Known answer: a regular solution with one liquid phase (L₀ = 4000 J/mol), G and both chemical potentials in closed form; positive control with the driver run 1 K offinside the Lean intervals; caught
- COST 507 Al–Y: a terminal solubility of 1 − x ≈ 3×10⁻³⁷ at 300 K, written as an exact decimal, and x₀ exactly at the compound AlYcertified
- Tampered certificatesfail, or still-correct conclusions
- Forged certificates (adversarial review, 6 October): phase and component names with Unicode line breaks, tabs or non-breaking spaces that a script reading the output would split into forged
MODEL_OKorWINDOWlines; exponents such as 3E−999999999 that hung the checkerrejected since 6 October - Checking time per equilibrium; whole benchmark0.1 – 2.4 s; 218 s
- Driver under AddressSanitizer and UBSan, point equilibria and phase diagramsclean
- Report validation: every
Leanline in a report is the checker’s own output; a rejecting, crashing or missing checker makes the driver exit with an errorpass - Fuzzing of the driver under AddressSanitizer and UBSan (about 34 000 mutated inputs), after hardening its input parsingno memory errors, undefined behaviour or crashes
At Al–Fe 1000 K, x = 0.9, pycalphad’s multiphase equilibrium returns a GM 6×10⁻⁶ J/mol above its own calculate and its single-phase equilibrium at the same point — just outside the Lean interval. The certificate is right; the benchmark tolerance on pycalphad’s GM is 10⁻⁵ J/mol for this reason.
12
Research result: a certified audit of CALPHAD databases
Two questions floating-point software cannot settle: over what range of temperature and composition does a published database give physically sensible equilibria, and where does a general-purpose solver miss the true global equilibrium? Both need statements such as “no lower assemblage exists” and “this phase does not appear”, which is exactly what the certificates provide. The audit takes every binary system of the 17 databases shipped with pycalphad, COST 507 among them, on a grid from 300 K in steps of 100 K up to the database’s upper limit (at most 6000 K) and x = 0.02, 0.06, …, 0.98; it writes a certificate at every point, checks it in --tdb mode against the TDB file itself, and runs pycalphad on the same phases.
316 binary systems and 246 650 grid points, every one with a certificate the Lean checker accepted for the model its TDB file defines.
Anomalous liquid miscibility gaps
In five systems the liquid loses convexity at high temperature, so a liquid miscibility gap opens as the temperature rises — an artefact of extrapolated parameters, which these files declare valid up to 6000 K. Each onset is bracketed to 1 K with a proof at both ends: a convexity certificate below, and above, a point equilibrium of the liquid alone whose windows exclude x₀.
| Database | System | No liquid gap (proved) | Liquid gap (proved) | Liquid branches at the highest grid temperature |
|---|---|---|---|---|
| COST 507 | Fe–Si | 2177 K | 2178 K | 3500 K: 0.548 / 0.994 |
| COST 507 | Mg–Si | 2554 K | 2555 K | 2900 K: 0.568 / 0.866 |
| COST 507 | Cu–Si | 2603 K | 2604 K | 3100 K: 0.029 / 0.388 |
| COST 507 | Al–Ce | 2758 K | 2759 K | 2800 K: 0.708 / 0.836 |
| Al–Ni (Dupin 2001) | Al–Ni | 5053 K | 5054 K | 5900 K: 0.286 / 0.664 |
- pycalphad misses a miscibility gapIn the Fe–Ni database
FeNi_deep_branchingat 700 K and x(Ni) = 0.98, pycalphad returns a single fcc phase on the same set of phases. The certificate proves the equilibrium is two fcc phases, near x(Ni) = 0.9774 and 0.9881 — a narrow gap — and that pycalphad’s Gibbs energy is at least 0.37 J/mol too high. In COST 507 Fe–Mg (1000 K, x = 0.5) the phases agree but pycalphad’s Gibbs energy is at least 1.47 J/mol too high. At the other points, about 250 000, pycalphad’s value lies inside the Lean interval or less than 1 J/mol above it. - pycalphad misses a Laves phaseWith phases of two mixing sublattices included (CAL-C07), in COST 507 Cr–Ti at 300 K and x(Ti) = 0.34 pycalphad returns a single hcp phase (Gibbs energy +812.7 J/mol); the certificate proves that the equilibrium is the C15 Laves phase plus
ALM_D019at −9006.96 J/mol, so pycalphad is at least 9.8 kJ/mol too high (32 grid points in all). At 4 points in Mn–Ti pycalphad stops at a local internal state of the C14 Laves phase (at least 4.5 J/mol too high). - A driver bug found by the auditMolecular species made only of A and B — such as CU2 in COST 507’s CU6Y — were dropped as if they were unrelated elements, so the driver certified a different model from the TDB file; pycalphad’s Gibbs energy fell up to 128 J/mol below the Lean lower bound, which is how the model mismatch showed. It is fixed, and the Lean TDB reader marks such phases unsupported.
Limits: the conclusions hold at the listed grid points only; boundaries and gap edges between grid points are not certified. Phases the driver cannot model yet (three or more mixing sublattices, sublattice phases with missing endmembers, order–disorder, interstitial) are skipped — conclusions that something is not an equilibrium are unaffected, but “this phase appears” holds only among the phases included. Whether an anomaly is a defect needs a person: a real liquid gap (as in Al–Pb) or a compound stable above both melting points can be physical. The reports and representative certificates are archived in research/calphad-audit/ and re-checked by make verify-all.
13
Open gaps
- From TDB file to certified modelSince 4 October the checker builds the model from the TDB file in Lean (CAL-I01, B02), so the driver’s translation is out of the trust chain. What remains is whether Lean’s definition reads a TDB file as intended (A-CAL-01): it is cross-checked against the driver and pycalphad (T0), with no stronger evidence. A certificate checked without
--tdb— for instance when the TDB is piped in — still certifies only the model written in it. Since 7 October the--tdbmode also prints the TDB file’s SHA-256 (CAL-I04), and all names are escaped, so forged phase names can no longer inject output lines (CAL-I05). Earlier, fuzzing had found inputs the driver translated into a different model that the checker then accepted (3*T**1.5read as 3T + 0.5, truncated coefficients, a dropped phase), and the database audit found dropped molecular species; these were fixed, and the Lean reader follows the same rules for what to reject or skip. - No miscibility gap: magnetic phases and between temperaturesConvexity certificates cover non-magnetic substitutional solutions at a single temperature. Magnetic phases need second-derivative bounds on the magnetic term; nothing is certified between two temperatures;
CAL_FAILis not a proof of a gap. - Phase diagrams between grid temperaturesSince 5 October the partition certificate covers every composition at each grid temperature; temperatures between grid points are not certified, and a miscibility gap inside a single-phase window needs a separate convexity certificate.
- Order–disorder, interstitial, further sublattice and multicomponent modelsNot yet defined in Lean (phases with one or two mixing sublattices are supported). The driver skips such phases and lists them; the conclusions hold only for the phases included. Magnetic phases whose
TCorBMAGNdepends on log T are also skipped. - Thermodynamic properties at equilibriumSince 6 October G, S, H and Cp are certified for a phase at fixed composition, as pycalphad’s
calculate. Not yet: the equilibrium values (pycalphad’sequilibriumwith HM, SM, CPM, the phases weighted by their amounts); the derivatives of a two-mixing-sublattice phase under internal equilibrium (the certificate gives the fixed-internal-state values); magnetic phases at T = Tc, where Cp jumps; and, in--tdbmode, a temperature on a breakpoint of the piecewise expressions. - The driver itselfIts grid search and Newton iterations are untrusted (T0) and marked so in the report; every result passes through the checker.