Bump to version: v4.34.0 - #1661
Conversation
Bump mathlib and doc-gen4 to v4.34.0 in lakefile.toml, regenerate
lake-manifest.json, update lean-toolchain, and update the Lean badge in
README.md.
The library builds clean under v4.34.0 apart from one lemma, noted at the
end.
Substantive API changes adapted to:
* `MemLp f p μ` is now `eLpNorm f p μ < ∞` alone — `eLpNorm` itself carries
the a.e.-strong-measurability guard, so the old conjunction is gone.
`h.1` becomes `h.aestronglyMeasurable` and `h.2` becomes `h`; the `MemHS`
characterizations are rebuilt on `memLp_two_iff_integrable_sq_norm`.
Lemmas that were unconditional now take a measurability hypothesis
(`eLpNorm_one_eq_lintegral_enorm`, `eLpNorm_eq_lintegral_rpow_enorm_toReal`,
`eLpNorm_mono_enorm`, `Measure.map_smul`), and `eLpNorm_eq_zero_iff` dropped
its measurability side condition in exchange.
* `Equiv.module` and `Equiv.linearEquiv` take an `≃+` rather than an `≃`.
Each transferred `Module` instance now goes through an explicit
`AddEquiv` (`toFin1dℝAddEquiv`, `toFin2ℂAddEquiv`, `toFin13ℂAddEquiv`,
and inline ones for the Standard Model fermion types); this also repairs
the `val_smul`/`norm_eq_val`/basis `rfl` lemmas that rest on them.
* `LinearPMap.ker` is now mathlib's submodule-valued kernel, so
`inverse_apply_eq`, `inverse_range` and `inverse_closed_iff` want
`f.ker = ⊥`. `LinearPMap.toFun_ker_eq_bot_iff` bridges physlib's
`f.toFun.ker = ⊥` spelling, which the spectral theory uses throughout.
* `IsCompact.elim_finite_subfamily_closed` is stated with `Disjoint`
rather than `_ ∩ _ = ∅`.
* Signature changes: `Matrix.PosSemidef.dotProduct_mulVec_zero_iff` and
`ContinuousLinearMap.nonneg_iff_isPositive` made their subject implicit;
`IsSelfAdjoint.le_algebraMap_norm_self` takes the element explicitly with
self-adjointness as an auto-param;
`CStarAlgebra.norm_le_norm_of_le_of_nonneg` swapped its hypotheses;
the ordered-semiring `Finset.prod_le_prod` is `Finset.prod_le_prod₀` and
`Finset.sum_nonneg'` folded into `Finset.sum_nonneg`;
`Unitary.conjStarAlgAut` yields a `StarAlgEquiv`;
`IsReindexing.topologicalGroup` and friends gained `is` prefixes.
* `Module.Basis.repr_reindex` no longer beta-reduces the `Finsupp`
re-indexing, so the tensor-component proofs need
`Finsupp.equivMapDomain_apply` before `Module.Basis.repr_reindex_apply`.
* `Mathlib.Data.{Real,Complex,NNReal}.Basic` moved to `Mathlib.Basic.*`;
`IsTopologicalGroup (GL n R)` now needs `Mathlib.Topology.Algebra.Group.Units`;
`mfderiv_eq_fderiv` moved to `Mathlib.Geometry.Manifold.MFDeriv.NormedSpace`.
* Renames: `if_pos`/`if_neg`/`dif_pos`/`dif_neg`/`if_true` to
`ite_eq_left`/`ite_eq_right`/`dite_eq_left`/`dite_eq_right`/`ite_true`;
`LinearMapClass.linearMap` to `LinearMap.ofClass`; `tsum_apply` to
`Pi.tsum_apply`; `TensorProduct.induction_on` to
`TensorProduct.inductionOn` (which drops the `zero` case, so
`CompleteTensorProduct.induction_on` loses its now-redundant `zero`
hypothesis too); `AddLeftCancelMonoid.add_eq_zero` to `Nat.add_eq_zero_iff`;
`Submodule.coe_norm` to `Submodule.norm_coe`, whose orientation is
reversed.
Not yet resolved: `PauliMatrix.leviCivita_mul_pauliDual` in
`Physlib/Relativity/PauliMatrices/Relations.lean` no longer passes the
kernel. Its proof rewrites with `prodT_permT_right` and `contrT_permT`,
and the resulting proof term forces the kernel to reduce the `IsReindexing`
transport, which goes through `IsReindexing.inv = Fintype.bijInv`. Under
v4.34 that reduction no longer terminates in budget; `set_option
diagnostics true` on the unifier shows it grinding on `Fin.succSuccAbove`,
`Fin.append` and `IsReindexing.toEquiv`, and reports
`Fin.addCases._proof_2` as a non-exposed definition it tried and failed to
unfold. Raising `maxRecDepth`/`maxHeartbeats` only trades the deterministic
timeout for deep recursion and drives elaboration past 130 GB, so it is not
a usable workaround.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…nents `leviCivita_mul_pauliDual` was proved by rewriting with `prodT_permT_right` and `contrT_permT` and discharging the resulting `permT_congr` obligations with `decide`/`rfl`. Under v4.34 that proof term makes the kernel reduce the `IsReindexing` transport, which goes through `IsReindexing.inv = Fintype.bijInv`, and the reduction does not terminate in budget: `(kernel) deterministic timeout`. Take the route the neighbouring identities in this file already take and push both sides to rational components first. `toTensor_dualLorentz_eq_ofRat` and `pauliCo_eq_ofRat` have the same right-hand side, so after `prodT_ofRat_ofRat` and `contrT_ofRat` the two sides are `ofRat` of the same function, separated only by the identity reindexing `![0, 1, 2, 3, 4]`. Closing that through the basis, as `pauliContr_mul_pauliContrDown_mul_pauliContr` does, avoids asking the kernel to reduce `Fintype.bijInv` at all. The lemma needs no `set_option`: it elaborates and kernel-checks in ~85 s. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`PhyslibAlpha` is not in `defaultTargets`, so `lake build` does not reach it;
it has its own CI workflow (`.github/workflows/alphaBuild.yml`) and needed its
own port. `lake build PhyslibAlpha` is now green (9278 jobs) and
`lake exe runPhyslibAlphaLinters`, `noAlphaImports` and `alphaFileImports` all
pass.
Changes beyond the ones already described for `Physlib` and `QuantumInfo`:
* `AddMonoidAlgebra` is a structure with a `coeff : M →₀ R` field, so
`MvPolynomial.coeff` is gone and the argument order is reversed:
`coeff m p` becomes `p.coeff m`. `coeff_add` is
`AddMonoidAlgebra.coeff_add` and states a `Finsupp` equality, so it needs
`Finsupp.add_apply` beside it.
* `spectralRadius` is defined over `quasispectrum`, not `spectrum`.
`spectralRadius_eq_of_unital` bridges the two in a unital algebra;
`le_iSup₂` then needs its `f` pinned explicitly, as `(α := ENNReal)` no
longer determines it.
* `TensorProduct.induction_on` is `TensorProduct.inductionOn` and has dropped
its `zero` case, so each `refine`/`induction … with` site loses one bullet.
* `IsSelfAdjoint.map` and `CStarAlgebra.pow_antitone` swapped their arguments;
`ContinuousLinearMap.le_def` and `InnerProductSpace.le_def` made their
operands implicit; `Filter.Tendsto.eventually` no longer infers its
predicate from the goal.
* `Measure.isProbabilityMeasure_map` is now the iff
`Measure.isProbabilityMeasure_map_iff`, in the opposite direction.
* Module moves: `MeasureTheory.VectorMeasure.{map, mapRange}` to
`Mathlib.MeasureTheory.VectorMeasure.Operations`;
`CStarAlgebra.exists_sum_four_nonneg` to
`Mathlib.Analysis.CStarAlgebra.SpecialFunctions.PosPart`; `CFC.sqrt` to
`…ContinuousFunctionalCalculus.Rpow.Basic`;
`CStarAlgebra.norm_le_iff_le_algebraMap` to
`…ContinuousFunctionalCalculus.Order`; `Mathlib.Data.ENNReal.*` to
`Mathlib.Basic.ENNReal.*`; `Mathlib.MeasureTheory.Integral.SetToL1` split
into five modules.
* `convert` leaves one goal fewer at several sites where the leading case is
now closed automatically, and `eLpNorm_one_eq_lintegral_enorm` takes a
measurability hypothesis whose implicit `f` must be given eta-expanded for
`rw` to match.
* `Space.IsDistBounded`'s anonymous `HasTemperateGrowth` instance is now
reached by `infer_instance` rather than by its autogenerated name.
* `quadRep_add_square_polarized` needs `maxHeartbeats 500000`; the file
elaborates in ~28 s.
`stdSimplex` is deprecated in favour of `Convexity.StdSimplex`, which is a
structure rather than a set. That is a change to PhyslibAlpha's own API and
to its users, not a rename, so the eight deprecation warnings are left in
place.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Simp got stronger and several arguments and `using` terms stopped doing any work, so the unused-simp-argument, `simpa`-for-`simp` and `<;>`-for-`;` linters now fire across `PhyslibAlpha`. Drop the dead arguments, replace the `simpa … using e` calls whose `e` is no longer needed, sequence the two single-goal `convert … <;> …` chains with `;`, prefix the three unreferenced binders with `_`, and use `let` where `letI` inlined a proof. Also `omit` the section variables that `runPhyslibAlphaLinters` reported as unused arguments on `ContinuousLinearMap.traceₚ_isTracial` and `TraceClass.real_inner_mono_of_le`, and drop `[Nontrivial E]` from `JBAlgebra.ClosedGeneratedByOne.spectralRadius_le_norm`, which its new proof through `spectralRadius_le_nnnorm` no longer needs. That linter is gated by `.github/workflows/alphaBuild.yml` and now passes. Four `automatically included section variable(s) unused` warnings are left alone: each is on a declaration already carrying `@[nolint unusedArguments]`, and `stoneCandidateDomainPred_add`'s docstring states that the parameter is retained deliberately so the lemma matches `stoneCandidateDomain`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
nateabr
left a comment
There was a problem hiding this comment.
Thank you for working on this bump, a suggestion below on how we could fix lake exe TODO_to_yml
Within scripts/MetaPrograms/TODO_to_yml.lean there is a line in the last section:
let env ← importModules (loadExts := true) #[Physlib, QuantumInfo, PhyslibAlpha] {} 0`
This loads Physlib, QuantumInfo, and PhyslibAlpha into one Lean environment. Since Physlib and Alpha both expose QuantumMechanics.HarmonicOscillator.potentialFunction, Lean rejects the second declaration (you had already called this out in your zulip message).
The diff of this PR does not change the script itself so I am not able to suggest code but could we try implementing the follwing schematic in the file I mentioned.
environment A: Physlib + QuantumInfo → collect TODO records
environment B: PhyslibAlpha → collect TODO records
merge the two record lists → global tag check → one YAML file
let me know if this makes sense
|
just a heads-up: I happen to be doing some performance improvements, and my improvements apply to your proposed change in |
|
@nateabr what is your opinion on this? Should we fix the Todo thing now? Or merge this first? If the latter would you mind doing a full review? |
|
@jstoobysmith I actually have gone through this in detail before and I believe this looks good and is ready to merge. I am happy to do the todo fix as a follow up |
|
@zhikaip Is it okay if we merge this one first? |
|
Sure I will rebase my branch. Merging now |
…auliDual The component proof of `leviCivita_mul_pauliDual` (#1661) evaluates `ε4ℂ` 2048 times under `decide +kernel`. With `leviCivita_eq_ofRat` each evaluation is a 4x4 determinant; `leviCivita_eq_ofRat_prod` makes it a product of signs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…signs (#1664) * perf(PauliMatrices): cheaper Levi-Civita components in the three-Pauli identities The three-Pauli identities (2.26) and (2.27) are proved by `decide +kernel` over all tensor components. The components of `ε4ℂ` were given by `generalizedKroneckerDelta`, a 4x4 determinant, which the kernel evaluated 1024 times per lemma as a sum over permutations with `Equiv.Perm.sign`. - Add `leviCivitaSymbolProd`, the product over pairs `i < j` of the sign of `g j - g i`, and `leviCivitaSymbol_eq_leviCivitaSymbolProd` (any `Fin n`, via `Equiv.Perm.sign_eq_prod_prod_Ioi`). - Add `leviCivita_eq_ofRat_prod` stating the components of `ε4ℂ` with it, and use it in the two identities. - In the two identities rewrite with `I_mul_toComplexNum` only inside the last summand instead of across the whole goal. Identity (2.27) was at the default `maxHeartbeats` limit. Kernel `decide`: 289M -> 73M and 301M -> 78M heartbeats. No statement changed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * perf(PauliMatrices): use leviCivita_eq_ofRat_prod in leviCivita_mul_pauliDual The component proof of `leviCivita_mul_pauliDual` (#1661) evaluates `ε4ℂ` 2048 times under `decide +kernel`. With `leviCivita_eq_ofRat` each evaluation is a 4x4 determinant; `leviCivita_eq_ofRat_prod` makes it a product of signs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(LeviCivita): state the closed form of leviCivitaSymbol without a definition Remove the definition `leviCivitaSymbolProd`. The closed form is now the right-hand side of `leviCivitaSymbol_eq_prod_prod_Ioi` (renamed from `leviCivitaSymbol_eq_leviCivitaSymbolProd`), and `leviCivita_eq_ofRat_prod` states the components of `ε4ℂ` with the product written out. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Bumps mathlib and doc-gen4 to
v4.34.0and the toolchain toleanprover/lean4:v4.34.0.Closes #1656.
Both libraries build clean and every linter CI gates on passes:
lake buildlake build PhyslibAlphacheck_file_imports,check_dup_tags,sorry_lint,runPhyslibLintersrunPhyslibAlphaLinters,noAlphaImports,alphaFileImportsscripts/lint-style.sh,scripts/PhyslibAlpha/alphaPythonLinters.shDeprecation warnings in
Physlib/QuantumInfoare down from 147 to 9.All 20 remaining warnings are deliberate and listed at the end.
Four commits, in the order they are worth reading:
chore: Bump to Lean v4.34.0— the bump and the mechanical port.fix(PauliMatrices): prove leviCivita_mul_pauliDual via rational components— the only proof whose strategy changed; see below.
chore(PhyslibAlpha): port to Lean v4.34.0—PhyslibAlphais not indefaultTargets, solake buildnever reaches it. Ithas its own CI workflow and needed its own port.
chore(PhyslibAlpha): clear the linter warnings v4.34.0 surfaced.This bump touches 176 files, so every section below links its declarations, call
sites and warnings straight to source — the diff is wide but shallow, and the links
are there to spare reviewers the hunt. They resolve against this PR's head commit
(
1bc0543) in this repository rather than the branch on my fork, so theysurvive the merge and the branch's deletion and still work for anyone reading this
PR later. They pin the code as submitted; I will regenerate them if I force-push.
Checklist (#1656)
Basics
v4.34.0inlakefile.tomlv4.34.0inlakefile.tomlrm -rf .lake+lake update(lake-manifest.json)lean-toolchainupdated toleanprover/lean4:v4.34.0README.mdBuild
lake buildlake build PhyslibAlpha(not indefaultTargets;gated separately by
.github/workflows/alphaBuild.yml)Scripts
lake exe lint_alllake exe TODO_to_yml mkFile— blocked, and not by thisPR; see below
lake exe stats mkHTMLlake exe informal mkFile mkDot mkHTMLlake exe make_tagAfterwards (mine to do, not in this PR)
Reviewer map
lakefile.toml,lean-toolchain,lake-manifest.json,README.md— the bumpproper.
Physlib/Relativity/PauliMatrices/Relations.lean— the oneproof whose strategy changed; its own commit, see below.
Physlib/Mathematics/LinearPMap.lean— the one new lemma, andthe only place this PR adds API rather than adapting to it.
Module-instance files (§ Declarations added) — fourteen files, onemechanical change each: real and complex
Lorentz vectors, the four Weyl fermions, the
five Standard Model fermions,
Dirac,FiniteHilbertSpaceandReferenceFrame.Vector.…/HilbertSpaces/OneDimension/Basic.leanand…/TensorProducts/CompleteTensorProduct.lean— the twoplaces where a physlib-facing signature or characterization changed, not just
a proof.
the index.
Declarations added
No declarations were removed.
LinearPMap.toFun_ker_eq_bot_iffPhyslib/Mathematics/LinearPMap.leanLinearPMap.keris now mathlib's submodule-valued kernel, soinverse_apply_eq,inverse_rangeandinverse_closed_iffwantf.ker = ⊥. Physlib's spectral theory saysf.toFun.ker = ⊥throughout; this bridges the two spellings once instead of at each of the 21 call sites — 7 inSpectralTheory/Basic.lean, 4 inCayley/Basic.lean, 5 inCayley/Inverse.lean, 2 inCayleySpectralData/Construction.leanand 3 inSpectralIntegral/SpecTheorem.lean.Lorentz.ContrMod.toFin1dℝAddEquiv,Lorentz.CoMod.toFin1dℝAddEquiv…/RealTensor/Vector/Pre/Modules.leanEquiv.moduleandEquiv.linearEquivnow take an≃+.Lorentz.ContrℂModule.toFin13ℂAddEquiv,Lorentz.CoℂModule.toFin13ℂAddEquiv…/ComplexTensor/Vector/Pre/Modules.leantoFin2ℂAddEquiv×4:LeftHanded,RightHanded,DualLeftHanded,DualRightHandedPhyslib/Relativity/Fermions/Weyl/Each
toFin…AddEquivis the existingtoFin…Funequivalence packaged withmap_add' _ _ := rfl; the old equivalences are untouched and still carry theAddCommGroupinstances. The Standard Model fermion types(
DownSinglet,LeptonDoublet,LeptonSinglet,QuarkDoublet,UpSinglet),Dirac,FiniteHilbertSpaceandReferenceFrame.Vectorget the same treatment inline, since eachhad exactly one use.
Signature changes to watch
Both are physlib-facing, so they are called out rather than left in the diff.
CompleteTensorProduct.induction_onloses itszerohypothesis, following mathlib renaming
TensorProduct.induction_ontoTensorProduct.inductionOnand dropping itszerocase:JBAlgebra.ClosedGeneratedByOne.spectralRadius_le_normdrops
[Nontrivial E], which its new proof throughspectralRadius_le_nnnormdoes not need, and which
runPhyslibAlphaLintersflags as an unusedargument.
API changes adapted to —
PhyslibandQuantumInfoMemLp f p μis noweLpNorm f p μ < ∞alone —eLpNormitself carriesthe a.e.-strong-measurability guard, so the old conjunction is gone.
h.1becomes
h.aestronglyMeasurableandh.2becomesh; theMemHScharacterizations are rebuilt onmemHS_iffviamemLp_two_iff_integrable_sq_norm. Lemmasthat were unconditional now take a measurability hypothesis
(
eLpNorm_one_eq_lintegral_enorm,eLpNorm_eq_lintegral_rpow_enorm_toReal,eLpNorm_mono_enorm,Measure.map_smul), andeLpNorm_eq_zero_iffdroppedits measurability side condition in exchange.
Equiv.module/Equiv.linearEquivtake an≃+— see § Declarationsadded. This also repairs the
val_smul/norm_eq_val/ basisrfllemmasthat rest on those instances.
LinearPMap.keris mathlib's submodule-valued kernel — seetoFun_ker_eq_bot_iffabove.IsCompact.elim_finite_subfamily_closedis stated withDisjointratherthan
_ ∩ _ = ∅.Signature changes:
Matrix.PosSemidef.dotProduct_mulVec_zero_iffandContinuousLinearMap.nonneg_iff_isPositivemade their subject implicit;IsSelfAdjoint.le_algebraMap_norm_selftakes the element explicitly withself-adjointness as an auto-param;
CStarAlgebra.norm_le_norm_of_le_of_nonnegswapped its hypotheses; theordered-semiring
Finset.prod_le_prodisFinset.prod_le_prod₀andFinset.sum_nonneg'folded intoFinset.sum_nonneg;Unitary.conjStarAlgAutyields aStarAlgEquiv;IsReindexing.topologicalGroupand friends gainedisprefixes.Module.Basis.repr_reindexno longer beta-reduces theFinsuppre-indexing, so the tensor-component proofs need
Finsupp.equivMapDomain_applybeforeModule.Basis.repr_reindex_apply— forexample in
Kinematics/FieldStrength.lean.Moves:
Mathlib.Data.{Real,Complex,NNReal}.Basic→Mathlib.Basic.*;IsTopologicalGroup (GL n R)now needsMathlib.Topology.Algebra.Group.Units;mfderiv_eq_fderiv→Mathlib.Geometry.Manifold.MFDeriv.NormedSpace.Renames:
if_pos/if_neg/dif_pos/dif_neg/if_true→ite_eq_left/ite_eq_right/dite_eq_left/dite_eq_right/ite_true;LinearMapClass.linearMap→LinearMap.ofClass;tsum_apply→Pi.tsum_apply;TensorProduct.induction_on→TensorProduct.inductionOn;AddLeftCancelMonoid.add_eq_zero→Nat.add_eq_zero_iff;Submodule.coe_norm→Submodule.norm_coe, whose orientation is reversed(
coe_norm : ‖x‖ = ‖↑x‖butnorm_coe : ‖↑x‖ = ‖x‖) — a blanket renamesilently breaks
SpectralTheory/Basic.lean.One rename has a trap worth recording.
LinearMapClass.linearMapis now adeprecated alias for
LinearMap.ofClass, and analiasis a distinctconstant, so
@[simp, norm_cast] LinearMap.coe_ofClass : ⇑(ofClass f) = fdoesnot fire under the old spelling.
Channels/Dual.leanthereforeneeded its call sites actually renamed; silencing the deprecation warning would
have left the simp set silently weaker.
API changes adapted to —
PhyslibAlphaEverything above applies there too. Beyond it:
AddMonoidAlgebrais a structure with acoeff : M →₀ Rfield.MvPolynomial.coeffis gone and the argument order is reversed:coeff m pbecomes
p.coeff m.coeff_addisAddMonoidAlgebra.coeff_addand states aFinsuppequality, so it needsFinsupp.add_applybeside it — seeTwoHDM/ChargeBalance.leanandTwoHDM/Invariants.lean, the latter also movingmonomial_multomonomial_mul_monomial.spectralRadiusis defined overquasispectrum, notspectrum.spectralRadius_eq_of_unitalbridges the two in a unital algebra, andle_iSup₂then needs itsfpinned explicitly —(α := ENNReal)no longerdetermines it. See
JB/GeneratedByOne/Spectrum.lean.TensorProduct.inductionOndrops thezerocase, so eachrefine/induction … withsite loses one bullet. Nine sites inStinespring/Dilation.leanalone.Argument-order and implicitness changes:
IsSelfAdjoint.mapandCStarAlgebra.pow_antitoneswapped their arguments;ContinuousLinearMap.le_defandInnerProductSpace.le_defmade theiroperands implicit;
Filter.Tendsto.eventuallynolonger infers its predicate from the goal.
Measure.isProbabilityMeasure_mapis now the iffMeasure.isProbabilityMeasure_map_iff, stated in the opposite direction —CStarAlgebra/SpectralMeasure.lean.Module moves:
MeasureTheory.VectorMeasure.{map, mapRange}→Mathlib.MeasureTheory.VectorMeasure.Operations(one import fixed 17 errors in a single file);
CStarAlgebra.exists_sum_four_nonneg→…CStarAlgebra.SpecialFunctions.PosPart;CFC.sqrt→…ContinuousFunctionalCalculus.Rpow.Basic;CStarAlgebra.norm_le_iff_le_algebraMap→…ContinuousFunctionalCalculus.Order;Mathlib.Data.ENNReal.*→Mathlib.Basic.ENNReal.*;Mathlib.MeasureTheory.Integral.SetToL1split intofive modules.
convertleaves one goal fewer at several sites where the leading case isnow closed automatically, and
eLpNorm_one_eq_lintegral_enorm's newmeasurability hypothesis must have its implicit
fgiven eta-expanded forrwto match —CayleySpectralData/SpecTheorem.lean.Space.IsDistBounded's anonymousHasTemperateGrowthinstance is reached by
infer_instancerather than by itsautogenerated name, which changed.
quadRep_add_square_polarizedneedsmaxHeartbeats 500000— the smallest of 300k/400k/500k/600k/800k/1M thatpasses. The file elaborates in ~28 s.
PauliMatrix.leviCivita_mul_pauliDualneeded a new proofThis is the only proof in the PR whose strategy changed, so it is in its own
commit. The statement of
leviCivita_mul_pauliDualisunchanged.
Under v4.34 the old proof fails in the kernel, verbatim:
(the second is the cascade into
pauliContr_mul_pauliContrDown_mul_pauliContr). It was:prodT_permT_rightandcontrT_permTleave a proof term that makes the kernel reduce the
IsReindexingtransport,which goes through
IsReindexing.inv σ h = Fintype.bijInv h.1.set_option diagnostics trueon the unifier shows it grinding onNat.rec ↦ 187008,Fin.succSuccAbove ↦ 33186,IsReindexing.toEquiv ↦ 19833,and reporting
Fin.addCases._proof_2 ↦ 2989under "Axioms (possibly importednon-exposed defs) that were tried to be unfolded" —
Fin.addCasesbeing theworkhorse of
Fin.append, which is how the contracted color function is built.No
set_optionrescues it. Measured:maxHeartbeats 1000000+maxRecDepth 8000turns the timeout into(kernel) deep recursion detected;backward.isDefEq.respectTransparency falselets elaboration finish but thekernel still times out; adding
maxRecDepth 20000on top ran 10 minutes to133 GB RSS before I killed it. Raising limits is not a usable workaround even
setting CI aside.
The new proof takes the route the neighboring identities in this file already
take — push both sides to rational components first:
conv_lhs => simp only [leviCivita_eq_ofRat, toTensor_dualLorentz_eq_ofRat] rw [prodT_ofRat_ofRat, contrT_ofRat] conv_rhs => simp only [leviCivita_eq_ofRat, pauliCo_eq_ofRat] rw [prodT_ofRat_ofRat, contrT_ofRat] apply (Tensor.basis _).repr.injective ext b rw [ofRat_basis_repr_apply, permT_basis_repr_symm_apply, ofRat_basis_repr_apply] apply (Function.Injective.eq_iff Physlib.RatComplexNum.toComplexNum_injective).mpr decide +revert +kerneltoTensor_dualLorentz_eq_ofRatandpauliCo_eq_ofRathave the same right-hand side, so afterprodT_ofRat_ofRatandcontrT_ofRatthetwo sides are
ofRatof the same function, separated only by the identityreindexing
![0, 1, 2, 3, 4]. Going throughofRat_basis_repr_applyandpermT_basis_repr_symm_apply— aspauliContr_mul_pauliContrDown_mul_pauliContralready does —discharges that without asking the kernel to reduce
Fintype.bijInvat all. Thesupporting facts are
leviCivita_eq_ofRat,pauliDual_eq_pauliCoandRatComplexNum.toComplexNum_injective.It needs no
set_option, and elaborates and kernel-checks in about 85 s.Two things I could not make work, in case one of them is the proof you would
prefer:
congron the residualofRat f = permT ![0,1,2,3,4] _ (ofRat f)times out at whnf even at 10⁶heartbeats, and
permT_congr_eq_idcannot be appliedthere because unifying the two color functions — they differ by
Function.update ![up, upL, upR] 0 (τ up)versus![down, upL, upR]— isitself the divergent reduction.
lake exe TODO_to_yml mkFileis blocked, and not by this PRTODO_to_ymlimports both libraries into one environment — ithas a
PhyslibAlphacategory — and they both declareQuantumMechanics.HarmonicOscillator.potentialFunction:Physlib/QuantumMechanics/HarmonicOscillator/Basic.lean:186and
PhyslibAlpha/QuantumMechanics/HarmonicOscillator/Basic.lean:175.Both declarations are present on
masterat those same lines and neither fileis touched by this branch. Resolving it means renaming one of the two, which is
a content decision, so I have left it. Happy to file it separately if that is
useful.
The
lint_alltransitive-import sectionlake exe lint_allexits 0 and every section CI gates on passes. Its lastsection,
(7/7) Transitive imports, reports 74 files. Thatsection is not gated — CI runs
check_file_imports,check_dup_tags,sorry_lintandrunPhyslibLinters, notlint_all— and Ileft all 74 alone, because acting on it is not safe as stated. Removing
the two imports it flags in
Physlib/SpaceAndTime/Time/Derivatives.lean(
Mathlib.Analysis.Calculus.Deriv.InvandMathlib.Analysis.InnerProductSpace.Calculus) breaks that file:at this site, plus an unsolved
deriv Inv.invgoalin
deriv_div. Under the module system the linter'sreachability notion and
public importre-export do not agree, so its output isadvisory. Worth a separate issue rather than anything in a bump.
The 20 remaining warnings, and why each is left
List.tfae_cons_self(Physlib) —tfae_cons_of_memcarries amembership side condition; a naive rename makes
simpreport "simp made noprogress" in
equationOfMotion_tfae(
ClassicalMechanics/HarmonicOscillator/Basic.lean:750,752,754) andSimplePendulum.equationOfMotion_tfae(
SimplePendulum/Hamiltonian.lean:312,315,319).peelsyntax —Matrix.lean:720,LimSupInf.lean:177,Filter.lean:49;gconvert/congr!restructure the proof.stdSimplex(PhyslibAlpha) —Convexity.StdSimplexis astructure, not a set, so this changes PhyslibAlpha's own API and its users,
not just a name. Five in
OrderUnit/State/Convex.lean(lines 50, 56, 61, 66, 73) and two in
Measurement/Basic.lean(lines 70, 82).automatically included section variable(s) unused(PhyslibAlpha) —stoneCandidateDomainPred_add,rankOne_self_diagonal,hilbertSchmidtPartial_applyandmul_rankOne_apply_left. Each already carries@[nolint unusedArguments], andstoneCandidateDomainPred_add's docstringstates the parameter is retained deliberately so the lemma matches
stoneCandidateDomain.None of these belong in a bump; all four groups are easy follow-ups.
Notes on this PR
Produced with AI assistance (Claude Opus 5); the commits carry a
Co-authored-bytrailer. PerAI-POLICY.md§1.7 and§2.2 I have reviewed the diff and vouch for it.