Skip to content

Import demazureoperatorslean formalization - #89

Merged
Vilin97 merged 11 commits into
mainfrom
import/demazureoperatorslean
May 20, 2026
Merged

Vilin97 merged 11 commits into
mainfrom
import/demazureoperatorslean

Conversation

@Vilin97

@Vilin97 Vilin97 commented May 17, 2026 •

Copy link
Copy Markdown
Collaborator

Imported from https://github.com/bolito2/DemazureOperatorsLean.

Slug: demazureoperatorslean
Toolchain target: leanprover/lean4:v4.30.0-rc2
Branch: import/demazureoperatorslean

Import notes

This branch imports the completed Demazure-operator core plus the repaired Coxeter support layer:

  • DemazureOperators/Demazure.lean
  • DemazureOperators/DemazureAux.lean
  • DemazureOperators/DemazureRelations.lean
  • DemazureOperators/DemazureAuxRelations.lean
  • DemazureOperators/StrongExchange.lean
  • DemazureOperators/Matsumoto.lean

The remaining upstream files are not imported because they are not Lean-Pool admissible as upstream currently stands:

  • DemazureOperators/SymmetricGroup.lean contains an unresolved sorry in the proof that the map from the abstract type-A Coxeter presentation to Equiv.Perm (Fin (n + 1)) is injective.
  • DemazureOperators/DemazureWords.lean depends on that concrete symmetric-group Coxeter system and also uses forbidden set_option quotPrecheck false.

The project card therefore treats the Demazure relations and unconditional strong exchange as the headline results. The Matsumoto development is retained as conditional auxiliary Coxeter infrastructure because CoxeterSystem.matsumoto_reduced assumes the extra MatsumotoCondition hypothesis.

Current local checks on head a38d9f2:

  • lake build LeanPool.DemazureOperatorsLean
  • lake exe lint-style LeanPool/DemazureOperatorsLean.lean LeanPool/DemazureOperatorsLean/DemazureAux.lean
  • uv run python -m lean_pool.partial_port_audit --repo .. --base-ref origin/main --head-ref HEAD
  • uv run python -m lean_pool.quality --repo ..
  • git diff --check

@github-actions

github-actions Bot commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build LeanPool wall time: 25.28 s (= 0.42 min) — user 29.26 s, sys 6.61 s.

This is the parallel build wall clock and is the compile-time answer for this PR. The serial per-file sums below are useful for ranking slow files, not as a build budget.

Total heartbeats: 3,742 maxHeartbeats units across 5 files (1,149 added LOC).

Sum of lean --profile: 25766.9 ms (= 25.77 s). Import-excluded time: 16486.9 ms (= 16.49 s).

Count-heartbeats wall-clock total: 20.68 s. Repeated import cost inside lean --profile: 9280.0 ms (= 9.28 s).

Heartbeat values come from Mathlib's linter.countHeartbeats and are already in maxHeartbeats units.

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) Decls Errors
LeanPool/DemazureOperatorsLean/Demazure.lean 377 2,306 4.31 7.48 5.56 1.92 43 0
LeanPool/DemazureOperatorsLean/DemazureAux.lean 418 1,150 3.65 5.47 3.64 1.83 54 0
LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean 215 180 7.05 7.96 6.14 1.82 18 0
LeanPool/DemazureOperatorsLean/DemazureRelations.lean 118 106 3.01 2.75 0.92 1.83 7 0
LeanPool/DemazureOperatorsLean.lean 21 0 2.66 2.11 0.23 1.88 0 0
Total 1,149 3,742 20.68 25.77 16.49 9.28 122 0

Aggregate phase totals

Phase Time
import 9280.0 ms (= 9.28 s)
typeclass inference 4904.0 ms (= 4.90 s)
interpretation 2463.0 ms (= 2.46 s)
simp 2122.7 ms (= 2.12 s)
type checking 1529.8 ms (= 1.53 s)
tactic execution 1302.4 ms (= 1.30 s)
elaboration 1300.3 ms (= 1.30 s)
ring 888.1 ms (= 0.89 s)
share common exprs 843.4 ms (= 0.84 s)
process pre-definitions 277.1 ms (= 0.28 s)
dsimp 181.8 ms (= 0.18 s)
instantiate metavars 162.3 ms (= 0.16 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.DemazureOperatorsLean.DemazureAuxRelations 6.80 s
LeanPool.DemazureOperatorsLean.Demazure 4.10 s
LeanPool.DemazureOperatorsLean.DemazureAux 3.30 s
LeanPool.DemazureOperatorsLean.DemazureRelations 2.50 s
LeanPool.DemazureOperatorsLean 2.00 s
Per-file `lean --profile` output

LeanPool/DemazureOperatorsLean.lean

import took 1.88s
cumulative profiling times:
	elaboration 0.159ms
	import 1.88s
	initialization 27ms
	interpretation 202ms
	linting 0.279ms
	parsing 0.0309ms
real 2.74
user 1.65
sys 1.11

LeanPool/DemazureOperatorsLean/Demazure.lean

import took 1.92s
simp took 289ms
cumulative profiling times:
	attribute application 4.35ms
	blocked (unaccounted) 60.2ms
	compilation (IR) 0.261ms
	compilation (LCNF base) 3.97ms
	compilation (LCNF impure) 1.58ms
	compilation (LCNF mono) 4.28ms
	congr simp thm 10.3ms
	dsimp 2.54ms
	elaboration 243ms
	fix level params 2.2ms
	import 1.92s
	initialization 27ms
	instantiate metavars 5.95ms
	interpretation 678ms
	let-to-have transformation 6.51ms
	linting 30.7ms
	norm_num 2.44ms
	parsing 29.1ms
	process pre-definitions 22.8ms
	ring 18.1ms
	share common exprs 17.9ms
	simp 924ms
	tactic execution 479ms
	type checking 240ms
	typeclass inference 2.75s
real 4.41
user 6.85
sys 1.20

LeanPool/DemazureOperatorsLean/DemazureAux.lean

import took 1.83s
Try this:
  [apply] ring_nf
  
  The `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.
    
  Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.
Try this:
  [apply] ring_nf
  
  The `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.
    
  Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.
Try this:
  [apply] ring_nf
  
  The `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.
    
  Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.
Try this:
  [apply] ring_nf
  
  The `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.
    
  Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.
Try this:
  [apply] ring_nf
  
  The `ring` tactic failed to close the goal. Use `ring_nf` to obtain a normal form.
    
  Note that `ring` works primarily in *commutative* rings. If you have a noncommutative ring, abelian group or module, consider using `noncomm_ring`, `abel` or `module` instead.
cumulative profiling times:
	attribute application 4.84ms
	blocked (unaccounted) 0.392ms
	compilation (IR) 0.084ms
	compilation (LCNF base) 1.21ms
	compilation (LCNF impure) 0.438ms
	compilation (LCNF mono) 1.36ms
	congr simp thm 29.2ms
	elaboration 225ms
	fix level params 2.3ms
	import 1.83s
	initialization 26.7ms
	instantiate metavars 10.7ms
	interpretation 799ms
	let-to-have transformation 0.458ms
	linting 30ms
	norm_num 5.29ms
	parsing 28.8ms
	process pre-definitions 29.7ms
	ring 139ms
	share common exprs 28.7ms
	simp 388ms
	tactic execution 615ms
	type checking 173ms
	typeclass inference 1.1s
real 3.69
user 5.01
sys 1.12

LeanPool/DemazureOperatorsLean/DemazureAuxRelations.lean

import took 1.82s
ring took 614ms
instantiate metavars took 135ms
share common exprs took 765ms
process pre-definitions took 208ms
elaboration took 604ms
type checking took 946ms
cumulative profiling times:
	attribute application 0.336ms
	compilation (IR) 0.263ms
	compilation (LCNF base) 3.77ms
	compilation (LCNF impure) 1.41ms
	compilation (LCNF mono) 4.08ms
	congr simp thm 4.75ms
	dsimp 41.3ms
	elaboration 777ms
	fix level params 28.2ms
	import 1.82s
	initialization 27ms
	instantiate metavars 145ms
	interpretation 485ms
	let-to-have transformation 0.365ms
	linting 40.8ms
	norm_num 4.96ms
	parsing 14.4ms
	process pre-definitions 221ms
	ring 731ms
	share common exprs 795ms
	simp 809ms
	tactic execution 135ms
	type checking 1.09s
	typeclass inference 779ms
real 7.08
user 7.43
sys 1.14

LeanPool/DemazureOperatorsLean/DemazureRelations.lean

import took 1.83s
cumulative profiling times:
	attribute application 0.07ms
	congr simp thm 0.326ms
	dsimp 138ms
	elaboration 55.1ms
	fix level params 0.292ms
	import 1.83s
	initialization 26.8ms
	instantiate metavars 0.638ms
	interpretation 299ms
	let-to-have transformation 0.203ms
	linting 7.24ms
	parsing 5.53ms
	process pre-definitions 3.63ms
	share common exprs 1.78ms
	simp 1.66ms
	tactic execution 73.4ms
	type checking 26.8ms
	typeclass inference 275ms
real 3.02
user 2.24
sys 1.12

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

@github-actions

github-actions Bot commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

🤖 LLM review (gpt-5.5)

Reviewed head: a38d9f2c5203fffed3079f4b32e5d58257807f89

Verdict: ✅ approve

This PR adds a self-contained algebraic-combinatorics project formalizing divided Demazure operators on complex multivariate polynomial rings, proving nilpotence, braid and commutation relations, compatibility with multiplication by symmetric polynomials, and packaging the operator as a linear map over the symmetric-polynomial subalgebra; it also includes supporting Coxeter-system results, notably strong exchange and a conditional Matsumoto theorem. The project has a clear source anchor to BGG and Humphreys, a project card, and named main declarations.

Aspect Value
Fit ✅ good_fit
Level graduate
Branch algebraic combinatorics
Mode theory_building
Obscure problem no
Code quality 3 / 5

The contribution is a formal development of Demazure divided-difference operators and their Coxeter-type relations, with supporting formal Coxeter theory.


Tokens: 37,390 in / 747 out · Tier: standard · Cost: $0.2094
Automated review against .github/REVIEW_RULES.md. Disagree? Reply on the PR; rules can be updated in a PR of their own.

@Vilin97
Vilin97 marked this pull request as ready for review May 18, 2026 01:37
Copilot AI review requested due to automatic review settings May 18, 2026 01:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Vilin97

Vilin97 commented May 18, 2026

Copy link
Copy Markdown
Collaborator Author

/profile

1 similar comment
@Vilin97

Vilin97 commented May 18, 2026

Copy link
Copy Markdown
Collaborator Author

/profile

@Vilin97

Vilin97 commented May 18, 2026

Copy link
Copy Markdown
Collaborator Author

Deterministic partial-port audit flags this PR as incomplete against the registered upstream source.

Compared with bolito2/DemazureOperatorsLean, this PR imports 5/9 Lean files and 852/2311 non-comment LOC. The unmatched upstream files include DemazureOperators/Matsumoto.lean, DemazureOperators/StrongExchange.lean, DemazureOperators/SymmetricGroup.lean, and DemazureOperators/DemazureWords.lean.

The imported Demazure-operator core is meaningful, but the PR currently drops a large part of the upstream development around symmetric-group words, strong exchange, and Matsumoto. Treating this as request-changes until those files are ported, or the project card/source scope is explicitly narrowed so the PR is reviewed as the smaller core development it actually imports.

This is the failure mode automated in #110.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up on the partial-port audit: I tried vendoring the omitted upstream StrongExchange.lean, Matsumoto.lean, SymmetricGroup.lean, and DemazureWords.lean layer. This is not currently a mechanical import. StrongExchange.lean fails against the pinned Mathlib because several helper declarations now collide with Mathlib Coxeter declarations and several proofs use stale List/ZMod names; upstream SymmetricGroup.lean also still contains a sorry in the construction of f_equiv. I did not push a failing port. This PR should remain request-changes until that Coxeter-word/Matsumoto layer is repaired and imported, or until the project metadata/source scope is explicitly narrowed to the Demazure-operator core that is actually present here.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/profile

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Restored the omitted Coxeter-theory layer in this import. The current head adds LeanPool/DemazureOperatorsLean/StrongExchange.lean and LeanPool/DemazureOperatorsLean/Matsumoto.lean, imports them from the project entry point and LeanPool.lean, and updates the project metadata/card to list CoxeterSystem.strongExchangeProperty and CoxeterSystem.matsumoto_reduced as main declarations.\n\nLocal checks on head e699d58:\n- lake build LeanPool\n- lake exe mk_all --check\n- lake exe runLinter LeanPool.DemazureOperatorsLean\n- lake exe lint-style LeanPool/DemazureOperatorsLean\n- uv run python -m lean_pool.quality --repo ..\n- deterministic partial-port audit: []

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

LLM review skipped: Lean Action CI conclusion was missing. Push a fix or comment /review after CI is green.

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Updated #89 with current origin/main in merge commit 0014fcf, resolving the LeanPool.lean / LeanPool/projects.yml conflicts while preserving the restored Coxeter layer.

Local checks on the merged branch:

  • lake exe mk_all --check
  • lake build LeanPool.DemazureOperatorsLean
  • lake exe runLinter LeanPool.DemazureOperatorsLean
  • lake exe lint-style LeanPool/DemazureOperatorsLean
  • lake build LeanPool
  • uv run python -m lean_pool.quality --repo ..
  • deterministic partial-port audit: []

This should now be ready for CI and the LLM reviewer on the current head.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up on the partial-port/CI repair for DemazureOperatorsLean: current head fe95201 keeps the restored StrongExchange.lean and Matsumoto.lean import and fixes the CI warning surface from those files. I also replaced ring uses in DemazureAux.lean that were emitting Lean info suggestions and kept the project card/registry in sync.\n\nLocal checks run successfully:\n- lake build LeanPool.DemazureOperatorsLean\n- lake exe mk_all --check\n- lake exe runLinter LeanPool.DemazureOperatorsLean\n- lake exe lint-style LeanPool/DemazureOperatorsLean\n- uv run python -m lean_pool.partial_port_audit --repo .. --base-ref origin/main --head-ref HEAD\n- uv run python -m lean_pool.quality --repo ..\n- lake build LeanPool\n\nThe partial-port audit now reports: no suspicious partial upstream imports detected.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

LLM review skipped: Lean Action CI conclusion was in_progress. Push a fix or comment /review after CI is green.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the reviewer metadata finding on head 9e469ca: the project summary and CoxeterSystem.matsumoto_reduced main-result description now explicitly state the extra MatsumotoCondition hypothesis rather than advertising an unconditional Coxeter-system theorem.\n\nLocal checks for this metadata-only update:\n- uv run python -m lean_pool.quality --repo ..\n- uv run python -m lean_pool.partial_port_audit --repo .. --base-ref origin/main --head-ref HEAD -> no suspicious partial upstream imports detected.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@github-actions

Copy link
Copy Markdown
Contributor

LLM review skipped: Lean Action CI conclusion was in_progress. Push a fix or comment /review after CI is green.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

Pushed ce54d83 to address the remaining source-scope metadata finding from the LLM review. The project metadata now marks the Coxeter strong-exchange and Matsumoto main results with Humphreys, Reflection Groups and Coxeter Groups, as their standard Coxeter-theory source, while leaving the BGG paper as the Demazure-operator source. I also added a short note after the generated project card explaining the split.

Local checks passed:

  • lake build LeanPool.DemazureOperatorsLean
  • uv run python -m lean_pool.partial_port_audit --repo .. --base-ref origin/main --head-ref HEAD -> no suspicious partial upstream imports detected
  • uv run python -m lean_pool.quality --repo ..

I will rerun /review after Lean Action CI is green on this new head.

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97

Vilin97 commented May 19, 2026

Copy link
Copy Markdown
Collaborator Author

/review

1 similar comment
@Vilin97

Vilin97 commented May 20, 2026

Copy link
Copy Markdown
Collaborator Author

/review

@Vilin97
Vilin97 merged commit 2056107 into main May 20, 2026
3 of 4 checks passed
@Vilin97

Vilin97 commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up audit for the partial-port flag: this one was already handled in the merged PR history and PR description. The current import includes StrongExchange.lean and Matsumoto.lean under LeanPool/DemazureOperatorsLean/.

The remaining upstream files not represented are SymmetricGroup.lean, DemazureWords.lean, and the upstream root index DemazureOperators.lean. SymmetricGroup.lean contains an active upstream sorry, and DemazureWords.lean imports SymmetricGroup.lean and uses forbidden set_option quotPrecheck false. The local root module intentionally imports the completed Demazure core plus StrongExchange/Matsumoto instead of the upstream all-files index.

So I do not see a new porting-agent failure here: the flagged files are either already present (StrongExchange, Matsumoto) or blocked by unfinished/non-admissible upstream source (SymmetricGroup, DemazureWords).

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.

2 participants