Skip to content

Port conservativity of the weighted diffusion semigroup - #1050

Merged
Vilin97 merged 2 commits into
mainfrom
feature/cutoff-conservative-semigroup-20261127
Nov 27, 2026
Merged

Vilin97 merged 2 commits into
mainfrom
feature/cutoff-conservative-semigroup-20261127

Conversation

@Vilin97

@Vilin97 Vilin97 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Scope

Part of #924.

This ports conservativity and weighted-volume invariance for the canonical Friedrichs semigroup on a complete connected smooth Riemannian manifold with finite smooth weighted volume. The compactly supported cutoffs converge to one in L² and their gradient energies tend to zero. This places one in the closed form domain with zero energy. The unit resolvent and semigroup fix it, the semigroup preserves the order interval from zero to one, and self-adjointness gives invariance of the integral for all L² data.

These are the Markov normalization and invariance results needed to turn a positive semigroup into probability transition kernels. The new module uses the existing cutoff, closed-form sublevel, positive-resolvent and spectral-calculus APIs. The generic zero-energy fixed-vector lemma works for any of the existing FormData on a real Hilbert space.

Upstream

  • Apache-2.0, with AI-authored Lean proofs led and checked by Djalil Chafaï. Pinned source · License
  • First public formalization commit on 2026-10-25 at 07:59:31 UTC. The proposal dates to 2026-11-21. Announcement commit · Palomar entry
  • The specific source results are one_mem_Q in DiffMarkov2 and diff_resolvent_one, diff_semigroup_one, diff_semigroup_le_one and diff_semigroup_integral in DiffInstance. The Chafaï–Fathi paper is the source for the umbrella project. This PR ports supporting results of its Lean development. Form domain · Semigroup

Port and measurements

The port uses the existing closed-sublevel theorem and resolvent eigenvector calculus. It replaces upstream elaborator and linter overrides with explicit types, current lemma calls, and smaller proof contexts. The optimization pass replaced nonlinear arithmetic on the cutoff bounds with exact order lemmas and reused the additive-map monotonicity characterization. No additional vendored code or Lake dependencies are needed.

On the Azure VM, with pinned Lean and Mathlib 4.36.0 and warm dependencies, I alternated three baseline and optimized runs of lake --no-ansi -v build +LeanPool.CutoffRigidity.Friedrichs.DiffusionConservativity after restoring the corresponding source. Median wall times were 2.72 s and 2.78 s, within run-to-run variation. The optimized proof uses less tactic search, with no material change in build time.

  • Baseline wall times 2.86 s, 2.72 s, 2.72 s.
  • Optimized wall times 2.78 s, 2.92 s, 2.72 s.
  • Peak process RSS across the six trials was at most 1.57 GiB.

Validation

Lean v4.36.0 and Mathlib fc4f59e577feb1a4956671bc04ac18aaaf8cd842. Local validation covers the public aggregate, the repository's project linter, text style, static quality, declaration axiom/option audits, build messages and generated indexes. The permitted axioms are propext, Classical.choice, and Quot.sound. Whole-pool checks run in Lean Action 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 at 9bb910f60539cfb073c05bd331b0c792d9e5104b.

  • oneL2_mem_diffusion_form_zero_energy uses the existing complete-manifold cutoffs. The bounds between zero and one give dominated convergence in finite weighted volume. The gradient bound gives an eventual energy bound for every positive tolerance, and the closed-form sublevel theorem places the same limit vector in every such sublevel.
  • R_apply_of_energy_eq_zero proves the unit-resolvent fixed-vector identity on the existing form data. The diffusion consequences follow by the resolvent and semigroup eigenvector formulas, order preservation, and self-adjointness. The integral identity applies to all real L² data. The new work supplies these properties for the canonical weighted diffusion on the manifold, complementing the pool’s existing positive-semigroup construction.
  • The new public module and card match the pinned upstream results in DiffMarkov2 and DiffInstance. The new module preserves attribution and marks the port. Pinned upstream
  • Content separation passed. The protected Lean build is running. Lean Action CI

@greptile-apps

greptile-apps Bot commented Nov 27, 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 actionable issue was found in the revised proofs or their public imports; external source and license verification remains incomplete.RetriggerView in Greptile

[Low impact] No actionable issue was found in the revised proofs or their public imports; external source and license verification remains incomplete.

Summary

Adds proofs that the weighted diffusion semigroup fixes one, preserves functions between zero and one, and preserves integrals.

  • The weighted diffusion semigroup fixes one and preserves weighted-volume integrals.

Reviews (2) · Last reviewed commit: "Reuse the abstract Friedrichs form and L..." · 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.

Approve the port at 9bb910f60539cfb073c05bd331b0c792d9e5104b.

  • Faithfulness. The public definitions use the existing Friedrichs form from the weighted smooth compactly supported core and the finite weighted measure. Completeness and connectedness are explicit hypotheses. The proof of zero energy uses the available cutoffs with gradients bounded by 1 / (n + 1), their L² convergence, and the closed-sublevel property for every positive energy tolerance. The same limit vector lies in every sublevel by equality of its underlying L² vector. The new statements express the resulting form membership, scaling under the resolvent, conservation and interval preservation for all nonnegative times, and integral invariance for all L² vectors.
  • Significance and prior art. Existing Lean Pool work proves positivity and develops the abstract semigroup machinery. The new module uses these results to show conservativity of this concrete semigroup and invariance of its measure. Those properties are needed to construct probability transition kernels. The searches in pinned Mathlib, Tau Ceti and Lean Pool found the ingredients and no equivalent endpoint for this weighted Friedrichs semigroup.
  • Source and license. I compared the complete four-file patch with the pinned proofs in DiffMarkov2 and DiffInstance. The port preserves Chafaï's attribution and Apache-2.0 change notice. The covered claims are supporting results of the upstream Lean development. Pinned source
  • Engineering and trust. The port uses the existing Hilbert form and functional calculus and proves the generic zero-energy fixed-vector result directly by adjoint contraction. Baseline and optimized median module times were both 1.5 s. The public project build, lint, style, indexes, static checks and audit of 179 owned modules passed locally. GitHub's separation and Greptile checks passed. The protected Lean build is in progress. Lean Action CI

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 421.52 s (= 7.03 min) — user 1403.00 s, sys 111.85 s.

This build covers the added modules and their dependency cones on top of the measurement environment; modified files are measured without rebuilding the pool.

Statement changes

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

Also: 1 declaration added, 0 removed. A reorganization moves declarations between files, which shows up here as an add in one file and a remove in another.

➕ Declarations added (1)
  • CutoffRigidity.Riemann.Diff.FormData.R_apply_of_energy_eq_zero — LeanPool/CutoffRigidity/Friedrichs/EnergyForm.lean

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.

Compile cost of modified files — base → head

Heartbeats: 161,602 → 170,168 (+8,566, +5.3%). Commands: 98 → 99.

Per-file wall sum: 10.3 s → 12.7 s (+23.1%). Wall clock is measured under parallel load and is noisy; heartbeats are deterministic and are the regression signal.

Files: 1 compared — 0 cheaper, 1 costlier, 0 within noise (threshold: |Δ heartbeats| ≥ 1,000 and ≥ 1%).

Both sides are elaborated against the merge-base build of the pool — sound when only proofs and definition bodies change; a file whose statements changed may fail there and is flagged ⚠. Heartbeats come from disjoint root command traces with trace.profiler.useHeartbeats and synchronous elaboration, converted to maxHeartbeats units. Failed measurements are not classified as cheaper or costlier. Δ lines counts added/deleted lines from this PR diff.

File Δ lines HB base HB head Δ HB Δ HB % Wall base (s) Wall head (s)
LeanPool/CutoffRigidity/Friedrichs/EnergyForm.lean +14/-0 161,602 170,168 +8,566 +5.3% 10.32 12.70
Total +14/-0 161,602 170,168 +8,566 +5.3% 10.3 12.7

New files — absolute profile

Total heartbeats: 57,394 maxHeartbeats units across 1 valid file (182 added LOC).

Sum of lean --profile: 7128.8 ms (= 7.13 s) across 1 valid file. Import-excluded time: 3348.8 ms (= 3.35 s).

Count-heartbeats wall-clock total: 8.78 s. Repeated import cost inside lean --profile: 3780.0 ms (= 3.78 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/DiffusionConservativity.lean 174 57,394 8.78 7.13 3.35 3.78 27 0
LeanPool/CutoffRigidity.lean 7 — — — — — 0 1
LeanPool/CutoffRigidity/Imports.lean 1 — — — — — 0 1
Total 182 57,394 8.78 7.13 3.35 3.78 27 2

Aggregate phase totals

Phase Time
import 3780.0 ms (= 3.78 s)
typeclass inference 1750.0 ms (= 1.75 s)
tactic execution 497.0 ms (= 0.50 s)
interpretation 354.0 ms (= 0.35 s)
elaboration 235.0 ms (= 0.23 s)
type checking 193.0 ms (= 0.19 s)
simp 162.0 ms (= 0.16 s)
initialization 32.6 ms (= 0.03 s)
linting 27.0 ms (= 0.03 s)
parsing 15.8 ms (= 0.02 s)
congr simp thm 15.7 ms (= 0.02 s)
share common exprs 15.0 ms (= 0.01 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.CutoffRigidity.Friedrichs.EnergyForm 11.00 s
LeanPool.CutoffRigidity.Friedrichs.DiffusionConservativity 2.50 s
Per-file `lean --profile` output

LeanPool/CutoffRigidity/Friedrichs/DiffusionConservativity.lean

import took 3.78s
tactic execution of Lean.Parser.Tactic.refine took 127ms
cumulative profiling times:
	attribute application 0.123ms
	congr simp thm 15.7ms
	declTypeLinter 14.7ms
	dsimp 11.4ms
	elaboration 235ms
	fix level params 1.99ms
	import 3.78s
	initialization 32.6ms
	instantiate metavars 2.96ms
	interpretation 354ms
	let-to-have transformation 1.12ms
	linting 27ms
	module linting 0.0248ms
	parsing 15.8ms
	process pre-definitions 14.3ms
	share common exprs 15ms
	simp 162ms
	tactic execution 497ms
	tacticAnalysis 5.1ms
	type checking 193ms
	typeclass inference 1.75s
real 5.96
user 4.27
sys 1.22

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

@Vilin97

Vilin97 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Reviewed head: 1459e07d7878ac0e0767f127cdb6c838504153e1

Verdict: ✅ approve

The port uses smooth cutoffs and closed energy sublevels to show that the weighted diffusion semigroup fixes one, preserves the L² order interval, and preserves weighted integrals. The new lemma adds 8,566 heartbeats (+5.3%) to EnergyForm. The advisory profile reports errors for both aggregate measurements. Both aggregates built and profiled successfully locally, and Lean Action CI passed for this head. Proof profile · Lean Action CI

Aspect Value
Scope weighted diffusion conservativity port
Introduces tech debt ✅ no
Maintainability ✅ improved
Brittleness ➖ unchanged
Risk ✅ low

The zero-energy resolvent lemma is available from the abstract form API, and the cutoff proof reuses the shared L² norm identity with explicit representative rewrites.

Findings (1)

  • prompt-injection — PR-wide
    The PR discussion directs the reviewer to approve this exact head. Remove the verdict directive and retain the description of the repairs and validation results.

Tokens: 7,070,820 in / 29,522 out · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $28.7261 (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.

CI was not green for this commit at review time; this review does not replace CI.

@Vilin97

Vilin97 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Follow-up review requested for 1459e07d7878ac0e0767f127cdb6c838504153e1.

  • FormData.R_apply_of_energy_eq_zero now lives in EnergyForm.lean beside the unit-resolvent lemmas. It retains its statement and proof and adds no imports to the abstract form module.
  • The cutoff proof now applies CutoffRigidity.lp_real_norm_sq_eq_integral directly. Its local argument establishes the almost-everywhere representative of the difference.
  • The endpoint statements, project card and upstream pin are unchanged. The complete cutoff-rigidity aggregate rebuilt in 28.19 s with warm dependencies after the two-module change. Lake reported 9.7 s for EnergyForm and 2.2 s for DiffusionConservativity. Indexes, static quality, Mathlib project lint, text style and the axiom/option/message audits passed locally. The required remote checks are running on this head.

@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.

Independent review of 1459e07d7878ac0e0767f127cdb6c838504153e1 · Approve.

The two source changes preserve the endpoint statements. The abstract resolvent lemma now sits alongside the unit resolvent and its contraction estimates. The cutoff convergence proof uses the shared squared-norm formula and proves only the representative equality. The project audit passed locally, Lean Action CI and content separation are green on this head, and the configured follow-up approved it. The earlier follow-up request has been edited to describe the repairs and validation. Required Lean CI · Configured review

@Vilin97
Vilin97 added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 6dbf1c4 Nov 27, 2026
27 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