Skip to content

Import nonsingularity of flat Apéry rectangles - #1204

Merged
Vilin97 merged 3 commits into
mainfrom
feature/import-huang-jafari-rectangle-20261206
Dec 6, 2026
Merged

Vilin97 merged 3 commits into
mainfrom
feature/import-huang-jafari-rectangle-20261206

Conversation

@Vilin97

@Vilin97 Vilin97 commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator

Imports the Lean proof of the nonsingularity assertion in Huang and Jafari’s Question 4.13(2). The result turns the rectangular Apéry factorization into a cyclic-group digit factorization and uses a character sum to control the factorizations that form the rows of the matrix.

Source and scope

  • Linh V. H. Le released the formalization on 2026-11-28 at 00:43:41 UTC. The Apache-2.0 source is e82d75ac598e79a87066cff8388bbb646c4d47af. The pinned README credits a Lean and proof workflow using Claude Opus and Gemini, directed and verified by Le. Release · Source revision
  • Imports the exponent statements, canonical factorization, denominator clearing, cyclic subgroup extension, and determinant proof. The flatness hypothesis is the unique decomposition of exponents from Lemma 3.1 of the paper. The Lean conclusion establishes nonzero determinant. Huang–Jafari, Definition 2.1, Lemma 3.1 and Question 4.13(2)
  • The cyclic subgroup extension is exported independently of the semigroup-algebra argument. If a subset of the positions in a bijective digit factorization represents a proper subgroup, one further position extends it, with its carry in the original subgroup.

Port and validation

  • Ported from Lean v4.33.1 to v4.36.0 with Mathlib fc4f59e577. Split the proof into modules for statements, canonical factorization, scaling, the cyclic-group argument and the determinant. Replaced the Mathlib umbrella import with explicit dependencies, used Mathlib’s additive character and reduction homomorphism, and removed the diagnostic command.
  • The public wrapper builds warning-free. Generated indexes, scoped Batteries declaration lint, text lint, card declarations, axiom closure, forbidden-option environment audit and compiler-message audit passed locally. The content-only diff leaves Python checks outside its scope.
  • Three runs of taskset -c 4-7 lake build LeanPool.HuangJafari.FlatRectangle on the Azure VM removed the five project modules’ build artifacts before each run and reused the pinned dependency cache. Median wall time was 10.12 s before (10.12, 9.46, 10.30 s) and 5.24 s after (5.84, 5.24, 5.10 s). Median Lake time for CyclicFactorization was 2.5 s before and 1.7 s after. VM load varied between these runs. The optimized cyclic module also passed standalone Lean profiling.

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

Author validation: approve for inclusion.

  • Faithfulness. FlatRectangleNonSingularOn quantifies over the two numerical semigroups, their injectively enumerated minimal Apéry exponents and all rectangle factorizations, and concludes that the determinant of logYZMatrix is nonzero. IsFlatAlg encodes the unique decomposition criterion of Huang–Jafari Lemma 3.1. The rational statement follows by clearing denominators in both finite generating sets. The PR claims precisely the determinant conclusion of Question 4.13(2).
  • Proof and significance. The canonical-factorization proof establishes existence, uniqueness, and that the row's own coefficient vanishes. After scaling to gcd one, box_mod_bijective identifies the unique box coordinates with residues. cyclic_hajos_step uses the standard character of the quotient by the current subgroup to identify a new digit whose carry lands in the subgroup. The determinant proof kills a hypothetical kernel vector one coordinate at a time. The subgroup extension has no numerical-semigroup assumptions and is independently importable.
  • Novelty and sources. The pinned Mathlib and Tau Ceti searches found the character and matrix machinery used by the port but no cyclic digit subgroup-extension theorem or Apéry-rectangle determinant theorem. The prior Lean Pool PR #1160 registered the repository in the candidates list. No project card or import for this result exists on main. The pinned Apache-2.0 source, release timestamp, proof-workflow credit and the cited paper support the card.
  • Engineering and trust. Reviewed the five proof modules, the public wrappers and the card. The import uses explicit Mathlib modules and the standard additive-character API, with no generated certificates or external verification. The public wrapper, all 78 scoped declarations, the card declarations, axiom closure, option-injection and compiler-message audits, generated indexes and text style passed locally. The profiled cyclic proof completed successfully. GitHub's required checks and configured review provide the release gate for this head.

@github-actions

github-actions Bot commented Dec 6, 2026

Copy link
Copy Markdown
Contributor

Project metadata advisory

This advisory summarizes source-project metadata for project entries added or changed by this PR.

Project Change Source License Last commit Lean
huang-jafari added linh-math-proofs/huang-jafari-semigroup-algebras Apache-2.0 2026-12-05 v4.33.1

License is read from GitHub SPDX metadata when available, and the last commit and Lean version are read from the source repository's default branch.

@greptile-apps

greptile-apps Bot commented Dec 6, 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.

[Low impact] No blocking issue was established, but the unavailable upstream evidence prevents an unconditional merge recommendation.

RetriggerView in Greptile

Summary

Imports the flat Apéry rectangle nonsingularity proof and exports the cyclic-group extension theorem.

  • Flat rectangular Apéry factorizations now have a proved nonzero determinant.
  • Rectangle boundary weights now get unique canonical factorizations.
  • Cyclic digit factorizations can now extend a represented subgroup.

Reviews (3) · Last reviewed commit: "Label generalized canonical factorizatio..." · Reviewed by Greptile

Comment thread LeanPool/HuangJafari/Statement.lean Resolved
Comment thread LeanPool/projects/huang-jafari.yaml Resolved
@github-actions

github-actions Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Proof profile (new / modified Lean files)

lake build wall time (changed modules): 39.82 s (= 0.66 min) — user 16.09 s, sys 7.19 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.

Total heartbeats: 110,163 maxHeartbeats units across 7 valid files (1,096 added LOC).

Sum of lean --profile: 11421.8 ms (= 11.42 s) across 7 valid files. Import-excluded time: 4983.8 ms (= 4.98 s).

Count-heartbeats wall-clock total: 24.20 s. Repeated import cost inside lean --profile: 6438.0 ms (= 6.44 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/HuangJafari/FlatRectangle.lean 317 46,387 4.52 2.16 1.51 0.65 24 0
LeanPool/HuangJafari/Scaling.lean 268 28,639 4.43 2.01 1.45 0.56 15 0
LeanPool/HuangJafari/CyclicFactorization.lean 199 16,802 5.36 2.93 0.81 2.12 8 0
LeanPool/HuangJafari/Factorization.lean 174 16,133 4.43 1.27 0.71 0.56 10 0
LeanPool/HuangJafari/Statement.lean 102 2,202 1.61 0.79 0.24 0.54 19 0
LeanPool/HuangJafari.lean 22 0 1.88 1.57 0.14 1.43 2 0
LeanPool/HuangJafari/Imports.lean 14 0 1.97 0.70 0.12 0.58 1 0
Total 1,096 110,163 24.20 11.42 4.98 6.44 79 0

Aggregate phase totals

Phase Time
import 6438.0 ms (= 6.44 s)
interpretation 1228.2 ms (= 1.23 s)
typeclass inference 1113.4 ms (= 1.11 s)
tactic execution 933.0 ms (= 0.93 s)
simp 730.0 ms (= 0.73 s)
type checking 321.4 ms (= 0.32 s)
initialization 191.6 ms (= 0.19 s)
elaboration 123.5 ms (= 0.12 s)
linting 96.5 ms (= 0.10 s)
parsing 58.2 ms (= 0.06 s)
process pre-definitions 39.4 ms (= 0.04 s)
declTypeLinter 30.2 ms (= 0.03 s)

Slowest changed modules (from lake build)

Changed module Lake time
LeanPool.HuangJafari.CyclicFactorization 4.60 s
LeanPool.HuangJafari.Statement 3.70 s
LeanPool.HuangJafari.FlatRectangle 1.50 s
LeanPool.HuangJafari.Factorization 1.30 s
LeanPool.HuangJafari.Scaling 1.20 s
LeanPool.HuangJafari.Imports 0.73 s
LeanPool.HuangJafari 0.72 s
Per-file `lean --profile` output

LeanPool/HuangJafari.lean

import took 1.43s
cumulative profiling times:
	declTypeLinter 0.267ms
	elaboration 0.21ms
	import 1.43s
	initialization 33.4ms
	interpretation 101ms
	linting 0.5ms
	module linting 0.0232ms
	parsing 0.0289ms
	tacticAnalysis 0.417ms
real 2.22
user 0.74
sys 0.74

LeanPool/HuangJafari/CyclicFactorization.lean

import took 2.12s
cumulative profiling times:
	attribute application 0.0212ms
	congr simp thm 2.49ms
	declTypeLinter 2.83ms
	dsimp 0.872ms
	elaboration 20.8ms
	fix level params 0.533ms
	import 2.12s
	initialization 27.5ms
	instantiate metavars 3.05ms
	interpretation 217ms
	let-to-have transformation 0.0795ms
	linting 17ms
	module linting 0.0191ms
	norm_num 0.14ms
	parsing 11.6ms
	process pre-definitions 4.85ms
	share common exprs 3.23ms
	simp 60.6ms
	tactic execution 175ms
	tacticAnalysis 2.72ms
	type checking 39.4ms
	typeclass inference 223ms
real 3.33
user 1.63
sys 0.92

LeanPool/HuangJafari/Factorization.lean

import took 556ms
cumulative profiling times:
	attribute application 0.0303ms
	blocked (unaccounted) 0.177ms
	congr simp thm 1.73ms
	declTypeLinter 4.84ms
	elaboration 11.7ms
	fix level params 1.14ms
	import 556ms
	initialization 25.9ms
	instantiate metavars 2.23ms
	interpretation 172ms
	let-to-have transformation 0.0365ms
	linting 13.5ms
	module linting 0.0234ms
	parsing 9.77ms
	process pre-definitions 5.4ms
	share common exprs 2.73ms
	simp 79.4ms
	tactic execution 129ms
	tacticAnalysis 3.18ms
	type checking 69.8ms
	typeclass inference 179ms
real 1.65
user 1.29
sys 0.69

LeanPool/HuangJafari/FlatRectangle.lean

import took 646ms
cumulative profiling times:
	attribute application 0.0956ms
	congr simp thm 8.05ms
	declTypeLinter 7.01ms
	dsimp 6.05ms
	elaboration 32ms
	fix level params 0.947ms
	import 646ms
	initialization 26.6ms
	instantiate metavars 9.08ms
	interpretation 311ms
	let-to-have transformation 0.0888ms
	linting 34.1ms
	module linting 0.0302ms
	norm_num 2.95ms
	parsing 18.6ms
	process pre-definitions 12.3ms
	ring 18.4ms
	share common exprs 7.66ms
	simp 220ms
	tactic execution 350ms
	tacticAnalysis 6.23ms
	type checking 170ms
	typeclass inference 272ms
real 2.07
user 2.15
sys 0.73

LeanPool/HuangJafari/Imports.lean

import took 582ms
cumulative profiling times:
	declTypeLinter 0.131ms
	elaboration 0.0722ms
	import 582ms
	initialization 26.6ms
	interpretation 93.2ms
	linting 0.2ms
	module linting 0.0256ms
	parsing 0.00173ms
	tacticAnalysis 0.121ms
real 1.37
user 0.74
sys 0.70

LeanPool/HuangJafari/Scaling.lean

import took 562ms
cumulative profiling times:
	attribute application 0.0826ms
	congr simp thm 4.29ms
	declTypeLinter 7.34ms
	elaboration 34.9ms
	fix level params 3.96ms
	import 562ms
	initialization 26ms
	instantiate metavars 5.81ms
	interpretation 199ms
	let-to-have transformation 0.157ms
	linting 25ms
	module linting 0.0274ms
	parsing 13ms
	process pre-definitions 13ms
	share common exprs 8.39ms
	simp 370ms
	tactic execution 279ms
	tacticAnalysis 4.88ms
	type checking 40.5ms
	typeclass inference 410ms
real 1.74
user 2.00
sys 0.70

LeanPool/HuangJafari/Statement.lean

import took 542ms
cumulative profiling times:
	attribute application 0.0719ms
	compilation (IR) 0.14ms
	compilation (LCNF base) 1.63ms
	compilation (LCNF impure) 0.519ms
	compilation (LCNF mono) 0.984ms
	declTypeLinter 7.81ms
	elaboration 23.8ms
	fix level params 0.205ms
	import 542ms
	initialization 25.6ms
	instantiate metavars 0.106ms
	interpretation 135ms
	let-to-have transformation 0.0757ms
	linting 6.18ms
	module linting 0.0209ms
	parsing 5.19ms
	process pre-definitions 3.89ms
	share common exprs 0.435ms
	tacticAnalysis 1.96ms
	type checking 1.75ms
	typeclass inference 29.4ms
real 1.36
user 0.81
sys 0.69

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

@Vilin97

Vilin97 commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

🤖 LLM review (gpt-6.2-sol, 5 rubrics)

Reviewed head: 06a8af949a8470fd36ae20d8e9a3ff18f140a0fc

Verdict: ✅ approve — computed from the rubric verdicts below, not chosen by a model.

Rubric Verdict Bottom line
Faithfulness ✅ pass All three card claims match the Lean, and the targeted build passed while the head’s pool CI was still running. Head CI
Novelty ✅ pass Source searches of pinned Mathlib, pinned Tau Ceti, and the pool found no duplicate headline, with broader equivalence still unverifiable and all seven changed Lean modules compiling locally while the head’s full CI build remained in progress. CI run
Significance ✅ pass The general determinant theorem meets the pool’s research bar, and all seven added Lean modules compiled locally while the full CI build was still running. Build pool check
Sources ✅ pass The determinant statement matches Huang–Jafari’s Question 4.13(2), and Le’s pinned formalization supports the cyclic subgroup lemma and the labelled generalization of canonical factorization. Huang–Jafari · Pinned Lean source
Code quality (advisory) ⚠️ flag All seven Lean modules compiled locally and Lean Action CI passed for this head, with duplicated rectangle transport and digit-sum proofs worth consolidating. Lean Action CI
Aspect Value
Proves the claim ✅ proves_it
Assumed, not proved The determinant theorem takes finite positive generation, exponent flatness, a rectangle indexed by the minimal Apéry exponents, and the canonical rows as inputs. The separate factorization theorem proves those rows exist uniquely using the stated cancellation and weight membership hypotheses. The cyclic theorem assumes the stated digit bijection, digit ranges of size at least two, and a subgroup represented by a proper subset of positions.
Matches cited source ✅ matches
Fit ✅ good_fit
Level research
Branch commutative algebra
Mode mixed
Code quality 3 / 5

Statement check: For every flat rectangular numerical semigroup extension in ℚ≥0, the integer matrix with the side lengths on the diagonal and the negated canonical digits off the diagonal satisfies (logYZMatrix β B).det ≠ 0. Huang–Jafari, equation (4)

The project resolves Huang–Jafari’s Question 4.13(2) in every finite dimension by using a character sum to extend subgroups in a cyclic digit factorization and prove (logYZMatrix β B).det ≠ 0. Question 4.13(2)

Novelty findings (2)

  • partial-overlap — LeanPool/HuangJafari/Factorization.lean:94
    The existing Apéry decomposition covers a base generated by one positive natural number. HuangJafari.existsUnique_rectangleFactorization handles a flat rectangular extension of cancellative additive commutative monoids and proves unique bounded coordinates with q.2 i = 0 for each boundary row.
    Evidence: Tau Ceti’s AddSubmonoid.existsUnique_mem_aperySet_mul_add_eq uniquely writes an element as a multiple of a positive member plus an Apéry representative. Tau Ceti declaration
  • partial-overlap — LeanPool/HuangJafari/CyclicFactorization.lean:128
    The PR reuses Tau Ceti’s bounded representatives lemma after proving the existence of an unused digit satisfying j ∉ J ∧ β j • g j ∈ H. It then identifies the enlarged subgroup with the digit vectors supported on insert j J.
    Evidence: Tau Ceti’s Subgroup.mem_sup_zpowers_iff_exists_mul_pow gives bounded representatives after adjoining a normalizing element under the premise hpow : x ^ m ∈ H. Tau Ceti declaration

Code quality findings (5)

  • duplicate-proof — LeanPool/HuangJafari/Scaling.lean:247
    Denominator clearing and gcd normalization each choose preimages for the weights and row offsets, then transport the same three rectangle hypotheses. Extract this step into a lemma in Scaling.lean so a change to the rectangle predicates requires one update.
    Evidence: In flatRectangleNonSingular_iff_nat, let sN : Fin n → ℕ := fun i ↦ Classical.choose (hs_mem i) is followed by rw [← hsN_eq] at hs hrect hfact. In FlatRectangle.lean:214, flatRectangleNonSingularNat_holds repeats this with let s₁ : Fin n → ℕ := fun i ↦ Classical.choose (hs_mem i) and rw [← hs₁_eq] at hs hrect hfact.
  • duplicate-proof — LeanPool/HuangJafari/CyclicFactorization.lean:168
    Both directions of the subgroup extension split the sum at the changed digit and prove that every other summand is unchanged. The two factorization proofs repeat the same bookkeeping. Use Function.update for the digit changes and rewrite the resulting sums with Function.apply_update and Finset.sum_update_of_mem.
    Evidence: In cyclic_hajos_step, each direction uses Finset.sum_congr rfl on Finset.univ.erase j, first after let c : ∀ i : Fin n, Fin (β i) := Function.update c₀ j r and then after let c₀ : ∀ i : Fin n, Fin (β i) := fun i ↦ if i = j then ⟨0, hβ0 i⟩ else c i. The same split appears in two_le_beta_of_isRectangle at Factorization.lean:62 and existsUnique_rectangleFactorization at Factorization.lean:126.
  • library-reuse — LeanPool/HuangJafari/FlatRectangle.lean:30
    The difference predicate carries its own closure proofs, including a positive and negative split for integer scaling. Bundle the same carrier as an AddSubgroup ℤ. Negation swaps the two witnesses, and zsmul_mem and sum_mem supply the closure steps used in the Bézout argument.
    Evidence: InDiff is defined by ∃ a ∈ S, ∃ b ∈ S, (a : ℤ) - (b : ℤ) = z. The proof of inDiff_zmul introduces let p : ℕ := c.toNat and let q : ℕ := (-c).toNat, and exists_gcd_diff uses Finset.sum_induction _ (InDiff S) (fun _ _ ↦ inDiff_add).
  • proof-reuse — LeanPool/HuangJafari/FlatRectangle.lean:131
    The surjectivity helper constructs an Apéry representative by a separate least-witness argument. Its sole caller already has flatness. Pass that hypothesis to the helper, decompose the constructed representative in the larger monoid, and use divisibility to send the base term to zero modulo d.
    Evidence: apery_mod_surj uses let w : ℕ := Nat.find hex and exact Nat.find_min hex hs₂_lt ⟨hs₂, hs₂_mod⟩. Its only call is rcases apery_mod_surj hd_dvd h1_diff z with ⟨w, hw_ap, hw_mod⟩ in box_mod_bijective, which takes (hflat : IsFlatAlg S S').
  • library-reuse — LeanPool/HuangJafari/CyclicFactorization.lean:39
    The carry proof contains local proofs for finding an index outside a smaller finset and mapping a finite sum through a character. Use Finset.exists_mem_notMem_of_card_lt_card for the first and map_sum on χ.toAddMonoidHom for the second, leaving the proof focused on the carry argument.
    Evidence: exists_carry_into_subgroup proves have hex_out : ∃ i₀ : Fin n, i₀ ∉ J := by via have hJ_univ : J = Finset.univ := by. At line 76, it proves χ (∑ a ∈ s, f a) = ∏ a ∈ s, χ (f a) via induction s using Finset.induction_on with.

Tokens: 9,264,694 in / 46,313 out across 5 model calls · Tier: codex-subscription · Effort: xhigh · Billing: Codex subscription quota (no API credits) · Estimated cost: $37.7535 (Standard API equivalent; uncached input)
Each rubric is an independent review against .github/review-rubrics/ on top of .github/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 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.

Author validation follow-up: approve for inclusion at 391eae8a3f.

  • The matrix docstring now cites Equation (4), and the project card states the cyclic lemma’s lower bound of two on each digit range. The determinant theorem retains its statement. I checked the corrected citation against the paper and the radix hypothesis against the Lean signature. Huang–Jafari, §4 · Initial configured review
  • The carry proof uses Mathlib’s cyclic quotient equivalence and standard additive character. It then uses Tau Ceti’s bounded representatives to identify the enlarged subgroup. The scaling proof shares the lift of finite generating sets and uses Mathlib’s closure-map and finite Bézout lemmas. Canonical factorization now accepts direct generator membership and derives digit positivity from the bounded row. The two arithmetic reductions still lift their exponent data at the point of use.
  • The warning-free project build, generated indexes, text style, seven-module declaration lint, card declarations, axiom closure, forbidden-option environment audit and build-message audit passed. The five-module benchmark after review repairs was 6.97 s median (7.33, 6.97, 6.78 s), against 10.12 s for the original baseline. The cyclic module, the determinant module and the scaling module passed standalone profiling.

@Vilin97

Vilin97 commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator Author

/review

Please review 391eae8a3f. It corrects the matrix citation and states the radix premise. The library reuse changes and local checks are described in the independent re-review.

@Vilin97

Vilin97 commented Dec 6, 2026

Copy link
Copy Markdown
Collaborator Author

/review

Please review 06a8af949a. The card now labels canonical factorization as a generalization of the pinned theorem and identifies the relaxed premise. The project build, generated indexes, declarations and trust audits passed locally.

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

Author validation follow-up: approve for inclusion at 06a8af949a.

The upstream canonical factorization assumes an enumeration of the minimal Apéry exponents. The port’s theorem instead assumes each weight belongs to the larger monoid. I verified that the card now identifies this generalization and cites the upstream statement. The Lean sources are identical to the previous head, whose proof and dependency review is linked below. The generated indexes, project build, card declarations, and axiom, environment and compiler-message audits passed locally. Pinned upstream theorem · Author review of the Lean changes

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