Skip to content

Port positivity for the weighted diffusion semigroup - #1031

Merged
Vilin97 merged 4 commits into
mainfrom
feature/acquisition-20261126-friedrichs-positivity
Nov 26, 2026
Merged

Vilin97 merged 4 commits into
mainfrom
feature/acquisition-20261126-friedrichs-positivity

Conversation

@Vilin97

@Vilin97 Vilin97 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Ready for review. Ports the smooth compactly supported core of the weighted diffusion generator and proves that its Friedrichs resolvents and semigroup preserve almost-everywhere nonnegativity. This is the Hilbert-space step toward constructing Markov transition kernels for the Riemannian cutoff argument.

Mathematics and source

  • For a smooth potential and its finite weighted measure, the negative generator on smooth compactly supported functions is densely defined, symmetric and nonnegative in real (L^2). Its core energy is the integral of the gradient pairing.
  • The resolvent comparison argument applies to a smooth scalar contraction lifted to (L^2). Resolvent positivity passes to the semigroup through Euler convergence and closure of the nonnegative cone.
  • The source is the Chafaï–Fathi formalization at Apache-2.0 revision f3bf3663cfe743aaf74cd76bb2a7076c816a176f. The first public formalization commit is dated October 25, 2026 at 07:59:31 UTC. Djalil Chafaï directed the AI agents that wrote the proofs and reviewed the registered statements. First commit · Pinned source and license · Palomar record

Port and validation

The GPT review prompted two changes. The density proof now bounds the uniform approximation error with Mathlib’s Lp.norm_le_of_ae_bound and combines the approximations with the triangle inequality. The positivity proof invokes FormData.semigroup_mapsTo on the closed ordered cone and translates nonnegativity with Lp.coeFn_nonneg. The follow-up uses Mathlib’s Lp distance lemmas for the continuous approximation and uses the contraction’s Lipschitz estimate directly. The public integrable_carre lemma in DiffusionForm supports the follow-up energy bounds and applies to measures finite on compact sets. The unused testSub_bounded wrapper was removed.

  • Three modules adapt upstream DiffForm, DiffForm1, DiffForm2, DiffusionRegular, and DiffMarkov1 to the Pool’s existing Friedrichs construction, weighted integration by parts and operator calculus. The proof uses Mathlib’s linearity of the (L^p) embedding and Tau Ceti’s support and gradient results. The port uses Lean 4.36.0, Mathlib fc4f59e577feb1a4956671bc04ac18aaaf8cd842 and Tau Ceti 0642eae29e0a59ef798d04de325386445906e755.
  • Matched runs with cached dependencies cleared the five touched modules’ outputs and ran lake --no-ansi --no-cache build LeanPool.CutoffRigidity.Imports on the Azure VM. Build wall time fell from 16.18 s to 8.47 s. The test-functions, form-data and positivity modules took 4.6 s → 1.9 s, 2.9 s → 1.6 s, and 2.8 s → 1.9 s. The optimized proof reuses the integrated core pairing and replaces general-purpose nonlinear arithmetic in the contraction inequality. Synchronous command traces across the three proof modules fell from 272,789 to 241,211 heartbeats in Lean’s maxHeartbeats units.
  • Generated indexes, text style, static quality, and the warning-free project build passed locally. The project-wide declaration linter passed across 178 modules and 2,444 declarations. The card endpoints, axiom closure, prohibited-mechanism audit, and compiler-message audit also passed.

Part of #924

@greptile-apps

greptile-apps Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

No blocking code issue was found; external source and license claims remain unverified.RetriggerView in Greptile

[Medium impact] No blocking code issue was found; external source and license claims remain unverified.

Summary

Adds the weighted diffusion core and proves that its Friedrichs resolvent and semigroup preserve almost-everywhere nonnegativity.

  • Smooth compactly supported functions define the weighted diffusion core.
  • The weighted diffusion resolvent and semigroup preserve nonnegativity.

Reviews (4) · Last reviewed commit: "Expose integrability of the diffusion co..." · Reviewed by Greptile

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source approved at 997ddac3. Exact-head Lean validation is running.

  • The test-core construction proves that the negative weighted generator is dense, symmetric and nonnegative, with energy given by the gradient pairing. A smooth contraction and the variational resolvent comparison prove preservation of almost-everywhere nonnegativity. Euler convergence and closedness of the nonnegative cone transfer it to all nonnegative semigroup times.
  • The result applies to the finite smooth weighted Riemannian setting. It extends the existing operator calculus and Euclidean positivity results. The statement concerns the L² resolvent and semigroup, and the port follows the corresponding upstream diffusion instance. Attribution and modification notices are present in all three source files. Pinned diffusion instance

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 195.79 s (= 3.26 min) — user 593.43 s, sys 44.02 s.

This build covers the changed modules and their dependency cones on top of the restored cache. The serial per-file sums below are useful for ranking slow files, not as a build budget.

A base→head comparison was attempted but its measurements are unavailable (see the run log); modified files are omitted from the tables below.

Statement changes

✅ No statements changed — all 0 tracked declarations across 2 modified files kept their type; only proofs / definition bodies changed.

Statements are compared textually against the merge base (comments and whitespace ignored; by proof terms embedded in a type are treated as proof-irrelevant), the same method as physlib's /check-golf. Anonymous instances and examples are not tracked.

Total heartbeats: 239,938 maxHeartbeats units across 3 valid files (542 added LOC).

Sum of lean --profile: 10634.2 ms (= 10.63 s) across 3 valid files. Import-excluded time: 5902.2 ms (= 5.90 s).

Count-heartbeats wall-clock total: 23.15 s. Repeated import cost inside lean --profile: 4732.0 ms (= 4.73 s).

Heartbeat values sum disjoint root command traces with trace.profiler.useHeartbeats and synchronous elaboration, converted from raw allocations to maxHeartbeats units by dividing by 1000. They include command elaboration and kernel checking, exclude imports, and include profiler overhead; they are not comparable to the deprecated linter's totals. Per-file wall clocks are measured under parallel load and are noisier than heartbeats.

LOC counts added lines in the profiled Lean files from this PR diff.

File LOC Heartbeats (maxHB) Count wall (s) lean --profile (s) Without import (s) Import (s) Commands Errors
LeanPool/CutoffRigidity/Friedrichs/DiffusionTestFunctions.lean 192 95,880 8.90 2.78 1.98 0.80 60 0
LeanPool/CutoffRigidity/Friedrichs/DiffusionPositivity.lean 247 94,433 8.57 3.45 2.57 0.87 51 0
LeanPool/CutoffRigidity/Friedrichs/DiffusionForm.lean 95 49,625 5.68 4.41 1.35 3.06 27 0
LeanPool/CutoffRigidity.lean 5 — — — — — 0 1
LeanPool/CutoffRigidity/Imports.lean 3 — — — — — 0 1
Total 542 239,938 23.15 10.63 5.90 4.73 138 2

Aggregate phase totals

Phase Time
import 4732.0 ms (= 4.73 s)
typeclass inference 2584.0 ms (= 2.58 s)
interpretation 890.0 ms (= 0.89 s)
elaboration 716.0 ms (= 0.72 s)
type checking 562.0 ms (= 0.56 s)
tactic execution 549.1 ms (= 0.55 s)
simp 140.0 ms (= 0.14 s)
initialization 86.7 ms (= 0.09 s)
linting 79.7 ms (= 0.08 s)
process pre-definitions 54.8 ms (= 0.05 s)
declTypeLinter 43.3 ms (= 0.04 s)
norm_num 31.4 ms (= 0.03 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.CutoffRigidity.Friedrichs.DiffusionTestFunctions 2.20 s
LeanPool.CutoffRigidity.Friedrichs.DiffusionPositivity 2.20 s
LeanPool.CutoffRigidity.Friedrichs.DiffusionForm 1.90 s
Per-file `lean --profile` output

LeanPool/CutoffRigidity/Friedrichs/DiffusionForm.lean

import took 3.06s
cumulative profiling times:
	attribute application 0.0839ms
	congr simp thm 3.17ms
	declTypeLinter 10.1ms
	elaboration 186ms
	fix level params 0.667ms
	import 3.06s
	initialization 26.9ms
	instantiate metavars 0.44ms
	interpretation 211ms
	let-to-have transformation 25.3ms
	linting 12.1ms
	module linting 0.0221ms
	parsing 5.94ms
	process pre-definitions 11.8ms
	share common exprs 4.82ms
	simp 23.8ms
	tactic execution 89.1ms
	tacticAnalysis 2.78ms
	type checking 178ms
	typeclass inference 556ms
real 4.59
user 2.19
sys 0.71

LeanPool/CutoffRigidity/Friedrichs/DiffusionPositivity.lean

import took 874ms
cumulative profiling times:
	attribute application 0.197ms
	compilation (IR) 0.0563ms
	compilation (LCNF base) 0.502ms
	compilation (LCNF impure) 0.186ms
	compilation (LCNF mono) 0.212ms
	congr simp thm 2.18ms
	declTypeLinter 14.6ms
	dsimp 8.31ms
	elaboration 294ms
	fix level params 1.68ms
	import 874ms
	initialization 28.6ms
	instantiate metavars 3.19ms
	interpretation 377ms
	let-to-have transformation 0.748ms
	linting 41.4ms
	module linting 0.0185ms
	norm_num 24.5ms
	parsing 14.5ms
	process pre-definitions 20ms
	ring 22.6ms
	share common exprs 14.6ms
	simp 101ms
	tactic execution 330ms
	tacticAnalysis 6.59ms
	type checking 188ms
	typeclass inference 1.08s
real 2.78
user 3.41
sys 0.62

LeanPool/CutoffRigidity/Friedrichs/DiffusionTestFunctions.lean

import took 798ms
typeclass inference of IsContMDiffRiemannianBundle took 124ms
cumulative profiling times:
	attribute application 1.7ms
	blocked (unaccounted) 0.344ms
	compilation (IR) 0.0729ms
	compilation (LCNF base) 1.52ms
	compilation (LCNF impure) 0.24ms
	compilation (LCNF mono) 0.477ms
	congr simp thm 2.71ms
	declTypeLinter 18.6ms
	dsimp 8.17ms
	elaboration 236ms
	fix level params 1.2ms
	import 798ms
	initialization 31.2ms
	instantiate metavars 1.86ms
	interpretation 302ms
	let-to-have transformation 0.645ms
	linting 26.2ms
	module linting 0.021ms
	norm_num 6.94ms
	parsing 10.5ms
	process pre-definitions 23ms
	ring 3.32ms
	share common exprs 8.31ms
	simp 15.2ms
	tactic execution 130ms
	tacticAnalysis 5.29ms
	type checking 196ms
	typeclass inference 948ms
real 2.60
user 2.77
sys 0.60

Advisory only — never blocks merge. Full log uploaded as the proof-profile artifact.

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on 997ddac3eb88d7f20d44e1dafbb2586c6adefe22.

Faithfulness and significance

diffFormData constructs a dense symmetric nonnegative operator on real (L^2(mu)) from the smooth compactly supported core and a finite weighted measure. The density comes from smooth approximation, and the pairing is identified by the pool’s weighted integration-by-parts theorem. The comparison argument proves 0 ≤ᵐ[μ] S.resolvent parameter g for a positive parameter and nonnegative input. The operator-norm Euler limit proves positivity for S.semigroup time, including time zero. The card describes these Hilbert-space results. The kernel construction and cutoff estimates remain on #924.

Novelty and sources

The previous Cutoff Rigidity PRs supply the abstract form, semigroup, and comparison theorem. These changes construct their weighted diffusion instance. Mathlib provides the (L^p) embedding, and Tau Ceti provides the support and gradient calculus. I checked the pool, Mathlib and Tau Ceti for the concrete weighted-generator positivity result. The Apache-2.0 license, author credit, AI provenance and exact source revision agree with the upstream license, proposal and Palomar record. Upstream revision · Palomar record

Engineering and verification

The port uses one integrated core pairing for symmetry, nonnegativity, and the public energy identity. It uses the pinned support and chain-rule lemmas for the manifold operators and the existing closed-form comparison and Euler convergence. The matched project build took 16.18 s before optimization and 11.72 s at this head, with 272,789 → 250,223 synchronous command heartbeats in Lean’s maxHeartbeats units across the three proof modules.

Local index, static quality, style, warning-free build, linter, card endpoint, axiom, prohibited-mechanism and build-message checks passed across 178 modules. The required hosted Build project check passed on this head, together with the content separation check and applicable validation workflows. All three new modules compiled in the hosted advisory profile. Lean CI · Profile

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

🤖 LLM review — refactor (gpt-6.2-sol)

Reviewed head: ebec979236ff6b8b30fb37454781e1359077ac82

Verdict: ✅ approve

The port adds the smooth compactly supported core of the weighted diffusion generator and proves positivity of its Friedrichs resolvent and semigroup. The density proof keeps both approximation steps explicit, and the positivity proofs reuse the existing resolvent comparison and closed-set invariance lemmas. LeanPool.CutoffRigidity.Imports built successfully in a scratch checkout using the pinned dependency sources. The posted /profile reports head-only timings.

Aspect Value
Scope weighted diffusion proof port
Introduces tech debt 🛑 yes
Maintainability ✅ improved
Brittleness ✅ more_robust
Risk ✅ low

The shared Friedrichs APIs make the positivity proofs easier to maintain, and the omitted boundedness lemma adds a small cost to follow-up ports.

Findings (1)

  • reusability-lost — LeanPool/CutoffRigidity/Friedrichs/DiffusionTestFunctions.lean:45
    The removed testSub_bounded has several callers at the pinned upstream revision. The log-Sobolev proof uses it for a uniform bound, and penalized_perron uses its chosen bound in the theorem conclusion. Restore the helper beside testSub_continuous using Mathlib’s Continuous.bounded_above_of_compact_support so those ports can share it. Log-Sobolev caller · Penalized Perron statement

Tokens: 8,089,106 in / 18,936 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $32.6405 (Standard API equivalent; uncached input) (long-context rate)
Automated review against .github/REFACTOR_REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Both findings fixed in e032144b4f.

  • dense_test now uses Lp.norm_le_of_ae_bound and dist_triangle for the two approximations.
  • diffusion_semigroup_nonneg now applies FormData.semigroup_mapsTo on Ici 0. The ordered (L^2) API supplies closure, nonnegative scaling, and the conversion to almost-everywhere nonnegativity.

The revised head passed the warning-free project build and synchronous profiling. Hosted checks are running again. Updated Lean CI

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source approved at e032144b. The density and positivity statements are unchanged.

The density proof uses the Mathlib (L^p) norm bound and keeps the same approximation argument. The semigroup proof uses the shared Euler argument on the closed nonnegative cone. This preserves the almost-everywhere order conclusion at all nonnegative times. Earlier source review

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on e032144b4faf787c067b624a2e3783363a475365.

I reviewed the two changes since the earlier approval against the exact built sources. dense_test combines continuous compact-support approximation and uniform smooth approximation by bounding the second error with Lp.norm_le_of_ae_bound. The proof retains the dense-core conclusion for finite weighted measures. diffusion_semigroup_nonneg applies FormData.semigroup_mapsTo to the closed order interval Ici 0 and translates the conclusion with Lp.coeFn_nonneg. This removes the local cone-closure proof and uses the existing semigroup interface.

The weighted generator, resolvent and semigroup statements keep their types. The prior review established the source and license match, significance, and the distinction from the abstract Friedrichs development. The revised worktree passes the local build, index, style, declaration lint, card endpoint, axiom closure, prohibited-mechanism and build-message checks. The controlled project build is 16.18 s → 12.76 s from the first warning-free port, with synchronous profiles of 272,789 → 239,979 maxHeartbeats units. The required hosted build and content separation checks passed on this head. Greptile completed its rereview. Lean CI · Earlier review

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Both follow-up findings fixed in 584c9ad065.

  • The continuity hypothesis for resolvent comparison now comes from lipschitzWith_liftLp, which uses Mathlib’s Lipschitz composition theorem.
  • The continuous approximation bound uses Lp.dist_edist and Lp.edist_toLp_toLp, removing the local representative calculation.

The revised head passed the project build, profiling, declaration lint and trust checks locally. Updated Lean CI

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on 584c9ad065a3acf611fc906f304ef40cb5dee1e7.

I verified the follow-up diff against the previously reviewed head. The continuous approximation uses the (L^2) distance API, and resolvent comparison obtains continuity from the contraction’s Lipschitz bound. The dense core, resolvent, and semigroup results retain their types. The exact head passed the local index, style, warning-free build, declaration lint, card endpoint, axiom closure, prohibited-mechanism, and build-message checks. The matched build took 16.18 s → 10.19 s, and the three proof modules used 272,789 → 237,106 maxHeartbeats units. The matching hosted build passed the index, build, declaration lint, text style, and repository quality stages. The earlier review covers the unchanged upstream scope and mathematical endpoints.

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Both follow-up findings addressed in ebec979236ff6b8b30fb37454781e1359077ac82.

integrable_carre is public in DiffusionForm and applies to any measure finite on compact sets. The positivity proof imports it through the form module, and the follow-up cutoff energy estimates can use it from there. The unused testSub_bounded wrapper is removed. The latest matched build took 8.47 s and the three proof modules used 241,211 maxHeartbeats units.

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Source approved at ebec9792. The project’s core and positivity statements are unchanged.

The gradient-pairing integrability lemma now lives in the form module and only requires finiteness on compact sets. The positivity argument uses that lemma at the existing finite weighted measure. The dropped boundedness wrapper has no callers in the pool. Earlier source review

@Vilin97 Vilin97 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on ebec979236ff6b8b30fb37454781e1359077ac82.

  • The last diff moves the integrability proof to DiffusionForm and exposes it with the natural assumption that the measure is finite on compact sets. Smoothness of the gradient pairing and compact support give the result. The positivity proof reuses this statement, and the pinned upstream energy estimate has a compatible public lemma available. The removed bound was a specialization of the Mathlib compact-support bound with no Pool callers.
  • The dense-core, resolvent and semigroup endpoints retain their statements. The complete local shard passed declaration lint across 178 modules and 2,444 declarations, endpoint validation, axiom closure, prohibited-mechanism and build-message checks. The local warning-free build, indexes, static quality and text style passed. The matched build took 16.18 s → 8.47 s, and the three proof modules used 272,789 → 241,211 maxHeartbeats units.
  • The hosted run passed index, build, declaration lint, text style, and quality checks. The required content separation check passed as well. The earlier review covers the pinned upstream comparison, scope and mathematical endpoints.

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Approve. The pinned Mathlib API supplies the same uniform bound.

I checked the upstream log-Sobolev and penalized Perron callers. In the pinned Lean environment, (testSub_continuous F f).bounded_above_of_compact_support f.2.2 elaborates directly at the exact existential type used by testSub_bounded. A second Lean check proved by rfl that choosing a bound from this expression equals choosing one from any proof of that existential. The follow-up can use the shared Mathlib API and keep the penalized Perron statement definitionally equivalent. The public integrable_carre lemma carries the diffusion-specific gradient argument.

Log-Sobolev caller · Perron statement

@Vilin97
Vilin97 added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 3698ac2 Nov 26, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant