auto-task(CanonicalEnsemble): add API-map.yaml tracking the canonical ensemble API#1367
Conversation
… ensemble API Co-authored-by: Claude <noreply@anthropic.com>
|
Thank you for this PR, which will now be reviewed. If submitting to ./Physlib or ./QuantumInfo, please see our review guidelines if you are not familiar with the process. You should expect a back and forth with a reviewer before your PR is merged. See also that link for how to add appropriate labels to your PR. The PR will also go through a number of automated checks. You can learn more about these here, including how to run them locally. If you are submitting to ./PhyslibAlpha there will be a lighter review process, though your PR must still pass the automated checks. If you want to bring attention to this PR, please write a message on this thread of the Lean Zulip. Important: If a reviewer adds an |
Summary
Adds
Physlib/StatisticalMechanics/CanonicalEnsemble/API-map.yaml, the in-repo tracker for theCanonical ensemble API (
Physlib/StatisticalMechanics/CanonicalEnsemble/). The map isgenerated from the directory's four Lean files (
Basic.lean,Lemmas.lean,Finite.lean,TwoState.lean), with GitHub issue#892 "API: Canonical Ensemble"
used only as a reference for intended scope. No Lean source is touched;
lake buildstays green(a YAML-only change).
This redoes PR #1266, which was
approved ("Looks good!") and then closed at the maintainer's request specifically so it could
be resubmitted with this improved tick-box description. The directory has no
API-map.yamlonmaster, and no open PR adds or edits one (checkedgh pr listand the changed files of thelikely candidates).
Links below pin commit
2e21835aso line numbers are stable.A note on the issue vs. the code
Issue #892 is a stub carrying the
requirements-neededlabel — it has no requirementchecklist — so every requirement below was generated from what the directory's Lean files
actually contain, and each
doneflag was decided by reading the code. The twodone: falseitems are not invented: they come from the directory's own
informal_lemmaplaceholders inTwoState.lean. The issue's only concrete datum, "Parent APIs: #861" (Temperature), matches thecode's imports and is used for
ParentAPIs.Field-by-field justification (reviewer tick-box)
Title/OverviewGrounded in the
Basic.leanmodule docstring(
Basic.lean#L10-L27):and its "Roadmap" section
(
Basic.lean#L95-L100):ParentAPIsDetermined from the only Physlib API import in the directory
(
Basic.lean#L9):public import Physlib.Thermodynamics.Temperature.Basicwhich is used throughout via
Temperature,T.β, andkB(e.g.Basic.lean#L319-L320).Issue #892 agrees: its "Parent APIs" section lists exactly
#861 "API: Temperature".
ReferencesTaken verbatim from the module docstrings — nothing invented.
Basic.lean§8 References(
Basic.lean#L88-L93):The §31 pin comes from
Finite.lean(
Finite.lean#L42-L45).Requirements
✅ 1. Key data structure and composition operations
Basic.lean#L108-L128:Composition:
HAddinstanceBasic.lean#L147-L159,congrBasic.lean#L168-L180,nsmulBasic.lean#L188-L196:✅ 2. Boltzmann measure, probability measure, and densities
μBoltBasic.lean#L318-L320:μProdBasic.lean#L514-L517,probabilityBasic.lean#L480-L486,physicalProbabilityBasic.lean#L908-L912.✅ 3. Mathematical and physical partition functions
Basic.lean#L401-L404and
Basic.lean#L756-L758:Positivity:
mathematicalPartitionFunction_posBasic.lean#L469-L474,partitionFunction_posBasic.lean#L765-L771.✅ 4. Mean energy, mean-square energy, variance
Basic.lean#L630-L639:Variance identity
Lemmas.lean#L656-L661:✅ 5. Helmholtz free energy
Basic.lean#L837-L840:✅ 6. Differential, thermodynamic, and Shannon entropies
differentialEntropyBasic.lean#L693-L697,thermodynamicEntropyBasic.lean#L1023-L1027:shannonEntropyFinite.lean#L160-L165,equality theorem
Finite.lean#L281-L286:✅ 7. Fundamental identity
F = U - T SLemmas.lean#L241-L250:✅ 8. Response formula
U = -∂_β log ZLemmas.lean#L628-L642:(The mathematical-partition-function version
meanEnergy_eq_neg_deriv_log_mathZ_of_betais atLemmas.lean#L453-L464.)✅ 9. Heat capacity and fluctuation-dissipation theorem
heatCapacityLemmas.lean#L702-L704,parametric FDT
Lemmas.lean#L731-L738,and the finite case
Finite.lean#L473-L476:✅ 10. Finite (discrete) specialization
Finite.lean#L62-L69:Sum reductions
Finite.lean#L174-L177and
Finite.lean#L201-L202:✅ 11. Two-state ensemble with closed forms
TwoState.lean#L27-L33:Closed forms:
TwoState.lean#L39-L42(partition function),
TwoState.lean#L60-L62/
TwoState.lean#L77-L79(probabilities),
TwoState.lean#L94-L96(mean energy).
❌ 12. Two-state entropy simplification (not yet done)
Taken from the directory's own placeholder — an
informal_lemma, i.e. a stated-but-unprovenTODO
(
TwoState.lean#L101-L104):❌ 13. Two-state Helmholtz free energy simplification (not yet done)
Likewise from the directory's
informal_lemmaplaceholder(
TwoState.lean#L106-L109):Verification
python -c "import yaml; yaml.safe_load(...)") and follows the v0.1 schemaexactly (only the six prescribed top-level fields; every
done: truehas a real location,every
done: falsehaslocation: N/A).locationwas confirmed present in the current sources byreading the files and by grep.
lake buildpasses — no Lean file is touched by this PR.🤖 Generated with Claude Code