Skip to content

feat(peps): close the injective PEPS Fundamental Theorem (positivity + connectivity faithful)#2406

Merged
LionSR merged 52 commits into
feat/peps-gaugeconsistencyfrom
feat/peps-1361
Jun 6, 2026
Merged

feat(peps): close the injective PEPS Fundamental Theorem (positivity + connectivity faithful)#2406
LionSR merged 52 commits into
feat/peps-gaugeconsistencyfrom
feat/peps-1361

Conversation

@LionSR

@LionSR LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Closes the injective PEPS Fundamental Theorem

fundamentalTheorem_PEPS (arXiv:1804.04964, Theorem 2) is proved sorry-free, #print axioms-clean ([propext, Classical.choice, Quot.sound], no sorryAx) on the source-faithful statement:

IsVertexInjective A, IsVertexInjective B, SameState A B, ∀ e, 0 < A.bondDim e, ∀ e, 0 < B.bondDim e, G.ConnectedGaugeEquiv A B.

Two faithfulness defects found and corrected

The chain was originally doubly false — silently missing two of the source's standing assumptions, each now restored and justified by a machine-checked counterexample:

The proof chain (all axiom-clean)

edgeBlockedThreeSiteInjective (#1366) · physical_to_virtual_insertion (#1370) · isEdgeBlockedInsertionAlgebraIsomorphism (#1367) · two_injective_tensor_insertion_comparison (#1361, the operator-Schmidt comparison) · one_vertex_complement_comparison · vertex-complement region injectivity (VertexComplement/) · edgeInsertedCoeff_applyGauge (open-edge gauge cancellation) · post_absorption_edge_insertion_equality (#1364) · bondDim_eq_of_matrixAlgEquiv (#874) · the coefficient identity + SameTwoBlockInsertions · exists_bondGauge_of_fullContraction (operator-Schmidt uniqueness) · exists_edgeScalars_of_connected (spanning-tree edge-scalar solve) · perVertex_gauge_identity (gauge inversion) · exists_stateCoeff_ne_zero (state nonvanishing via the vertex-complement split).

Scope note

This closes the existence / gauge-equivalence clause (Theorem 2). The separate uniqueness-modulo-balanced-edge-scalars clause (gauge_unique_mod_edge_scalars) retains its own pre-existing sorry and is NOT in this theorem's dependency chain (confirmed by the clean axiom print).

Deeply stacked (#2396#2399#2400#2403←this). Closes #128 (existence clause); refs #1252, #1360, #1361, #1364, #874.

Copilot AI review requested due to automatic review settings June 6, 2026 13:54

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6e38963daf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean

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.

Pull request overview

This PR advances the PEPS two-injective tensor insertion comparison formalization (two_injective_tensor_insertion_comparison, issue #1361) by adding sorry-free reduction lemmas and refactoring the main theorem to explicitly split the empty-configuration boundary case from the substantive nonempty-bond case (delegated to a new _core theorem that still contains the remaining sorry).

Changes:

  • Added twoBlockInsertedCoeff_matrixUnit, relating a one-bond matrix-unit insertion to an “open-bond” contraction over configurations.
  • Added sameOpenBondContraction, deriving the paper’s first “one-leg-open” reduction from SameTwoBlockInsertions via matrix units.
  • Refactored two_injective_tensor_insertion_comparison to dispatch the empty-config case (vacuous) vs the nonempty-config case (handled by new two_injective_tensor_insertion_comparison_core with a tracked sorry).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review: feat(peps): reductions toward two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

I checked out the branch and the file compiles (lake env lean TNLean/PEPS/TwoInjectiveComparison.lean exits 0). The only sorry is at line 441 (two_injective_tensor_insertion_comparison_core); the three new lemmas twoBlockInsertedCoeff_matrixUnit, twoBlockReciprocalScalarProportional_of_isEmpty_config, and sameOpenBondContraction are sorry-free and their proofs are correct. The empty-config refactor of the main theorem is sound, and threeLeg_residual_forms_scalar (referenced in the docstrings) exists in TNLean/PEPS/TensorFactorScalar.lean:66.

One 🔴 blocker and two 🟡 issues remain.


🔴 Proof correctness — two_injective_tensor_insertion_comparison_core (line 441) is false as stated

The _core theorem omits [Nonempty Bond], which the main theorem two_injective_tensor_insertion_comparison (line 479) and …_singletonBond (line 349) both carry. Without it the statement is false, so its sorry is not an honest placeholder for a true-but-hard result — it is unprovable:

When Bond is empty, SharedBondConfig bondDim = (b : Bond) → bondDim b is the unique empty function, so Nonempty (SharedBondConfig bondDim) holds, while both hbond : ∀ b, Nonempty (bondDim b) and hinsert : SameTwoBlockInsertions … are vacuous. Taking External₁ = External₂ = Physical₁ = Physical₂ = Unit and A₁ ≡ 1, B₁ ≡ 2, A₂ ≡ 1, B₂ ≡ 1, all four are IsTwoBlockInjective and every hypothesis holds, but TwoBlockReciprocalScalarProportional requires c ≠ 0 with 1 = c·2 and 1 = c⁻¹·1, forcing c = ½ and c = 1 at once — contradiction.

Fix: add [Nonempty Bond] to _core. The call site in two_injective_tensor_insertion_comparison already has [Nonempty Bond] in scope (and, in the branch that calls _core, even establishes hcfg : Nonempty (SharedBondConfig bondDim)), so the hypothesis passes through with no friction. With [Nonempty Bond] the statement becomes true and the documented Z, U, W route is again a viable proof target.

(The automated reviewer raised the same point as P1; I concur and am marking it a merge blocker.)

🟡 Mathlib naming — sameOpenBondContraction (line 405)

This is a theorem but is named in camelCase with no snake_case structure. The file uses camelCase/PascalCase for defs/predicates (SameTwoBlockInsertions, SameAwayFromBond) and snake_case for theorems (two_injective_tensor_insertion_comparison_singletonBond, twoBlockInsertedCoeff_singletonBond_single). As written, the name reads like a definition. Rename to a snake_case form, e.g. openBondContraction_of_sameInsertions.

🟡 Documentation accuracy — sameOpenBondContraction docstring (line 396)

The docstring states the per-bond insertion hypothesis "is equivalent to" the one-leg-open contraction equalities, but only the forward direction (SameTwoBlockInsertions ⟹ open-bond equality) is proved. Use "implies"/"gives" rather than "equivalent", or add the reverse-direction lemma. (Also flagged by the automated reviewer.)


ℹ️ Advisory

  • twoBlockReciprocalScalarProportional_of_isEmpty_config docstring (line 375) describes the case where "some shared virtual bond carries an empty index space", while the hypothesis is the equivalent-but-more-direct IsEmpty (SharedBondConfig bondDim). The characterization is mathematically correct (a finite Pi is empty iff some factor is empty), but stating the hypothesis form in the docstring would read more cleanly. (Also flagged by the automated reviewer.)
  • The sorry on _core itself is acceptable as a tracked research obligation under the repo's honest-sorry pattern — once the [Nonempty Bond] fix above makes the statement true. The net sorry count is unchanged from before this PR (the previous direct sorry in two_injective_tensor_insertion_comparison is now discharged for the empty-config branch and otherwise delegated to _core).

No paper-gap files are modified in this PR, so that review category does not apply here.

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

Blueprint ↔ Lean & Prose Review

4 missing blueprint entries (Category A) · 4 prose findings (Category B)


Category A — Blueprint ↔ Lean equivalence

The PR adds four new Lean declarations but no corresponding blueprint entries. Per A.4 every new theorem/lemma requires a \begin{theorem/lemma} block with \lean{...}, status tags, and \uses{}.

Declaration File line Status Finding
twoBlockInsertedCoeff_matrixUnit 239 sorry-free Missing entry; generalises thm:peps_twoBlockInsertedCoeff_singletonBond
twoBlockReciprocalScalarProportional_of_isEmpty_config 381 sorry-free Missing entry; used in the proof of the main theorem
sameOpenBondContraction 405 sorry-free Missing entry; source-cited first reduction of arXiv:1804.04964 §3
two_injective_tensor_insertion_comparison_core 441 sorry Missing entry; single remaining open case of thm:peps_twoInjectiveTensorInsertionComparison

The last three of these are all directly cited source steps or load-bearing subcases — none qualify as purely internal implementation details. The \uses{thm:peps_twoInjectiveGaugeScalarReduction} on thm:peps_twoInjectiveTensorInsertionComparison will also need updating once the _core entry exists, to thread the dependency chain through the new intermediates.


Category B — Prose quality

Location Finding
Line 237 `twoBlockInsertedCoeff_singletonBond_single` names a Lean declaration in body prose; replace with "the coefficient-extraction theorem for one shared bond"
Line 396 "is equivalent to" overstates the theorem — only the forward direction is proved; replace with "implies equality of"
Line 403 `SameTwoBlockInsertions` and `twoBlockInsertedCoeff_matrixUnit` used as mathematical objects in body prose; replace with mathematical descriptions
Line 428 `threeLeg_residual_forms_scalar` named in body prose (not in the explicitly marked proof-status note); replace with "the residual three-leg comparison theorem"

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean

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

Review Summary

This PR makes genuine progress toward two_injective_tensor_insertion_comparison (#1361), adding three sorry-free lemmas (twoBlockInsertedCoeff_matrixUnit, twoBlockReciprocalScalarProportional_of_isEmpty_config, sameOpenBondContraction) and refactoring the main theorem to dispatch the empty-configuration case. The reduction route is correctly documented and the new proofs are mathematically sound.

However, there are outstanding issues — all already identified by the three bot review comments on this PR — that must be addressed before merge.

🔴 Blocker — Proof Correctness

two_injective_tensor_insertion_comparison_core (line 441) is missing a [Nonempty Bond] hypothesis. The theorem as stated is mathematically false: when Bond is empty, hbond : ∀ b, Nonempty (bondDim b) is vacuously true and SameTwoBlockInsertions is vacuously true, but the reciprocal scalar proportionality conclusion does not hold. A counterexample: single-point external/physical spaces with A₁ ≡ 1, B₁ ≡ 2, A₂ ≡ 1, B₂ ≡ 1. Both injectivity hypotheses hold, both insertion hypotheses hold vacuously, but no nonzero scalar c can satisfy both A₁ = c·B₁ and A₂ = c⁻¹·B₂. Adding [Nonempty Bond] (which is already available in the sole caller, two_injective_tensor_insertion_comparison) makes the statement provable without changing the downstream dispatch.

This was raised by chatgpt-codex-connector[bot] in discussion_r3367464746 and is still unresolved.

🟡 Requires Changes — Documentation

  1. sameOpenBondContraction (line 396): The docstring says "The per-bond insertion hypothesis is equivalent to equality of all one-leg-open contractions", but the lemma only proves the forward direction (SameTwoBlockInsertions → open-leg equality). The reverse direction is not proved. The docstring should say "implies" or "gives."

    Raised by Copilot in discussion_r3367465277.

  2. twoBlockReciprocalScalarProportional_of_isEmpty_config (line 373): The docstring opens with "If some shared virtual bond carries an empty index space", an interpretation of the hypothesis. The hypothesis is directly IsEmpty (SharedBondConfig bondDim) (the configuration family is empty). The docstring should first state the direct hypothesis before giving the interpretation.

    Raised by Copilot in discussion_r3367465290.

ℹ️ Advisory

  • sameOpenBondContraction naming: The Same prefix conventionally marks Propositions/predicates in this file (SameAwayFromBond, SameTwoBlockInsertions). This lemma states an equality (Prop as conclusion, but an equality statement, not a structural predicate). Consider openBondContraction_eq_of_sameInsertions or similar.

  • Unnecessary open scoped Classical in on sameOpenBondContraction (line 395): The proof is a single rwa that doesn't need classical reasoning. Harmless but could be removed for cleanliness.

  • Documented sorry on _core: The single remaining sorry is honestly documented with an in-source proof status marker and a precise sketch of the remaining work (the nonlinear inversion of A₂ and B₁ to read off the gauges Z, U, W). Acceptable under the paper-realignment exception in CLAUDE.md. The file builds cleanly with #print axioms showing no new axioms.

Verdict

REQUEST_CHANGES — the 🔴 blocker and two 🟡 documentation issues must be resolved before approval. All three are small, well-scoped fixes.

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

Review: synchronize — new additions in twoBlockInsertedCoeff_one through twoBlockLeftInverse

Verdict: REQUEST_CHANGES.

No previously raised issues have been addressed. The unresolved threads from the prior review remain: twoBlockInsertedCoeff_matrixUnit (missing blueprint + Lean jargon), twoBlockReciprocalScalarProportional_of_isEmpty_config (missing blueprint + docstring inaccuracy), sameOpenBondContraction (missing blueprint + "equivalent" overstating + Lean jargon), and two_injective_tensor_insertion_comparison_core (missing blueprint + Lean jargon + missing [Nonempty Bond], the last of which is a correctness blocker flagged by the automated reviewer and confirmed in the prior summary). Those threads remain open and are not re-raised here.

This review covers only the newly added declarations: twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockLeftInverse (and its auxiliary _comp / _apply wrappers).

New findings: 3 missing blueprint entries (A.4) and 4 Lean-jargon issues (B).

Category A

Declaration Issue
twoBlockInsertedCoeff_one (line 431) No blueprint entry; sorry-free theorem cited to arXiv:1804.04964 §3 as "the starting reduction"
fullContraction_eq (line 467) No blueprint entry; sorry-free theorem cited as "the all-identity contraction equality" in the same lemma
twoBlockLeftInverse (line 507) No blueprint definition entry; docstring explicitly names it as the paper's "inverse of an injective tensor"

Category B

Line Issue
428 `twoBlockInsertedCoeff` Lean identifier used as mathematical reference
464 `SameTwoBlockInsertions` and `twoBlockInsertedCoeff_one` Lean identifiers used as mathematical references
487 `Finsupp.linearCombination` namespaced implementation identifier
503 `twoBlockComb A` Lean expression used as mathematical noun

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated

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

Review: reductions toward two_injective_tensor_insertion_comparison (#1361)

I built the changed file (lake env lean TNLean/PEPS/TwoInjectiveComparison.lean, exit 0): the only sorry warning is at line 566 (two_injective_tensor_insertion_comparison_core), all other new lemmas compile and the Mathlib lemmas they invoke (LinearIndependent.finsuppLinearCombination_injective, LinearMap.exists_leftInverse_of_injective, Classical.nonempty_pi, Function.update_self/update_of_ne) resolve. Net sorry count is unchanged: the old sorry on the main theorem is now discharged via the empty/nonempty dispatch, and the single remaining sorry moved into _core with a clear proof-status marker. The refactor itself is clean.

🔴 Blocker — two_injective_tensor_insertion_comparison_core is false as stated (proof correctness)

two_injective_tensor_insertion_comparison_core (line 556) omits [Nonempty Bond] and instead carries only hbond : ∀ b, Nonempty (bondDim b). That hypothesis set does not force Bond to be inhabited, and when Bond is the empty type the statement is false:

  • SharedBondConfig bondDim = (b : Bond) → bondDim b is a singleton (the empty dependent function) when Bond = ∅Classical.nonempty_pi gives Nonempty (∀ b, bondDim b) vacuously, so the configuration family is nonempty.
  • hbond is vacuous, and SameTwoBlockInsertions A₁ B₁ A₂ B₂ quantifies over b : Bond, so hinsert is also vacuous.
  • The conclusion TwoBlockReciprocalScalarProportional still demands a single nonzero c with A₁ = c·B₁ and A₂ = c⁻¹·B₂.

Counterexample (all of External₁, External₂, SharedBondConfig, Physical₁, Physical₂ singletons): A₁ = 1, B₁ = 2, A₂ = 1, B₂ = 1. Each tensor is a single nonzero scalar, hence IsTwoBlockInjective; hinsert and hbond hold vacuously; but A₁ = c·B₁ forces c = 1/2 while A₂ = c⁻¹·B₂ forces c = 1 — contradiction. So the sorry at line 566 is unprovable as stated, and _core is a public theorem whose statement is wrong.

This is exactly the unresolved Codex thread (P1 — Require a nonempty shared-bond family) on line 564; I independently confirm it. The defect is contained for now — the only call site (two_injective_tensor_insertion_comparison, line 607) supplies [Nonempty Bond] and derives hbond from a nonempty config, so the main theorem statement remains true and faithful (it is the one-point-external specialization of arXiv:1804.04964 §3 Lemma inj_equal_tensors_2). But a public lemma carrying a load-bearing sorry that can never be discharged must be corrected before merge.

Fix: add [Nonempty Bond] to _core (the source assumes nonzero-dimensional virtual bonds, so this is faithful, and the sole call site already has it in scope). I am leaving the Codex thread unresolved.

🟡 Requires changes — docstring of sameOpenBondContraction overstates the result (documentation)

The docstring (line 398) states the per-bond insertion hypothesis is equivalent to equality of all one-leg-open contractions, but the theorem proves only the forward direction SameTwoBlockInsertions → (one-leg-open equalities). The reverse is not established here. "Equivalent" misrepresents what the declaration proves; it should read "implies". This is already flagged by the Copilot thread and the Claude thread on line 398 — both unresolved and correct; please address one of them.

ℹ️ Advisory — currently-unused scaffolding (modularity)

twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockComb_injective, twoBlockLeftInverse, twoBlockLeftInverse_comp, twoBlockLeftInverse_apply, and sameOpenBondContraction are not yet referenced by any proof. This is acceptable given the PR's explicit purpose (reusable reductions toward the _core proof) and each is documented with its intended role, but the dead-code surface should be retired or consumed when the inversion route lands so it does not accumulate.

Out of scope (handled by the Blueprint Sync & Prose Review workflow)

The existing Claude threads requesting blueprint entries (A.4) for twoBlockInsertedCoeff_matrixUnit, twoBlockReciprocalScalarProportional_of_isEmpty_config, sameOpenBondContraction, two_injective_tensor_insertion_comparison_core, and the "Lean identifier in docstring prose" (Category B) notes are blueprint-sync / prose concerns and are not assessed here; I leave them for that workflow.

Paper faithfulness

No docs/paper-gaps/ file is modified in this PR, and the cited note peps_injective_ft_section3_route.tex accurately records the remaining nonlinear inversion obligation (left-inverse of A₂, then B₁, to extract the Z,U,W gauges) — consistent with the _core docstring and the PR's numerical-rank finding. No discrepancy found there.

Verdict

REQUEST_CHANGES. The false _core statement (missing [Nonempty Bond]) is a correctness blocker, and the sameOpenBondContraction "equivalent" overstatement requires a documentation fix. Both are small, mechanical changes.

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

Review: feat(peps): reductions toward two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

This is a follow-up review triggered by the synchronize event (new commits pushed after the previous review). The file still compiles (lake build TNLean.PEPS.TwoInjectiveComparison exits 0), and the newly added lemmas in commit 0be58d7 (twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockComb_injective, twoBlockLeftInverse, twoBlockLeftInverse_comp, twoBlockLeftInverse_apply) are mathematically correct and properly grounded in Mathlib. However, none of the issues from the previous review cycle have been addressed. The same 🔴 blocker and two 🟡 issues remain.


🔴 Proof correctness — two_injective_tensor_insertion_comparison_core (line 566) is false as stated

The theorem lacks [Nonempty Bond]. When Bond is empty, hbond : ∀ b, Nonempty (bondDim b) and hinsert : SameTwoBlockInsertions … are both vacuous, but the conclusion TwoBlockReciprocalScalarProportional A₁ B₁ A₂ B₂ is not forced — a concrete counterexample with External₁ = External₂ = Physical₁ = Physical₂ = Unit, A₁ ≡ 1, B₁ ≡ 2, A₂ ≡ 1, B₂ ≡ 1 satisfies all hypotheses while the conclusion demands contradictory scalars (c = ½ and c = 1).

Fix: add [Nonempty Bond] to _core. The only call site (in two_injective_tensor_insertion_comparison, line 607) already has [Nonempty Bond] in scope, so the fix passes through with no downstream friction. With this hypothesis the statement becomes true and the documented Z, U, W inversion route is a viable proof target. Until fixed, the sorry on this theorem is not an honest placeholder — it marks an unprovable statement.

(Previously flagged by both the automated reviewer and claude[bot]; still unresolved.)

🟡 Mathlib naming — sameOpenBondContraction (line 407)

This is a theorem but is named in camelCase, reading like a definition. The file consistently uses camelCase/PascalCase for defs and predicates (SameTwoBlockInsertions, SameAwayFromBond, IsTwoBlockInjective) and snake_case for theorems (two_injective_tensor_insertion_comparison_singletonBond, fullContraction_eq, twoBlockInsertedCoeff_one). Rename to a snake_case form, e.g. openBondContraction_of_sameInsertions or same_openBondContraction.

(Previously flagged; still unresolved.)

🟡 Documentation — sameOpenBondContraction docstring (line 398)

The docstring states the per-bond insertion hypothesis "is equivalent to" equality of all one-leg-open contractions, but the theorem only proves the forward direction (SameTwoBlockInsertions → open-bond equality). The reverse direction (which would hold by linearity of X in the matrix insertions) is not proved. Replace "is equivalent to" with "implies" / "gives", or add the reverse lemma.

(Previously flagged; still unresolved.)


ℹ️ Advisory

  • twoBlockReciprocalScalarProportional_of_isEmpty_config docstring (line 375): Describes the case where "some shared virtual bond carries an empty index space" while the hypothesis is the equivalent but more direct IsEmpty (SharedBondConfig bondDim). Stating the hypothesis form would read more cleanly. (Previously flagged; still unresolved.)

  • New code quality: The new lemmas in commit 0be58d7 are well-structured. twoBlockComb_injective correctly dispatches through Mathlib's LinearIndependent.finsuppLinearCombination_injective (which is definitional — Iff.rfl). twoBlockLeftInverse properly uses LinearMap.exists_leftInverse_of_injective from Mathlib/LinearAlgebra/Basis/VectorSpace. The @[simp] lemmas twoBlockLeftInverse_comp and twoBlockLeftInverse_apply give the defining equations. All new proofs are sorry-free and #print axioms-clean.

  • The sorry on _core is acceptable as a tracked research obligation under the repo's honest-sorry pattern — once the [Nonempty Bond] fix makes the statement true. The net sorry count is unchanged from before this PR (the previous direct sorry in the main theorem is now discharged for the empty-config branch and delegated to _core).

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

Review summary (synchronize — new commits)

No issues from the previous round have been fixed; those threads remain open. The new commits add seven source-cited theorems with no blueprint entries and four prose violations.

Category A — Blueprint ↔ Lean equivalence

7 new missing blueprint entries (all in ch13a_peps_ft.tex):

Declaration Line Blueprint action required
twoBlockComb 488 \begin{definition} + statement \leanok
IsTwoBlockInjective.config_linearIndependent 553 \begin{lemma} + statement + proof \leanok
exists_dual_isolating 592 \begin{lemma} + statement + proof \leanok
gauge_eq1 621 \begin{lemma} + statement + proof \leanok
gauge_eq2 656 \begin{lemma} + statement + proof \leanok
gauge_inv 702 \begin{lemma} + statement + proof \leanok
exists_bondGauge_of_fullContraction 777 \begin{theorem} + statement + proof \leanok

These are all sorry-free and source-cited to arXiv:1804.04964, Section 3, lines 1157–1204. Each needs \uses{} referencing its dependencies once those entries exist.

7 from previous round still open: twoBlockInsertedCoeff_matrixUnit, twoBlockReciprocalScalarProportional_of_isEmpty_config, sameOpenBondContraction, two_injective_tensor_insertion_comparison_core, twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockLeftInverse.

Category B — Prose quality

4 new prose violations:

Line Issue
549 "bridge" — banned §2 → "connection"
650 `gauge_eq1` as mathematical reference — banned §1
764 `fullContraction_eq` as mathematical reference — banned §1
771 "at the heart of" — banned §3 → "central to"

8 from previous round still open: Lean identifiers in docstrings of twoBlockInsertedCoeff_matrixUnit, sameOpenBondContraction, two_injective_tensor_insertion_comparison_core, twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockLeftInverse; "equivalent" overstating sameOpenBondContraction.

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

Review (synchronize): feat(peps): reductions toward two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

I checked out the latest commit (4f81a63) and ran lake env lean TNLean/PEPS/TwoInjectiveComparison.lean: it exits 0 with exactly one sorry warning at line 860 (two_injective_tensor_insertion_comparison_core) and no other sorry/axiom/native_decide/admit. The new operator-Schmidt / bond-gauge infrastructure (twoBlockInsertedCoeff_matrixUnit, sameOpenBondContraction, twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockLeftInverse, IsTwoBlockInjective.config_linearIndependent, exists_dual_isolating, gauge_eq1/gauge_eq2/gauge_inv, exists_bondGauge_of_fullContraction) all type-check and are sorry-free.

🔴 Proof integrity / correctness — two_injective_tensor_insertion_comparison_core (line 860) is false as stated

This is the merge blocker. It is already raised on the open inline thread from chatgpt-codex-connector (line 868) and in the prior claude[bot] summary; the latest push added [Nonempty External₁] [Nonempty External₂] and (hbond : ∀ b, Nonempty (bondDim b)) but did not add the missing [Nonempty Bond], so the obstruction is unchanged.

When Bond is empty, SharedBondConfig bondDim = ((b : Bond) → bondDim b) is the unique empty function, so it is a singleton (Nonempty holds), while hbond and hinsert : SameTwoBlockInsertions … are both vacuous (they quantify over b : Bond). Take External₁ = External₂ = Physical₁ = Physical₂ = Unit, A₁ ≡ 1, B₁ ≡ 2, A₂ ≡ 1, B₂ ≡ 1. All four are IsTwoBlockInjective (the single index (η, μ) carries the nonzero vector σ ↦ 1), and every hypothesis holds. But TwoBlockReciprocalScalarProportional (def, line 120) requires one c ≠ 0 with TwoBlockScalarProportional A₁ B₁ c and TwoBlockScalarProportional A₂ B₂ c⁻¹, forcing c = ½ and c = 1 simultaneously — contradiction.

Because the statement is false, the sorry at line 860 is not an honest placeholder for a true-but-hard result: it can never be discharged, and any direct downstream use of _core (not routed through the main theorem) would be unsound. This is exactly why fullContraction_eq — the intended first step of the eventual proof — itself carries [Nonempty Bond] (it picks Classical.arbitrary Bond); _core cannot reach it without the same hypothesis.

Fix: add [Nonempty Bond] to two_injective_tensor_insertion_comparison_core. The sole caller two_injective_tensor_insertion_comparison (line 896) already has [Nonempty Bond] in scope, so the instance passes through with zero friction, and with it the documented Z, U, W route becomes a valid proof target for the retained sorry.

🟡 Mathlib naming — sameOpenBondContraction (line 407)

Pure-camelCase theorem name; see the inline comment. Rename to snake_case (e.g. openBondContraction_of_sameInsertions).

ℹ️ Advisory

  • set_option maxHeartbeats 400000 on exists_bondGauge_of_fullContraction (line 757): per docs/PROOF_INTEGRITY.md this is a warning, not a blocker, and it carries an inline justification (noncomputable Fintype (SharedBondConfig bondDim) unification across the four gauge-extraction calls). Acceptable.
  • set_option linter.unusedFintypeInType false on IsTwoBlockInjective.config_linearIndependent: justified inline (the Fintype instances are used in the proof but not the statement). Acceptable.
  • Modularity: exists_dual_isolating, gauge_eq1, gauge_eq2, and gauge_inv are fully general linear-algebra facts (operator-Schmidt uniqueness over arbitrary K, V1, V2) with no PEPS content. Consider hoisting them to a TNLean/Algebra/ module (or upstreaming) rather than leaving them in a PEPS leaf file. Not blocking.
  • exists_bondGauge_of_fullContraction is sorry-free but currently unused; it is the staged operator-Schmidt step for the eventual _core proof, so keeping it is reasonable.

Out of scope here (deferred to Blueprint Sync & Prose Review)

The open claude-authored threads requesting blueprint \begin{theorem}/\begin{lemma}/\begin{definition} entries (Category A.4) and the Category B "Lean identifier in docstring prose" threads fall under the Blueprint-Sync/Prose workflow and are not assessed in this review. They were not addressed by the latest push, so I have left them unresolved rather than re-raising them.

No files under docs/paper-gaps/ are changed in this PR, so that review category does not apply.

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated

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

Review: feat(peps): reductions toward two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

This is a synchronize-triggered review of commit 4f81a63. The file compiles, the new sorry-free lemmas are mathematically correct, and the operator-Schmidt gauge infrastructure (gauge_eq1, gauge_eq2, gauge_inv, exists_bondGauge_of_fullContraction) is well-structured and properly grounded in Mathlib. However, none of the 🔴 blocker or 🟡 issues from the prior five review cycles have been addressed.

🔴 Blocker — Proof correctness

two_injective_tensor_insertion_comparison_core (line 860) is false as stated — missing [Nonempty Bond]. When Bond is empty, hbond and hinsert are vacuously true and Nonempty (SharedBondConfig bondDim) holds, but the conclusion fails: A₁=1, B₁=2, A₂=1, B₂=1 on singletons forces contradictory scalars (c = 1/2 and c = 1). The sorry on this theorem is not an honest placeholder — it marks an unprovable statement.

Fix: add [Nonempty Bond] to _core. The sole caller (line 911) already has [Nonempty Bond] in scope.

This was raised by chatgpt-codex-connector[bot] in discussion_r3367464746 and confirmed independently in every subsequent review cycle. Must be fixed before merge.

🟡 Mathlib style — sameOpenBondContraction (line 407)

Named in camelCase but is a theorem. The file convention is camelCase/PascalCase for defs/predicates and snake_case for theorems. Rename to e.g. openBondContraction_of_sameInsertions. Previously flagged by claude[bot] across multiple cycles. Must be fixed before approval.

🟡 Documentation — sameOpenBondContraction docstring (line 398)

States the per-bond insertion hypothesis "is equivalent to" open-leg equalities, but only the forward direction (SameTwoBlockInsertions → open-bond equality) is proved. Replace "equivalent" with "implies." Previously flagged by copilot-pull-request-reviewer[bot] in discussion_r3367465277. Must be fixed before approval.

ℹ️ Advisory

  • twoBlockReciprocalScalarProportional_of_isEmpty_config docstring (line 375): Opens with an interpretation rather than the direct hypothesis IsEmpty (SharedBondConfig bondDim). Advisory only.

  • maxHeartbeats 400000 (line 757): Justified by Classical-derived Fintype instances but consider sharing the instance across the four gauge calls. Advisory only.

  • All new sorry-free proofs are mathematically sound (gauge_eq1, gauge_eq2, gauge_inv, exists_bondGauge_of_fullContraction, config_linearIndependent, exists_dual_isolating, twoBlockInsertedCoeff_matrixUnit, twoBlockInsertedCoeff_one, fullContraction_eq, twoBlockComb, twoBlockLeftInverse). The operator-Schmidt gauge extraction correctly applies dual functionals to linear independent families.

  • The documented sorry on _core is acceptable as a tracked research obligation — once the [Nonempty Bond] fix makes the statement true. Net sorry count is unchanged from before this PR. The Z, U, W inversion route is a viable proof target.

Out of scope

Blueprint ↔ Lean sync and prose quality issues (previously flagged Category A/B threads) are not assessed here per review instructions.

@LionSR LionSR changed the title feat(peps): reductions toward two_injective_tensor_insertion_comparison (#1361) feat(peps): close two_injective_tensor_insertion_comparison (#1361) Jun 6, 2026

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

Blueprint ↔ Lean & Prose Review (synchronize)

4 missing blueprint entries (Category A) · 4 prose findings (Category B)


Resolved from prior rounds

Two open threads are now settled:

  • [Nonempty Bond] missing in _core (chatgpt-codex-connector thread, previously a 🔴 correctness blocker): two_injective_tensor_insertion_comparison_core now carries [Nonempty Bond] in its signature. ✅ Thread resolved.
  • `threeLeg_residual_forms_scalar` in prose (claude thread): the old proof sketch was replaced entirely. ✅ Thread resolved (outdated).

Category A — Blueprint ↔ Lean equivalence

A.2 — Proof \leanok on thm:peps_twoInjectiveTensorInsertionComparison

The \leanok added to \begin{proof} is valid: the Lean proof of two_injective_tensor_insertion_comparison is now fully sorry-free (it dispatches to two_injective_tensor_insertion_comparison_core and twoBlockReciprocalScalarProportional_of_isEmpty_config, both sorry-free). No action required here.

A.4 — New missing blueprint entries (this synchronize)

Four new sorry-free source-cited theorems have no blueprint entry (inline comments posted):

Declaration Line Required entry
bilinear_coeff_zero 849 \begin{lemma} + statement \leanok + proof \leanok
reindex_update 886 \begin{lemma} + statement \leanok + proof \leanok
bondGauge_master_constraint 925 \begin{theorem} + statement \leanok + proof \leanok
bondGauge_scalar_of_master 1042 \begin{theorem} + statement \leanok + proof \leanok

A.4 — Update required on existing open thread

The existing thread on two_injective_tensor_insertion_comparison_core (PRRT_kwDORK8b986Hkg0Y) noted that the blueprint entry should not include a proof \leanok (proof was sorry). The proof is now sorry-free. The blueprint entry, when added, must include proof \leanok as well.

A.4 — Prior missing entries (from review bodies, still open)

The following entries were flagged in the bodies of prior reviews but have not been added. They must still be addressed:

Declaration Round first raised
twoBlockInsertedCoeff_matrixUnit Round 1
twoBlockReciprocalScalarProportional_of_isEmpty_config Round 1
sameOpenBondContraction Round 1
two_injective_tensor_insertion_comparison_core Round 1
twoBlockInsertedCoeff_one Round 2
fullContraction_eq Round 2
twoBlockLeftInverse Round 2
IsTwoBlockInjective.config_linearIndependent Round 3
exists_dual_isolating Round 3
gauge_eq1 Round 3
gauge_eq2 Round 3
gauge_inv Round 3
exists_bondGauge_of_fullContraction Round 3

Category B — Prose quality

New inline comments posted for four issues:

Location Issue
Lean line 915 `sameOpenBondContraction` as mathematical reference (§1)
Lean line 1039 "packages" — banned §2 term
Lean lines 1127–1134 Four Lean identifiers as mathematical references in _core docstring (§1)
Blueprint line 2418 "packaged" in proof sketch — banned §2 term

Prior prose issues raised in review bodies (still unaddressed):

Location Issue Round
Lean line 549 "bridge" — banned §2 Round 3
Lean line 650 `gauge_eq1` as mathematical reference (§1) Round 3
Lean line 771 "at the heart of" — banned §3 Round 3

Summary: 4 new A.4 entries missing · 1 A.4 entry needing proof \leanok update · 13 prior A.4 entries still missing · 4 new prose findings · 3 prior prose findings unaddressed. REQUEST_CHANGES.

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

The main theorem two_injective_tensor_insertion_comparison is now fully proven — the sorry is gone, #print axioms is clean, and the proof strategy (operator-Schmidt uniqueness on the fully contracted state → bond gauge → master per-bond constraint → scalar-diagonal gauge → reciprocal proportionality) is mathematically sound and well-structured. This is a substantial achievement and closes #1361.

However, three 🟡 issues remain, two of which were flagged in previous review cycles and are still unfixed.


🟡 Mathlib naming — sameOpenBondContraction (line 407)

This theorem is named in pure camelCase with no snake_case structure, so it reads like a def/predicate. The file convention is camelCase/PascalCase for definitions/predicates (SameTwoBlockInsertions, SameAwayFromBond, IsTwoBlockInjective) and snake_case for theorems (fullContraction_eq, gauge_eq1, bilinear_coeff_zero, bondGauge_master_constraint). All other new theorems in this PR follow snake_case.

Rename to a snake_case form such as openBondContraction_of_sameInsertions.

Flagged in the previous review cycle and remains unfixed. Must be fixed before approval.


🟡 Documentation accuracy — sameOpenBondContraction docstring (line 398)

The docstring says:

The per-bond insertion hypothesis is equivalent to equality of all one-leg-open contractions

But the Lean theorem only proves the forward direction: SameTwoBlockInsertions → (equal one-leg-open contractions). Writing "equivalent" overstates the result. Change "is equivalent to" to "implies" or state the proved direction explicitly.

Flagged in the previous review cycle and remains unfixed. Must be fixed before approval.


🟡 Dead code — twoBlockLeftInverse machinery (lines 483–532)

The five declarations twoBlockComb, twoBlockComb_injective, twoBlockLeftInverse, twoBlockLeftInverse_comp, and twoBlockLeftInverse_apply are unused in the final proof. Grep confirms that twoBlockComb and twoBlockLeftInverse are referenced only in their own definitions and companion theorems — never in two_injective_tensor_insertion_comparison_core or anywhere else in the file (or codebase).

The PR description acknowledges the proof strategy shifted from the left-inverse-of-A₂ approach to operator-Schmidt uniqueness (gauge_eq1/gauge_eq2/gauge_invexists_bondGauge_of_fullContraction). These five declarations (~45 lines) are legacy from the abandoned approach and should be removed, or a comment must document the planned future use.

Must be resolved before approval.


ℹ️ Advisory

  • maxHeartbeats 400000 (line 757): Well-documented, modest raise, acceptable. The Classical-derived noncomputable Fintype instances for SharedBondConfig bondDim cause unification overhead across the four gauge-extraction calls in exists_bondGauge_of_fullContraction.
  • exists_dual_isolating (line 592) and bilinear_coeff_zero (line 849): These are general lemmas about linear independence in complex vector spaces that could be upstreamed to Mathlib. Fine for now.
  • No paper-gap files are modified in this PR, so that review category does not apply.
  • The blueprint ↔ Lean and prose review categories are handled by the dedicated workflow and are not covered here.

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

Blueprint ↔ Lean sync and prose review — synchronize round

Summary of new findings (this round only; prior unresolved threads still stand):

Category A — equivalence and status: 3 issues

# Kind Location Issue
A1 A.4 missing entry TwoInjectiveComparison.lean:777 exists_bondGauge_of_fullContraction — the key operator-Schmidt uniqueness step. The new blueprint proof sketch directly corresponds to it but has no blueprint node.
A2 A.4 missing entries TwoInjectiveComparison.lean:621–702 gauge_eq1, gauge_eq2, gauge_inv — three source-cited (arXiv:1804.04964, lines 1157–1204), sorry-free sub-lemmas of the operator-Schmidt argument, with no blueprint entries.
A3 A.4 missing entries TwoInjectiveComparison.lean:925, 1042 bondGauge_master_constraint and bondGauge_scalar_of_master — the master constraint equation labeled \eqref{eq:peps_residual_equality} in the new blueprint proof and the "Hence $g=\lambda I$" step, respectively. Both are sorry-free and source-cited; neither has a blueprint entry.

Note (not a new finding, stale comment): The proof body of gaugeConsistency (FundamentalTheorem.lean, line 599) still says "two_injective_tensor_insertion_comparison, still sorry, #1361". That sorry was removed by this PR. The comment should be updated to reflect the new status.

Category B — prose: 5 issues

# Kind Location Issue
B1 §2 banned term TwoInjectiveComparison.lean:549 "bridge" as a noun for a connection → "connection" or restate mathematically.
B2 §3 banned phrase TwoInjectiveComparison.lean:771 "at the heart of" → "central to".
B3 §1 Lean identifiers TwoInjectiveComparison.lean:1127–1135 Five Lean declaration names used as mathematical references in the two_injective_tensor_insertion_comparison_core docstring.
B4 §1 Lean identifiers TwoInjectiveComparison.lean:1195–1203 Three Lean declaration names used as proof-structure description in the two_injective_tensor_insertion_comparison docstring.
B5 §prose formula blueprint/ch13a_peps_ft.tex:2397–2398 "equates the two fully contracted states" is a word-only description of the key contraction identity $\sum_\mu A_1 A_2 = \sum_\nu B_1 B_2$; the identity must be displayed.
B6 §1 Lean identifier TwoInjectiveComparison.lean:915 `sameOpenBondContraction` in the bondGauge_master_constraint docstring.

Count: 3 equivalence/status issues (A1–A3), 6 prose issues (B1–B6). Existing unresolved threads from the prior round remain open.

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment on lines +1127 to +1135
The fully contracted identity supplies a bond gauge `g` with `A₁ = g · B₁` and
`B₂ = g · A₂` (`exists_bondGauge_of_fullContraction`). Substituting both gauge
equations into each one-leg-open contraction (`sameOpenBondContraction`) and
separating the two injective families `B₁` and `A₂` yields the master per-bond
constraint `bondGauge_master_constraint`. Iterating that constraint over all
shared bonds forces `g` to be a nonzero scalar multiple of the identity
(`bondGauge_scalar_of_master`), which is exactly the source statement that the
residual gauges on the freed leg groups are scalar. Reinserting `g = lam · 1`
into the gauge equations gives `A₁ = lam · B₁` and `A₂ = lam⁻¹ · B₂`. -/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — Lean identifiers as mathematical references in docstring (§1)

The proof-sketch portion of this docstring uses five backtick-quoted Lean declaration names as if they were mathematical objects:

`exists_bondGauge_of_fullContraction`, `sameOpenBondContraction`, `bondGauge_master_constraint`, `bondGauge_scalar_of_master`, `g = lam · 1`

Per §1 backticks in Lean docstrings are permitted only "when explaining how to use the API of this declaration." A proof-by-name sketch is not explaining the API; it is narrating the proof. Replace with mathematical phrasing, for example:

The fully contracted identity — contracting all shared bonds by the identity and equating the two states — yields an invertible gauge matrix $g$ with $A_1 = g \cdot B_1$ and $B_2 = g \cdot A_2$. Substituting both gauge equations into the one-bond-open contraction and separating the linearly independent Schmidt families forces, for every bond $b$ and endpoints $p,q$, the master constraint $[\rho_b=q],g_{\rho^{b\to p},\nu}=[\nu_b=p],g_{\rho,\nu^{b\to q}}$. Iterating over all shared bonds forces $g=\lambda I$ for some scalar $\lambda\neq 0$. Reinserting gives $A_1=\lambda B_1$ and $A_2=\lambda^{-1}B_2$.

Comment on lines +1195 to +1203
When the shared-bond configuration family is nonempty the result is the
substantive case `two_injective_tensor_insertion_comparison_core`: the fully
contracted identity yields a bond gauge that the one-leg-open contractions force
to be a nonzero scalar multiple of the identity, giving $A_1=\lambda B_1$ and
$A_2=\lambda^{-1}B_2$ (arXiv:1804.04964, Section 3, lines 1157--1204). The
single-shared-bond specialization is `two_injective_tensor_insertion_comparison_singletonBond`.
When some shared bond carries an empty index space the configuration family is
empty and the conclusion holds vacuously
(`twoBlockReciprocalScalarProportional_of_isEmpty_config`). -/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — Lean declaration names used as mathematical references in docstring (§1)

Lines 1195–1203 reference three Lean declaration names as mathematical descriptions of the proof structure:

two_injective_tensor_insertion_comparison_coretwo_injective_tensor_insertion_comparison_singletonBondtwoBlockReciprocalScalarProportional_of_isEmpty_config

Per §1, backtick references in Lean docstrings are permitted only when explaining how to use the API of this declaration. A proof-structure summary is not API documentation. These three sentences (lines 1195–1203) could be dropped entirely — the proof is now sorry-free and the structure is visible from the Lean body — or replaced with a one-sentence mathematical summary of the two cases:

When every shared bond has a nonempty index space the result follows from operator-Schmidt uniqueness; when some bond's index space is empty the conclusion holds vacuously.

Comment on lines +2397 to +2398
Putting $X=I_{D_b}$ on every shared bond contracts all bonds diagonally and,
by the insertion equality, equates the two fully contracted states. Writing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — word-only description of a contraction identity; formula required

Putting $X=I_{D_b}$ on every shared bond contracts all bonds diagonally and,
by the insertion equality, equates the two fully contracted states.

This is a verbal description of the key contraction identity without displaying it. Per the prose-style rule for tensor-network arguments, the contraction equality must be written out. The identity being asserted is

$$ \sum_{\mu} A_1(\eta_1,\mu,\sigma_1),A_2(\eta_2,\mu,\sigma_2) = \sum_{\nu} B_1(\eta_1,\nu,\sigma_1),B_2(\eta_2,\nu,\sigma_2). $$

Replace the verbal phrase with a display, for example:

Putting $X=I_{D_b}$ on every shared bond in the insertion equality gives, for
every $(\eta_1,\sigma_1,\eta_2,\sigma_2)$,
\[
    \sum_{\mu} A_1(\eta_1,\mu,\sigma_1)\,A_2(\eta_2,\mu,\sigma_2)
    = \sum_{\nu} B_1(\eta_1,\nu,\sigma_1)\,B_2(\eta_2,\nu,\sigma_2).
\]
Writing each side as a bipartite operator with the linearly independent Schmidt
families supplied by injectivity, the operator-Schmidt uniqueness of
\cite[Section~3]{Molnar2018NormalPEPS} produces …

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

Three 🟡 issues must be addressed before approval. The mathematical content is solid, the main theorem is fully proven (sorry-free, #print axioms clean), and the proof strategy (operator-Schmidt uniqueness → bond gauge → master constraint → scalar reduction) correctly follows arXiv:1804.04964, Section 3, Lemma inj_equal_tensors_2.

Summary of findings

🟡 Blocking issues (must fix before approval):

  1. Mathlib naming (sameOpenBondContraction, line 407): Theorem named in pure camelCase. Should be snake_case per docs/MATHLIB_naming.md — the file uses camelCase for definitions/predicates (SameTwoBlockInsertions) and snake_case for theorems (fullContraction_eq, twoBlockInsertedCoeff_one). Suggest openBondContraction_of_sameInsertions.

  2. Documentation accuracy (line 398): Docstring says the insertion hypothesis is "equivalent" to one-leg-open equality, but the theorem only proves the forward implication. Change "equivalent" to "implies".

  3. Modularity (line 621): Five operator-Schmidt lemmas (gauge_eq1, gauge_eq2, gauge_inv, exists_dual_isolating, bilinear_coeff_zero) are generic linear algebra with no PEPS content. At minimum, add a sectioning comment marking them as general linear algebra (not PEPS-specific) so future clients (MPS, channel theory) can discover them.

ℹ️ Advisory (acceptable with justification):

  1. Documentation (line 375): twoBlockReciprocalScalarProportional_of_isEmpty_config docstring should state the direct hypothesis (IsEmpty (SharedBondConfig bondDim)) before its interpretation.

  2. Performance (line 757): maxHeartbeats 400000 is explained and modest — acceptable.

What's good:

  • The main theorem two_injective_tensor_insertion_comparison (arXiv:1804.04964, Lemma inj_equal_tensors_2) is now fully provensorry-free, #print axioms clean.
  • bondDim_eq_of_matrixAlgEquiv closes the bond-dimension equality sorry in fundamentalTheorem_PEPS (issue #874) using the edgeTransferAlgEquiv dimension count.
  • The proof strategy is faithful to the source paper.
  • Both files compile cleanly (lake env lean TNLean/PEPS/TwoInjectiveComparison.lean and lake env lean TNLean/PEPS/FundamentalTheorem.lean both exit 0).
  • The chatgpt-codex-connector's [Nonempty Bond] concern from a prior review is resolved — _core now carries hbond : ∀ b, Nonempty (bondDim b).

Out of scope (handled by Blueprint Sync & Prose Review workflow):

  • Missing blueprint entries and Lean-identifier-in-prose findings — these have been flagged in separate prior review rounds and remain tracked there.

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

Code review — feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES (mathematical core is verified and correct; the blocking items are in-scope 🟡 style/modularity/doc-accuracy already raised in the prior cycle and still unaddressed).

I checked out the merge commit, fetched the Mathlib cache, and verified everything below directly.

✅ Proof integrity — clean

  • lake env lean TNLean/PEPS/TwoInjectiveComparison.lean → exit 0.
  • lake build TNLean.PEPS.FundamentalTheorem → success.
  • Axiom check on the headline results:
    • two_injective_tensor_insertion_comparison[propext, Classical.choice, Quot.sound]
    • two_injective_tensor_insertion_comparison_core[propext, Classical.choice, Quot.sound]
      No sorryAx in either. The PR body's "Remaining (precise)" section (claiming _core retains an honest sorry) is stale — later commits (5d57e2c, 4e7a946) closed it. Worth correcting the description, but not a blocker.
  • The three sorry warnings remaining in FundamentalTheorem.lean (lines 554 post_absorption_edge_insertion_equality #1364, 577 gaugeConsistency, 1032 gauge_unique_mod_edge_scalars) are pre-existing theorems outside this PR's diff — acceptable known TODOs.

✅ Proof correctness — verified

The new proof replaces the planned three-leg Z,U,W/threeLeg_residual_forms_scalar route with a direct operator–Schmidt uniqueness argument, and it is sound:

  • exists_bondGauge_of_fullContraction builds an invertible bond gauge g (with explicit inverse g', g*g'=1) from the fully contracted identity via gauge_eq1/gauge_eq2 and config-indexed linear independence (IsTwoBlockInjective.config_linearIndependent). gauge_inv correctly yields g·g' = 1.
  • I hand-checked bondGauge_scalar_of_master: hoffdiag (instantiating the master constraint at p=q=μ b, ρ=μ) forces g μ ν = 0 when μ b ≠ ν b; hconst1 (at p=ν b, ρ=update ν b q) gives diagonal invariance under single-bond edits; the Finset.induction hagree propagates this to g = λ·I, and g*g'=1 forces λ ≠ 0. Correct.
  • Faithfulness: the public signature of two_injective_tensor_insertion_comparison is unchanged — the four IsTwoBlockInjective hypotheses and SameTwoBlockInsertions match the pre-existing statement and arXiv:1804.04964 §3 Lemma inj_equal_tensors_2. No hypothesis was smuggled in; the [Nonempty …] instances are structural. The empty-SharedBondConfig branch is discharged vacuously (twoBlockReciprocalScalarProportional_of_isEmpty_config), matching the source's nonzero-bond setting.

✅ Bond-dimension equality (#874) — honestly closed

The new hDim proof in fundamentalTheorem_PEPS discharges the old sorry via edgeTransferAlgEquiv + bondDim_eq_of_matrixAlgEquiv. I confirmed the supporting chain is itself axiom-clean: IsVertexInjective.edgeBlockedThreeSiteInjective, edgeTransferAlgEquiv, and bondDim_eq_of_matrixAlgEquiv each print [propext, Classical.choice, Quot.sound]. So the bond-dim closure is not resting on a hidden sorry. bondDim_eq_of_matrixAlgEquiv itself is a clean Module.finrank_matrix + Nat.mul_self_inj argument.

🟡 Items that must be addressed before approval (already on record from the prior cycle)

  1. NamingsameOpenBondContraction is a theorem (Prop-valued equality) with a pure-camelCase name, unlike its siblings fullContraction_eq, twoBlockInsertedCoeff_one, twoBlockComb_injective. Per docs/MATHLIB_naming.md, theorems take snake_case (e.g. open_bond_contraction_eq / …_of_sameInsertions). (Existing thread on line 407.)
  2. Documentation accuracysameOpenBondContraction's docstring says the per-bond insertion hypothesis is "equivalent" to the one-leg-open equalities, but the lemma proves only the forward implication (SameTwoBlockInsertions → open-leg equality). Change "equivalent" to "implies". (Existing threads on line 398.)
  3. Modularitygauge_eq1, gauge_eq2, gauge_inv, exists_dual_isolating, and bilinear_coeff_zero are fully general operator-Schmidt / linear-algebra lemmas ({K V1 V2 : Type*}, no PEPS content) living in a PEPS application file. They should be relocated to an Algebra/-layer module (and are plausibly upstreamable). (Existing thread on line 621.)

ℹ️ Advisory

  • Performance: set_option maxHeartbeats 400000 in on exists_bondGauge_of_fullContraction is justified by the noncomputable Classical-derived Fintype (SharedBondConfig …) unification across the four gauge-extraction calls, and is documented inline. Acceptable; a more targeted instance fix would be preferable long-term. (Existing thread on line 757.)
  • Stale comment: in gaugeConsistency (FundamentalTheorem.lean:595–599, outside the diff hunks) the dependency note still calls two_injective_tensor_insertion_comparison "still sorry, #1361". This PR makes that false — after merge the only open dependency of gaugeConsistency is post_absorption_edge_insertion_equality (#1364). Please refresh that comment.

The Category A (blueprint \lean/\leanok/missing-entry) and Category B (Lean identifiers / banned phrasing in docstrings and .tex) threads are handled by the dedicated Blueprint Sync & Prose Review workflow and are out of scope here; I have not duplicated or resolved them.

Overall: excellent, genuinely sorry-free and axiom-clean mathematics on the injective-PEPS path. The remaining blockers are the naming, docstring-accuracy, and lemma-placement cleanups above.

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

The PR makes substantial mathematical progress: two_injective_tensor_insertion_comparison is now sorry-free (0 sorries in TwoInjectiveComparison.lean), the fundamentalTheorem_PEPS bond-dimension equality hDim is discharged via bondDim_eq_of_matrixAlgEquiv with edgeTransferAlgEquiv (closing #874), and the open-edge gauge machinery in TNLean/PEPS/FundamentalTheorem.lean (edgeInsertedCoeff_applyGauge et al.) is complete. The _core theorem now correctly carries [Nonempty Bond], fixing the falsity identified in the previous review. The proof route — operator-Schmidt uniqueness via bipartite decompositions, a bond gauge g, a per-bond master constraint, and scalar-diagonality of g — is the paper-faithful route described in docs/paper-gaps/peps_injective_ft_section3_route.tex. I build-checked the branch: lake build TNLean.PEPS.TwoInjectiveComparison and lake build TNLean.PEPS.FundamentalTheorem both succeed, and the only remaining sorries in the touched files are the pre-existing obligations gaugeConsistency and post_absorption_edge_insertion_equality.

However, six 🟡 issues remain from the previous review, none of which were addressed in this push:

🟡 Mathlib naming — sameOpenBondContraction (line 407)

Named in pure camelCase (reads like a def/predicate). The file convention is snake_case for theorems. Rename to e.g. openBondContraction_of_sameInsertions.

🟡 Documentation accuracy — "equivalent" overstatement (line 398)

The docstring for sameOpenBondContraction claims the per-bond insertion hypothesis is "equivalent" to the one-leg-open equalities, but the Lean theorem only proves the forward direction (SameTwoBlockInsertions → equality). Write "implies" or state the proved direction explicitly.

🟡 Modularity — operator-Schmidt lemmas in PEPS file

gauge_eq1, gauge_eq2, gauge_inv, exists_dual_isolating, and bilinear_coeff_zero (lines 592–849) are generic linear-algebra results stated over abstract {K V1 V2 : Type*} with no PEPS content. They should be relocated to a shared algebra module or at minimum have a section comment marking them as general linear algebra.

🟡 Documentation — banned terms

  • "bridge" (line 549, §2 of docs/prose_style.md)
  • "at the heart of" (line 771, §3 of docs/prose_style.md)

🟡 Blueprint — missing entries

Eleven new sorry-free theorems (twoBlockInsertedCoeff_matrixUnit, sameOpenBondContraction, fullContraction_eq, twoBlockLeftInverse, exists_bondGauge_of_fullContraction, gauge_eq1/eq2/inv, bondGauge_master_constraint, bondGauge_scalar_of_master, two_injective_tensor_insertion_comparison_core) lack corresponding \begin{theorem}/\begin{lemma} blocks with \lean{...}/\leanok tags in ch13a_peps_ft.tex.

ℹ️ Advisory (do not block approval)

  • The maxHeartbeats 400000 on exists_bondGauge_of_fullContraction is explained and modest.
  • The twoBlockReciprocalScalarProportional_of_isEmpty_config docstring describes an interpretation of the hypothesis ("some shared virtual bond carries an empty index space") rather than the hypothesis itself (IsEmpty (SharedBondConfig bondDim)). State the hypothesis form first.
  • Several docstrings contain backtick-quoted Lean identifiers in prose (Category B from previous review). While these should be fixed per docs/prose_style.md §1, these are handled by the dedicated Blueprint Sync & Prose Review workflow and are not separately enforced here.

What was fixed since the last review

  • two_injective_tensor_insertion_comparison_core now has [Nonempty Bond] — the falsity identified in the previous review is resolved.
  • two_injective_tensor_insertion_comparison_core is now proof-complete (was sorry).
  • two_injective_tensor_insertion_comparison is now sorry-free (0 sorries in TwoInjectiveComparison.lean).
  • fundamentalTheorem_PEPS's hDim sorry is discharged via bondDim_eq_of_matrixAlgEquiv + edgeTransferAlgEquiv.

Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
Comment thread TNLean/PEPS/TwoInjectiveComparison.lean Outdated
first block,
\leanok
Putting $X=I_{D_b}$ on every shared bond contracts all bonds diagonally and,
by the insertion equality, equates the two fully contracted states. Writing

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Blueprint — missing entries for new sorry-free Lean theorems.

The following new theorems in this PR (all sorry-free) contribute steps to the proof of thm:peps_twoInjectiveTensorInsertionComparison but lack corresponding \begin{theorem}/\begin{lemma} blocks with \lean{...} and \leanok tags:

  • twoBlockInsertedCoeff_matrixUnit — generalizes _singletonBond_single to a multi-bond family; cited as "the matrix-unit coefficient-extraction result"
  • twoBlockReciprocalScalarProportional_of_isEmpty_config — the vacuous empty-config case
  • sameOpenBondContraction — the first reduction: SameTwoBlockInsertions ⟹ one-leg-open equalities
  • twoBlockInsertedCoeff_one — the identity-insertion specialization
  • fullContraction_eq — the all-identity contraction equality
  • twoBlockLeftInverse — the chosen left inverse of the injective linear-combination map
  • exists_bondGauge_of_fullContraction — the operator-Schmidt uniqueness step
  • gauge_eq1, gauge_eq2, gauge_inv — the individual operator-Schmidt equations
  • bondGauge_master_constraint — the per-bond master constraint equation \eqref{eq:peps_residual_equality}
  • bondGauge_scalar_of_master — the scalar-diagonality conclusion
  • two_injective_tensor_insertion_comparison_core — the substantive nonempty-bond case, to which the new \leanok proof sketch in this file corresponds

Each entry needs \lean{...}, statement \leanok, proof \leanok (for sorry-free theorems), and appropriate \uses{} references. The existing \uses{} on thm:peps_twoInjectiveTensorInsertionComparison should gain these entries.

This was flagged in the previous review cycle and remains unresolved. Must be fixed before approval.

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

Blueprint ↔ Lean review (synchronize)

Positive changes

The proof \leanok added to \begin{proof} of thm:peps_twoInjectiveTensorInsertionComparison is now correctly placed: two_injective_tensor_insertion_comparison is fully sorry-free in this push (delegating to the new two_injective_tensor_insertion_comparison_core and twoBlockReciprocalScalarProportional_of_isEmpty_config, both sorry-free). No issue there.


Category A — Blueprint ↔ Lean equivalence

1 new finding (A.4) — missing blueprint entry on line 1163 of TNLean/PEPS/FundamentalTheorem.lean:

  • edgeInsertedCoeff_applyGauge is a public, sorry-free theorem explicitly cited to arXiv:1804.04964, Section 3. It is the key open-edge gauge-action identity that feeds into the still-open post_absorption_edge_insertion_equality. A \begin{lemma} block with \lean{...}, statement \leanok, proof \leanok, and \uses{...} is required. (Inline comment at line 1163.)

All other Category A issues from prior rounds (missing blueprint entries for twoBlockInsertedCoeff_matrixUnit, sameOpenBondContraction, fullContraction_eq, twoBlockInsertedCoeff_one, twoBlockLeftInverse, exists_bondGauge_of_fullContraction, gauge_eq1/2, gauge_inv, bondGauge_master_constraint, bondGauge_scalar_of_master, two_injective_tensor_insertion_comparison_core) remain unresolved.


Category B — Prose quality

7 new findings — all in TNLean/PEPS/FundamentalTheorem.lean, all are §1 Lean-identifier-as-mathematical-reference violations in the new open-edge gauge section:

Line Declaration Identifier
487 section comment `applyGauge_stateCoeff`
515 insertedOpenConfigEquiv `virtualConfigEquivEdgeBoundary`
808 edgeInsertedCoeff_eq_sum_local `sum_local_with_edge_deltas`
900 prod_gaugeVertex_eq_sum_local_open `prod_gaugeVertex_eq_sum_local`
954 open_gauge_sum_over_outer `gauge_sum_over_virtual`
1163 edgeInsertedCoeff_applyGauge `applyGauge_stateCoeff` (+ A.4)
1390 bondDim_eq_of_matrixAlgEquiv `fundamentalTheorem_PEPS_of_bondDim`
1421 fundamentalTheorem_PEPS `gaugeConsistency`

All other Category B issues from prior rounds remain unresolved.


Summary: 1 Category A equivalence finding (A.4), 8 Category B prose findings (new). REQUEST_CHANGES.

Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated
square of its index size.

Source: standard dimension count; used to discharge the bond-dimension equality
hypothesis of `fundamentalTheorem_PEPS_of_bondDim` (issue #874). -/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — Lean identifier in docstring prose (§1)

Source: standard dimension count; used to discharge the bond-dimension equality hypothesis of `fundamentalTheorem_PEPS_of_bondDim` (issue #874).

`fundamentalTheorem_PEPS_of_bondDim` names a Lean theorem in a maintainer note rather than describing mathematics. Replace with a mathematical description, e.g.:

Source: standard dimension count. This equality is used to discharge the bond-dimension hypothesis in the fundamental theorem for injective PEPS (issue #874).

Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated

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

Review — re-review on synchronize

I rebuilt the PR head and verified the proof-integrity claims directly. This is genuine, verified mathematical progress: two sorrys are closed, axiom-clean. The blockers to approval are the outstanding 🟡 issues from the previous review cycle, which the latest push has not addressed (so they remain unresolved, not re-posted here).

Proof integrity & correctness — verified ✅ (🔴 category clean)

lake build TNLean.PEPS.TwoInjectiveComparison TNLean.PEPS.FundamentalTheoremexit 0. #print axioms on the newly closed declarations returns only [propext, Classical.choice, Quot.sound]no sorryAx:

  • two_injective_tensor_insertion_comparison (#1361, lem:inj_equal_tensors_2) — the former sorry is gone; the theorem statement is unchanged from the prior sorry version, so no hypothesis was smuggled in (faithfulness rule satisfied). The whole operator-Schmidt support chain (exists_dual_isolating, gauge_eq1/gauge_eq2/gauge_inv, bilinear_coeff_zero, bondGauge_master_constraint, bondGauge_scalar_of_master, exists_bondGauge_of_fullContraction) is therefore sorry-free.
  • two_injective_tensor_insertion_comparison_core — axiom-clean. The empty/nonempty dispatch is sound: with [Nonempty Bond], Bond = ∅ cannot reach the empty branch (then SharedBondConfig is a singleton), so the empty branch fires only when some bondDim b is empty, where TwoBlockReciprocalScalarProportional holds vacuously over μ : SharedBondConfig. This correctly discharges the previously-raised P1 (the [Nonempty Bond] hypothesis is now present on _core).
  • fundamentalTheorem_PEPS bond-dimension equality — the hDim sorry is genuinely discharged edgewise via bondDim_eq_of_matrixAlgEquiv (a clean Module.finrank_matrix + Nat.mul_self_inj dimension count) composed with edgeTransferAlgEquiv; both are axiom-clean. bondDim_eq_of_matrixAlgEquiv and edgeInsertedCoeff_applyGauge print clean axioms.

Remaining sorrys in FundamentalTheorem.lean (lines 1284 post_absorption_edge_insertion_equality, 1331 gaugeConsistency, 1749 gauge_unique_mod_edge_scalars) are all pre-existing, untouched by this PR, and documented in docs/paper-gaps/peps_injective_ft_section3_route.tex — acceptable under paper-realignment mode.

Outstanding 🟡 issues — block approval (already on record, not re-posted)

These were raised in the prior cycle and are still present in the head, so I am not resolving the corresponding threads:

  1. 🟡 NamingTwoInjectiveComparison.lean:407 sameOpenBondContraction is a theorem named in pure camelCase, reading like a def/predicate. The file convention (and Mathlib) uses snake_case for theorems (fullContraction_eq, twoBlockInsertedCoeff_one in this same PR). Rename, e.g. openBondContraction_of_sameInsertions.
  2. 🟡 Modularitygauge_eq1/gauge_eq2/gauge_inv, exists_dual_isolating, bilinear_coeff_zero are stated over abstract {K V1 V2 : Type*} with no Bond/TwoBlockTensor content. As pure operator-Schmidt / dual-functional facts they belong in a shared linear-algebra module (or at minimum need a sectioning comment marking them PEPS-free); exists_dual_isolating is a plausible Mathlib-upstream candidate.
  3. 🟡 Documentation accuracyTwoInjectiveComparison.lean:398: the docstring calls the per-bond insertion hypothesis equivalent to the one-leg-open contractions, but only the forward implication (SameTwoBlockInsertions → equal open-leg contractions) is proved. Change "equivalent" to "implies".

ℹ️ Advisory

  • maxHeartbeats 400000 (TwoInjectiveComparison.lean:757) is documented and modest — acceptable; monitor if it recurs.
  • The dependency comment inside gaugeConsistency (FundamentalTheorem.lean:1349–1353) still describes two_injective_tensor_insertion_comparison as "still sorry, #1361". This PR closes #1361, so that annotation is now stale (the line is outside the diff, but the PR makes it false).

Out of scope (handled by the Blueprint Sync & Prose Review workflow)

The numerous prior claude/copilot threads tagged "Category A — missing blueprint entry" and "Category B — Lean identifier / banned phrasing in docstring prose" concern \lean/\leanok/\uses sync and prose quality and are not reviewed here; I have neither re-raised nor resolved them.

Verdict: REQUEST_CHANGES — proof integrity and correctness are excellent and verified, but the 🟡 naming, modularity, and documentation-accuracy items remain unaddressed.

@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

I checked out the merge commit and verified that all four changed files compile (lake env lean TNLean/PEPS/TwoInjectiveComparison.lean exits 0; FundamentalTheorem.lean exits 0). The previous 🔴 blocker — two_injective_tensor_insertion_comparison_core was false without [Nonempty Bond] — is resolved: _core now carries [Nonempty Bond] and hbond : ∀ b, Nonempty (bondDim b), and its proof is complete (no sorry). The only sorrys in the changed files are pre-existing (gaugeConsistency at line 1399, gauge_unique_mod_edge_scalars at line 1823); no new sorry is introduced.

The proof of two_injective_tensor_insertion_comparison is a tour de force: operator-Schmidt uniqueness → bond gauge → master per-bond constraint → scalar diagonality → A₁ = λ·B₁, A₂ = λ⁻¹·B₂. The route is mathematically correct and faithful to the paper-gap analysis in docs/paper-gaps/peps_injective_ft_section3_route.tex.

Three 🟡 issues remain; none are 🔴, but all must be fixed before approval.


🟡 Mathlib naming — sameOpenBondContraction (TwoInjectiveComparison.lean, line 407)

The theorem is named in camelCase but reads like a def/predicate. The file's convention uses snake_case for theorems (fullContraction_eq, twoBlockInsertedCoeff_one, two_injective_tensor_insertion_comparison_core — all in this PR). Rename to snake_case, e.g. openBondContraction_of_sameInsertions.

🟡 Documentation accuracy — "equivalent" vs "implies" (TwoInjectiveComparison.lean, line 398)

The docstring for sameOpenBondContraction states the insertion hypothesis "is equivalent to" the one-leg-open contraction equalities. Only the forward direction (SameTwoBlockInsertions → equality) is proved. Change to "implies" or "gives."

🟡 Documentation accuracy — stale comments in gaugeConsistency (FundamentalTheorem.lean, lines 1388–1398)

The comment at lines 1388–1391 says two_injective_tensor_insertion_comparison is "still sorry, #1361", and line 1396 says "The one remaining load-bearing dependency (#1361) is an open sorry." This PR proves that theorem, closing #1361. The comments must be updated to reflect the new status: the upstream dependency is now resolved, and the remaining obstacle in gaugeConsistency is the cross-edge blocking/assembly step (not the two-injective comparison).


ℹ️ Advisory

  • maxHeartbeats 400000 in two locations (FundamentalTheorem.lean section LargeBudget and TwoInjectiveComparison.lean line 1427). Both carry clear comments explaining the noncomputable Classical-derived Fintype instances that cause the heartbeat budget exceedance. Modest and acceptable.

What this PR accomplishes

  • Closes PEPS FT: formalize the generalized two-injective-tensor comparison #1361: two_injective_tensor_insertion_comparison is now fully proved, sorry-free. The empty-config branch dispatches vacuously via the new twoBlockReciprocalScalarProportional_of_isEmpty_config; the substantive case goes through two_injective_tensor_insertion_comparison_core using the operator-Schmidt gauge-extraction route confirmed by numerical probes.
  • Closes PEPS FT: formalize the post-absorption edge insertion equality #1364: post_absorption_edge_insertion_equality is proved, using exists_edgeGaugeFamily + edgeInsertedCoeff_applyGauge + glTranspose/glReindex helpers.
  • New reusable infrastructure: glTranspose (transpose of GL matrix as GL), reindexAlgEquiv_transpose, bondDim_eq_of_matrixAlgEquiv (algebra equivalence between full matrix algebras forces equal dimensions — used to discharge the bond-dimension hypothesis of fundamentalTheorem_PEPS).
  • fundamentalTheorem_PEPS hDim proof: previously sorry; now proved via bondDim_eq_of_matrixAlgEquiv applied to edgeTransferAlgEquiv.
  • 22 new theorems/lemmas across three modules, all sorry-free, #print axioms clean.
  • The only remaining sorry in the injective PEPS FT chain is gaugeConsistency (cross-edge assembly), which is a pre-existing and separately tracked obligation.

Resolution of previous review threads

The 🔴 blocker from the previous review (missing [Nonempty Bond] on _core) is resolved. The 🟡 naming and documentation issues flagged in the previous review cycle remain unresolved — the new push added the missing proof but did not address the style/docstring issues identified earlier.

No paper-gap files are modified in this PR, so that review category does not apply. Blueprint sync and prose quality are out of scope for this review (handled by the dedicated workflow).

🤖 Generated with Claude Code

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

Review Summary

Verdict: REQUEST_CHANGES — three 🟡 issues must be fixed before approval. No 🔴 blockers.

The previous 🔴 blocker (two_injective_tensor_insertion_comparison_core missing [Nonempty Bond]) is resolved: _core now carries [Nonempty Bond] and hbond : ∀ b, Nonempty (bondDim b), and its proof is complete. No new sorry is introduced. Both TwoInjectiveComparison.lean and FundamentalTheorem.lean compile cleanly.

🟡 Must fix

  1. Mathlib naming — sameOpenBondContraction (TNLean/PEPS/TwoInjectiveComparison.lean:407): Theorem named in camelCase; the file's convention uses snake_case for theorems. Rename to openBondContraction_of_sameInsertions or similar.

  2. Documentation accuracy — "equivalent" vs "implies" (TNLean/PEPS/TwoInjectiveComparison.lean:398): Docstring says the insertion hypothesis "is equivalent to" the one-leg-open contraction equalities, but only forward direction is proved. Change to "implies" or "gives."

  3. Stale comments in gaugeConsistency (TNLean/PEPS/FundamentalTheorem.lean:1388–1398): Comments say two_injective_tensor_insertion_comparison is "still sorry" and #1361 is "open sorry" — both are now proved. Update to reflect current status.

ℹ️ Advisory

  • maxHeartbeats 400000 in two locations, explained by noncomputable Classical-derived Fintype instances. Acceptable.

What's impressive

  • Closes #1361: two_injective_tensor_insertion_comparison fully proved (operator-Schmidt → gauge → master constraint → scalar diagonality → proportionality).
  • Closes #1364: post_absorption_edge_insertion_equality proved.
  • 22 new sorry-free theorems/lemmas across three modules.
  • fundamentalTheorem_PEPS hDim now proved via bondDim_eq_of_matrixAlgEquiv.
  • The route is mathematically faithful to the paper-gap analysis confirming the obstruction is nonlinear.

Resolution of previous threads

The 🔴 blocker from the prior review is resolved. The 🟡 naming and docstring issues remain — the new push added the missing proofs but did not address the style/docstring items identified earlier.

Blueprint sync and prose quality are out of scope (handled by the dedicated workflow). No paper-gap files are modified.

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

Re-review (synchronize): feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Verdict: REQUEST_CHANGES.

I built the changed modules from the merge commit (lake build TNLean.PEPS.TwoInjectiveComparison TNLean.PEPS.FundamentalTheorem TNLean.PEPS.EdgeGaugeFamily → exit 0). Confirmed:

  • TwoInjectiveComparison.lean and EdgeGaugeFamily.lean build clean and sorry-free. two_injective_tensor_insertion_comparison, two_injective_tensor_insertion_comparison_core, and one_vertex_complement_comparison are now fully proved — #1361 is closed. The empty-config branch dispatches vacuously via twoBlockReciprocalScalarProportional_of_isEmpty_config; the substantive case runs the operator-Schmidt route (exists_bondGauge_of_fullContractionbondGauge_master_constraintbondGauge_scalar_of_master). The proofs are well-structured (Fintype.sum_equiv, Finset.prod_univ_sum, explicit calc/Finset.sum_congr chains), not brute-forced.
  • The previously-flagged 🔴 (missing [Nonempty Bond] on _core) is resolved: _core now carries [Nonempty Bond] plus hbond : ∀ b, Nonempty (bondDim b).
  • No new sorry. The only sorrys in the touched files are pre-existing and separately tracked: gaugeConsistency (line 1399) and gauge_unique_mod_edge_scalars (line 1823), both with proof-status markers and paper-gap references. Acceptable under the repo's scaffolding convention.

🟡 New finding — unscoped maxHeartbeats lint warning (FundamentalTheorem.lean:424)

The build emits a linter.style.setOption warning:

warning: TNLean/PEPS/FundamentalTheorem.lean:424:0: Unscoped option maxHeartbeats is not allowed

The section LargeBudget + bare set_option maxHeartbeats 400000 (lines 423–424) raises the budget for a whole section rather than for the two declarations that need it (prod_gaugeVertex_eq_sum_local, prod_gaugeVertex_eq_sum_local_open). Mathlib style disallows this. The same PR already uses the correct per-declaration set_option maxHeartbeats 400000 in form (before exists_bondGauge_of_fullContraction, and at TwoInjectiveComparison.lean:757), so this is an internal inconsistency. Fix: remove the section/end LargeBudget wrapper and prefix each of the two lemmas with its own set_option maxHeartbeats 400000 in (keeping the explanatory comment). The previous review cycle classified maxHeartbeats as acceptable advisory and missed that this particular form is a build warning — it is a 🟡 style item, not advisory.

Still-open 🟡 items from the prior review cycle (this push did not address them)

These were correctly raised in the previous summary and inline threads and remain unresolved in the current head — they continue to block approval:

  • NamingsameOpenBondContraction (TwoInjectiveComparison.lean:407) is a theorem named in pure camelCase; the file's theorems use snake_case (fullContraction_eq, twoBlockInsertedCoeff_one). Rename, e.g. openBondContraction_of_sameInsertions.
  • Documentation accuracysameOpenBondContraction docstring (line 398) says the insertion hypothesis "is equivalent to" the one-leg-open contractions, but only the forward implication is proved. Use "implies"/"gives".
  • Documentation accuracy — stale proof-status comment in gaugeConsistency (FundamentalTheorem.lean:1388–1398): lines 1389–1390 still call two_injective_tensor_insertion_comparison "still sorry, #1361" and line 1396 says "the one remaining load-bearing dependency (#1361) is an open sorry". This PR closes #1361, so the comment now misstates the status; the genuine remaining obstacle in gaugeConsistency is the cross-edge assembly step.

ℹ️ Advisory (non-blocking): the general operator-Schmidt lemmas (gauge_eq1/gauge_eq2/gauge_inv/exists_dual_isolating/bilinear_coeff_zero) are stated over abstract {K V1 V2} with no PEPS content and could be upstreamed/relocated — flagged earlier, acceptable here.

No paper-gap files are modified in this PR. Blueprint sync and prose quality are out of scope for this review (handled by the dedicated workflow).

🤖 Generated with Claude Code

Comment thread TNLean/PEPS/FundamentalTheorem.lean Outdated

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

Blueprint ↔ Lean & Prose Review (synchronize)

Verdict: REQUEST_CHANGES. 1 new Category A finding · 1 new Category B finding · all prior unresolved threads remain open.


What this synchronize got right

  • post_absorption_edge_insertion_equality is now sorry-free; the \begin{proof}\leanok at line 2069 is valid from A.2 (no sorry in that proof).
  • two_injective_tensor_insertion_comparison is now sorry-free; the \leanok on the proof is valid from A.2.
  • The rewritten proof sketch for thm:peps_twoInjectiveTensorInsertionComparison now contains display equations — a substantial improvement over the previous word-only text.
  • The blueprint statement for thm:peps_postAbsorptionEdgeInsertionEquality correctly adds the positive-bond hypothesis to match the new hpos parameter in the Lean signature.

New findings (this round)

Category A — 1 issue

# File Lines Issue
A1 ch13a_peps_ft.tex 2412–2413 Proof \leanok for thm:peps_twoInjectiveTensorInsertionComparison has no \uses{}. The Lean proof calls two_injective_tensor_insertion_comparison_core and twoBlockReciprocalScalarProportional_of_isEmpty_config; both lack blueprint entries (prior threads), making \uses temporarily unpopulatable — but that means those entries must be added before this proof \leanok is admissible, not that \uses may be omitted.

Category B — 1 issue

# File Lines Issue
B1 ch13a_peps_ft.tex 2072–2079 Proof sketch for thm:peps_postAbsorptionEdgeInsertionEquality is entirely verbal; the key identity "$Z_e^\top = R(X_e)$, hence $Z_e^\top R(M)(Z_e^{-1})^\top = R(X_e M X_e^{-1}) = \Phi_e(M)$" must be displayed.

Prior unresolved threads (unchanged)

No previously raised threads are resolved by this synchronize. The following remain open and are not re-raised here:

  • PRRT_kwDORK8b986HkghT, PRRT_kwDORK8b986HkgqG, PRRT_kwDORK8b986HkglS, PRRT_kwDORK8b986Hkgn9, PRRT_kwDORK8b986Hkg0Y, PRRT_kwDORK8b986HkpBs, PRRT_kwDORK8b986HkpFp, PRRT_kwDORK8b986HkpIR, PRRT_kwDORK8b986HkpK1, PRRT_kwDORK8b986HkpNt, PRRT_kwDORK8b986HkpQo, PRRT_kwDORK8b986HkpUr — missing blueprint entries and Lean-identifier-in-prose issues in TwoInjectiveComparison.lean.
  • PRRT_kwDORK8b986HlkVj, PRRT_kwDORK8b986HlkZ5, PRRT_kwDORK8b986HlkgP, PRRT_kwDORK8b986Hlkih, PRRT_kwDORK8b986HlklC, PRRT_kwDORK8b986Hlkqb, PRRT_kwDORK8b986HlkwL, PRRT_kwDORK8b986HlkyZ — missing blueprint entries and Lean-identifier-in-prose issues in FundamentalTheorem.lean.
  • PRRT_kwDORK8b986HlMcy — word-only "equates the two fully contracted states" (the opening sentence of the thm:peps_twoInjectiveTensorInsertionComparison proof still lacks the contraction equality).
  • PRRT_kwDORK8b986HlMLN, PRRT_kwDORK8b986HlMTS, PRRT_kwDORK8b986HlMi2, PRRT_kwDORK8b986HlMrW, PRRT_kwDORK8b986HlMxO, PRRT_kwDORK8b986HlM37 — Lean identifiers in new docstrings and missing blueprint entries in TwoInjectiveComparison.lean.
  • PRRT_kwDORK8b986HljsF — grouped missing-entry thread at old blueprint line 2415.

Additionally, note that the comment at FundamentalTheorem.lean line 1390 ("two_injective_tensor_insertion_comparison, still sorry") is now stale — the sorry was removed. That comment should be deleted or updated.

open-edge gauge action then conjugates each inserted matrix by the transpose
of the absorbed gauge, while the insertion-algebra transport conjugates by
$X_e$; the two conjugations agree because the absorbed gauge is the transpose
of $X_e$, giving the post-absorption insertion equality.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — word-only proof sketch; display equation required (§ "Source-faithful terminology and formulas")

The open-edge gauge action then conjugates each inserted matrix by the transpose of the absorbed gauge, while the insertion-algebra transport conjugates by $X_e$; the two conjugations agree because the absorbed gauge is the transpose of $X_e$, giving the post-absorption insertion equality.

The entire proof block (lines 2069–2080) has no display equation. The claim that the two conjugation actions agree is the load-bearing step; it should be shown as an identity. The Lean proof establishes
$$Z_e^\top = R(X_e), \qquad (Z_e^{-1})^\top = R(X_e^{-1}),$$
where $Z_e = R(X_e^\top)$ and $R$ is the bond-reindexing isomorphism, and then uses multiplicativity of $R$ to conclude
$$Z_e^\top, R(M), (Z_e^{-1})^\top = R(X_e M X_e^{-1}) = \Phi_e(M).$$
Display at least one of these identities — the prose "the two conjugations agree because…" is a word-only description of a contraction/conjugation identity and must be replaced by the formula per the style guide.

endomorphisms $Z$, $U$, and $W$ such that, for every external index
$\eta$, shared-boundary index $\mu$, and physical index $\sigma$ of the
first block,
\leanok

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category A — A.4: proof \leanok has no \uses{}

The \begin{proof}\leanok for thm:peps_twoInjectiveTensorInsertionComparison has no \uses{...} tag. The Lean proof of two_injective_tensor_insertion_comparison invokes exactly two dependencies:

  1. two_injective_tensor_insertion_comparison_core — the nonempty-bond substantive case, and
  2. twoBlockReciprocalScalarProportional_of_isEmpty_config — the vacuous empty-bond case.

Per A.4, the proof \uses must list the lemmas the Lean proof actually invokes. Both of these declarations currently lack blueprint entries (flagged in earlier threads), so \uses cannot be populated yet — but that makes adding the blueprint entries for those two declarations a prerequisite for marking this proof \leanok, not a reason to leave \uses empty. Once those entries exist the proof \uses must be:

\begin{proof}
    \leanok
    \uses{<label for two_injective_tensor_insertion_comparison_core>,
          <label for twoBlockReciprocalScalarProportional_of_isEmpty_config>}
    ...

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: REQUEST_CHANGES.

The 🔴 blocker from the prior review cycle (_core missing [Nonempty Bond]) is resolved, and the stale comments in gaugeConsistency have been updated. The proof of two_injective_tensor_insertion_comparison is now complete and mathematically correct. However, 🟡 issues from prior reviews remain unaddressed, and one new 🟡 modularity issue is found.


🟡 Mathlib naming — sameOpenBondContraction (TwoInjectiveComparison.lean, line 407)

This theorem is named in pure camelCase, reading like a def/predicate. The file's convention is snake_case for theorems (fullContraction_eq, twoBlockInsertedCoeff_one, two_injective_tensor_insertion_comparison_core). Rename to openBondContraction_of_sameInsertions or similar.

Previously flagged in discussion_r3367465505, discussion_r3367468153, discussion_r3367469662. Remains unresolved.

🟡 Documentation accuracy — "equivalent" vs "implies" (TwoInjectiveComparison.lean, line 398)

The docstring states "The per-bond insertion hypothesis is equivalent to equality of all one-leg-open contractions" but only the forward direction (SameTwoBlockInsertions → equality) is proved. Change to "implies" or "gives."

Previously flagged in discussion_r3367465290, discussion_r3367468163. Remains unresolved.

🟡 Performance/linter — unscoped maxHeartbeats (FundamentalTheorem.lean, lines 422–425)

The section LargeBudget + set_option maxHeartbeats 400000 triggers linter.style.setOption. Must use the per-declaration form set_option maxHeartbeats 400000 in before each of the two affected lemmas (prod_gaugeVertex_eq_sum_local, prod_gaugeVertex_eq_sum_local_open), matching the form already used elsewhere in this PR (e.g., TwoInjectiveComparison.lean line 1523).

Previously flagged in discussion_r3367469570. Remains unresolved.

🟡 Modularity — dead code: twoBlockLeftInverse/twoBlockComb unused (TwoInjectiveComparison.lean, lines 488–532)

twoBlockLeftInverse, twoBlockComb, twoBlockComb_injective, twoBlockLeftInverse_comp, and twoBlockLeftInverse_apply are not called by any theorem in this PR, nor anywhere else in the project (grep -r across all .lean files returns no hits outside this file). They were prepared for a left-inverse-based proof approach, but the final proof of two_injective_tensor_insertion_comparison_core uses exists_dual_isolating and the gauge equations instead.

Either remove these unused definitions or add a comment explaining they are infrastructure for the remaining gaugeConsistency work (to be used in a follow-up PR). New finding in this review cycle.

🟡 Modularity — general operator-Schmidt lemmas in PEPS file (TwoInjectiveComparison.lean, lines ~592–870)

exists_dual_isolating, gauge_eq1, gauge_eq2, gauge_inv, and bilinear_coeff_zero are stated over abstract {K V1 V2 : Type*} with no TwoBlockTensor or Bond content. They are generic linear-algebra results invisible to other modules. At minimum, add a sectioning comment marking them as general linear algebra.

Previously flagged in discussion_r3367467510, discussion_r3367468173, discussion_r3367469684. Remains unresolved.


✅ What was fixed since the previous review cycle

  • 🔴 two_injective_tensor_insertion_comparison_core now carries [Nonempty Bond] and the proof is complete — the blocking false-statement issue is resolved.
  • 🟡 Stale comments in gaugeConsistency (previously referencing #1361 and #1364 as "still sorry") have been updated to reflect the new state.

ℹ️ Advisory

  • The maxHeartbeats 400000 in TwoInjectiveComparison.lean (line 1523) uses the correct per-declaration form with an explanatory comment. Acceptable.
  • The sorry on gaugeConsistency is pre-existing and documented with precise remaining steps. Not introduced by this PR.
  • Blueprint sync and prose quality (Category A/B) are out of scope for this review; those are handled by the dedicated workflow.

🤖 Generated with Claude Code

@LionSR

LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Claude finished @LionSR's task —— View job


Reviewing — building changed modules (in progress)…

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: APPROVE. All 🔴 and 🟡 issues from prior review cycles have been addressed in this push. The remaining unresolved threads are either ℹ️ advisory or concern blueprint/prose categories that are out of scope for this review (handled by the dedicated Blueprint Sync & Prose Review workflow).

What was resolved in this push

Every previously-flagged in-scope issue has been fixed:

  1. Mathlib namingsameOpenBondContraction renamed to openBondContraction_of_sameInsertions (TwoInjectiveComparison/Basic.lean:407). Follows snake_case convention for theorems.
  2. Documentation accuracy — docstring now says "implies" rather than "is equivalent to" for the one-leg-open contraction theorem (line 398).
  3. Unscoped maxHeartbeats — bare set_option maxHeartbeats 400000 removed from FundamentalTheorem.lean; the only remaining heartbeat raise is properly scoped (set_option maxHeartbeats 400000 in, Basic.lean:712).
  4. Dead code — the twoBlockComb/twoBlockLeftInverse cluster removed.
  5. Unused imports — removed from GaugeAction.lean and VertexComplement/Basic.lean.
  6. Modularity — sectioning comment added at TwoInjectiveComparison/Basic.lean:528-534 marking the general operator-Schmidt lemmas for eventual relocation to TNLean/Algebra/OperatorSchmidt.lean.

Build & integrity

  • lake build TNLean.PEPS.TwoInjectiveComparison TNLean.PEPS.VertexComplement.KernelDescent TNLean.PEPS.GaugeConsistencyConnectivityCounterexample2668 jobs, 0 errors, 0 warnings
  • Two pre-existing sorrys remain in the orphan capstone FundamentalTheorem.lean (gaugeConsistency at line 321, gauge_unique_mod_edge_scalars at line 766), both documented with proof-status markers and tracked in docs/paper-gaps/. No new sorry or axiom is introduced.
  • #print axioms would be clean for all new theorems.

What's solid

  • two_injective_tensor_insertion_comparison (#1361) is genuinely closed, sorry-free. Proof chain: operator-Schmidt uniqueness (exists_bondGauge_of_fullContraction) → per-bond master constraint (bondGauge_master_constraint) → scalar diagonality (bondGauge_scalar_of_master) → reciprocal proportionality. Faithful to arXiv:1804.04964, Section 3, Lemma inj_equal_tensors_2.
  • bondDim_eq_of_matrixAlgEquiv correctly discharges the bond-dimension sorry in fundamentalTheorem_PEPS (#874): finrank of M_n(ℂ) is , AlgEquiv preserves finrank, Nat.mul_self_inj forces equality.
  • VertexComplement/* kernel-descent architecture is sorry-free and correct, including vertexComplementKernelCondition_empty_eq_zero (the prior d=0 false-positive has been re-examined and confirmed not a bug).
  • GaugeConsistencyConnectivityCounterexample is a valid, machine-checked refutation: empty graph on Bool, A=(2,3), B=(6,1), states agree but no edge gauge relates them.
  • The paper-gap note docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex is self-contained per policy.tex: states the assertion, isolates the obstruction, gives the witness, states the correct hypothesis, and distinguishes from the separate peps_gauge_edge_scalars gap.

ℹ️ Advisory (not blocking)

  • maxHeartbeats 400000 on exists_bondGauge_of_fullContraction (Basic.lean:712) is a PROOF_INTEGRITY.md warning with inline justification (unifying Classical-derived Fintype instances). Acceptable.
  • glTranspose in EdgeGaugeFamily.lean is stated only for GL (Fin m) ℂ — clean upstreaming candidate, but not blocking.
  • Unresolved Category A/B threads (blueprint entries, prose quality, docstring style) are out of scope for this review; they should be resolved by the dedicated Blueprint Sync & Prose Review workflow before merge.

🤖 Generated with Claude Code

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

Review (proof integrity, correctness, style, types, performance, modularity, documentation, paper-gap notes)

Scope note. Blueprint↔Lean sync (\lean/\leanok/\uses) and prose/banned-language review are handled by the dedicated Blueprint Sync & Prose Review workflow and are excluded here. Several existing claude threads fall under that exclusion; I have not re-raised or resolved them.

Verification performed

  • lake build TNLean.PEPS.TwoInjectiveComparison — succeeds.
  • lake build TNLean.PEPS.FundamentalTheorem TNLean.PEPS.GaugeConsistencyConnectivityCounterexample TNLean.PEPS.VertexComplement.KernelDescent — succeeds; the only sorry warnings are the two pre-existing obligations at FundamentalTheorem.lean:302 (gaugeConsistency) and :729 (gauge_unique_mod_edge_scalars).
  • #print axioms on two_injective_tensor_insertion_comparison, two_injective_tensor_insertion_comparison_core, bondGauge_master_constraint, bondGauge_scalar_of_master, one_vertex_complement_comparison — all [propext, Classical.choice, Quot.sound], no sorryAx.

Proof integrity 🔴 — clean

This PR removes 2 sorrys and introduces none (net 4 → 2 in FundamentalTheorem.lean). The two remaining sorrys are the pre-existing gaugeConsistency and gauge_unique_mod_edge_scalars, both acknowledged in the PR description, both carrying detailed docstrings with the elimination plan and paper-gap citations. Consistent with paper-realignment mode. The single set_option maxHeartbeats 400000 (on exists_bondGauge_of_fullContraction) is a PROOF_INTEGRITY.md warning, already noted in a prior advisory thread.

Proof correctness 🔴 — sound

The headline result two_injective_tensor_insertion_comparison is a faithful, genuinely structured operator-Schmidt uniqueness argument: exists_bondGauge_of_fullContraction (via gauge_eq1/gauge_eq2/gauge_inv) produces an invertible bond gauge g; bondGauge_master_constraint separates the one-leg-open identities over the two linearly independent families B₁, A₂ (bilinear_coeff_zero); bondGauge_scalar_of_master forces g = λ·1 with λ ≠ 0. The supporting Basic.lean definitions (IsTwoBlockInjective, SameTwoBlockInsertions, TwoBlockReciprocalScalarProportional) match arXiv:1804.04964 §3 Lemma inj_equal_tensors_2. The public statement is a faithful generalization (nonempty spectator boundaries; the paper's one-point case is recovered) — no source hypothesis is dropped, all four injectivity hypotheses are present.

Faithfulness of the added hypotheses — correctly handled

The PR adds G.Connected and hpos : ∀ e, 0 < A.bondDim e to gaugeConsistency/fundamentalTheorem_PEPS. This is the right handling of a genuine source gap, not a smuggled hypothesis: GaugeConsistencyConnectivityCounterexample machine-checks (axiom-clean) that the connectivity-free statement is false — empty graph on Bool, A=(2,3), B=(6,1), 2·3 = 6 = 6·1 but A₀ = 2 ≠ 6 = B₀. The deviation is documented in docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex, whose argument (oriented incidence product of edge scalars is 1 per component, so the λ_v are absorbable only when their reciprocal product is 1 per component) is mathematically correct, and the source citation paper_normal.tex:1207 is accurate.

Paper-gap notes 🟡 — reviewed against policy.tex

Both note changes are self-contained and faithful. One minor point inline on the connectivity note (quotation substitutes λ_v for the source's λ_i). The section3_route.tex addition is consistent with the note's established route-tracking style.

Remaining categories

Style, type safety, performance, modularity: no in-scope blockers. glTranspose upstreamability is already covered by a prior advisory thread.

Verdict

No blocking (🔴/🟡) issues within this review's scope. Two advisory items are noted inline. I am submitting as a comment rather than an approval because out-of-scope blueprint/prose threads from the sibling workflow remain open; this assessment covers only proof integrity, correctness, style, types, performance, modularity, documentation, and the paper-gap notes.

Comment thread TNLean/PEPS/VertexComplement/KernelDescent.lean
after the equation labelled \path{eq:inj_equal_edge}: blocking one vertex against
its complement gives, for each vertex, a scalar proportionality
$A_v=\lambda_v\,\widetilde B_v$, and the source then says ``the constants
$\lambda_v$ can be incorporated into the gauge

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Paper-gap note quotation (advisory). This sentence quotes the source as “the constants $\lambda_v$ can be incorporated into the gauge transformations,” but Papers/1804.04964/paper_normal.tex:1207 writes $\lambda_i$, not $\lambda_v$. The substantive claim is supported, but since this is inside quotation marks it should either reproduce the source notation ($\lambda_i$) verbatim or be reformulated as a paraphrase. The same substitution appears in the docstring of GaugeConsistencyConnectivityCounterexample and in gaugeConsistency.

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

Review summary

Threads resolved (5)

Thread Fix
PRRT_kwDORK8b986HmtxL Blueprint entry for vertexComplementTensorInjective_of_isVertexInjective now present (thm:peps_vertexComplementTensorInjective).
PRRT_kwDORK8b986HmUeH "equivalent" → "implies" in openBondContraction_of_sameInsertions docstring.
PRRT_kwDORK8b986Hmtpk def:peps_complementTwoBlock \uses{} no longer lists def:peps_vertexTwoBlock.
PRRT_kwDORK8b986Hmts3 $K_S(c)$ is now defined inline with a display formula.
PRRT_kwDORK8b986Hmt0X "absolute-scalar specialization of twoBlockReciprocalScalarProportional" text is gone.

Equivalence and status (Category A) — 1 new issue

blueprint line 2707\begin{proof}\leanok for thm:peps_isTwoBlockInjective_complementTwoBlock has no \uses{thm:peps_vertexComplementTensorInjective}, despite the Lean proof calling vertexComplementTensorInjective_of_isVertexInjective directly.

Prose quality (Category B) — 1 new issue

GaugeAction.lean lines 35–41 — paper-internal labels inj_isomorph, eq:inj_equal_edge, inj_equal_tensors_2 used as backtick shorthand in the module docstring. §1 requires full citations instead.

Carry-over issues still open (not re-raised)

All prior unresolved threads authored by claude that are not outdated remain open (see thread list). The most significant carry-overs:

  • Category A: proof \leanok for thm:peps_twoInjectiveTensorInsertionComparison has no \uses{} (threads PRRT_kwDORK8b986Hluy1, PRRT_kwDORK8b986HmUh-); missing blueprint entries for bondGauge_master_constraint, bondGauge_scalar_of_master (PRRT_kwDORK8b986HlMxO); and several other missing entries for sorry-free internal lemmas (PRRT_kwDORK8b986HljsF).
  • Category B: "bridge" at TwoInjectiveComparison/Basic.lean:496 (PRRT_kwDORK8b986Hmi-A); "at the heart of" at line 726 (PRRT_kwDORK8b986Hmi_9); Lean identifiers in multiple docstrings (PRRT_kwDORK8b986HlMLN, PRRT_kwDORK8b986HmjC9, PRRT_kwDORK8b986HmjHm, PRRT_kwDORK8b986HlkwL); word-only proof sketches in the blueprint (PRRT_kwDORK8b986Hluwl, PRRT_kwDORK8b986HlzR1, PRRT_kwDORK8b986HlMcy).

Count: 1 new equivalence issue, 1 new prose issue.

Comment thread blueprint/src/chapter/ch13a_peps_ft.tex
Comment on lines +35 to +41
form a three-site injective MPS. Lemma `inj_isomorph` then assigns an edge gauge.
After repeating this for every edge and absorbing the gauges into the second
tensor family, the proof obtains the equality labelled `eq:inj_equal_edge`:
for every edge and every matrix `X`, inserting `X` on that edge in the first
PEPS gives the same state as inserting `X` on the same edge in the modified
second PEPS. Blocking one vertex against its complement and applying
`inj_equal_tensors_2` then gives $A_v = \lambda_v \cdot \tilde{B}_v$; the

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category B — §1 source-reference shorthand: paper-internal labels in module docstring prose

Lines 35–41 use paper-internal lemma and equation labels as backtick-quoted shorthand:

Lemma `inj_isomorph` then assigns an edge gauge.

the proof obtains the equality labelled `eq:inj_equal_edge`

Blocking one vertex against its complement and applying `inj_equal_tensors_2` then gives…

Per docs/prose_style.md §1, source-reference shorthand such as "source label propsimple" is banned from docstrings. The identifiers inj_isomorph, eq:inj_equal_edge, and inj_equal_tensors_2 are internal labels from Papers/1804.04964/paper_normal.tex, not Lean declarations, but the same prohibition applies: they should be replaced by complete descriptions citing the source.

Fix: replace the three occurrences with prose citations, e.g.:

the injective-chain isomorphism lemma of arXiv:1804.04964, Section 3 (lines 1037–1065)
assigns an edge gauge.
After repeating this for every edge and absorbing the gauges, the proof obtains the
post-absorption insertion equality of arXiv:1804.04964, eq:inj_equal_edge.
Blocking one vertex against its complement and applying the two-injective comparison
(arXiv:1804.04964, Lemma inj_equal_tensors_2, lines 1068–1204) then gives
$A_v = \lambda_v \cdot \widetilde B_v$; the scalars $\lambda_v$ are absorbed into the edge gauges.

@LionSR

LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@claude review

Sirui Lu added 5 commits June 6, 2026 23:59
Introduce the oriented incidence product of an edge-scalar family on a simple
graph (edgeScalarUnit / orientedIncidence) and prove the necessity direction of
the absorption solvability condition: the product of the oriented incidences
over all vertices is 1 (prod_orientedIncidence_eq_one), since each edge cancels
its own scalar against its inverse across its two endpoints.

This is the consistency obstruction recorded in
docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex and the foundation
for the spanning-tree edge-scalar existence step of gaugeConsistency.
Add the combinatorial infrastructure for the induction step of the spanning-tree
edge-scalar existence proof: lift/restrict edges between G and G.induce {v0}ᶜ
(liftEdge / restrictEdge), the incidence bijection incEquiv between v0-avoiding
incident edges of a vertex w in G and the incident edges of w in the deleted
subgraph, and prod_free_eq showing the v0-free part of w's oriented incidence
product equals the deleted-subgraph oriented incidence of the lifted scalars.

These are the load-bearing helpers for the vertex-deletion recursion of
gaugeConsistency's absorption step.
Prove exists_edgeScalars_of_connected: on a connected simple graph, any
vertex-scalar family t : V → ℂˣ with ∏ t = 1 is the oriented incidence product
of an edge-scalar family. This is the spanning-tree coboundary step of the
absorption argument in the injective PEPS Fundamental Theorem
(arXiv:1804.04964 §3), documented in
docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex.

The proof is by induction on the number of vertices, removing a non-cut vertex
v₀ (SimpleGraph.Connected.exists_connected_induce_compl_singleton_of_finite_nontrivial),
folding v₀'s target into a neighbor, recursing on the deleted subgraph, and
absorbing v₀'s scalar into the single edge {v₀,w₀}. Axiom-clean
(propext, Classical.choice, Quot.sound).
…tency

Add two sorry-free lemmas toward closing gaugeConsistency:
- isVertexInjective_reindexTensor: bond-dimension reindexing preserves vertex
  injectivity (the local family precomposed with an injective index recast).
- perVertexScalar: at every vertex with a nonempty incident-edge set, the
  post-absorption edge-insertion equality plus the four two-block injectivity
  facts and one_vertex_complement_comparison yield a nonzero c with
  A_v = c · gaugeVertex B Z v.

This realizes the per-vertex scalar step of arXiv:1804.04964 §3 documented in
docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex. gaugeConsistency
itself remains sorry pending the gauge-inversion / edge-scalar assembly.
Update the gaugeConsistency proof-status comment to reference the now-available
perVertexScalar and exists_edgeScalars_of_connected, and to name the two
remaining obligations precisely: (1) ∏ c_v = 1 via gauge-state invariance, and
(2) the gauge-inversion product-kernel collapse packaging X_e = s_e·(Z_e)⁻¹.
@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Claude finished @LionSR's task in 5m 43s —— View job


Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: REQUEST_CHANGES — one small, newly-introduced 🟡 build-warning to fix. The mathematics is sound and verified; the new edge-scalar infrastructure since the last review cycle is clean and sorry-free.

Scope: proof integrity, correctness, Mathlib style, type safety, modularity, documentation. Blueprint↔Lean \leanok/\uses sync and prose are handled by the dedicated Blueprint Sync & Prose Review workflow (one note below).

Build & integrity — verified

lake build TNLean.PEPS.EdgeScalarSolve TNLean.PEPS.FundamentalTheorem TNLean.PEPS.GaugeConsistencyConnectivityCounterexampleBuild completed successfully (2701 jobs).

  • Net −2 sorry: the base branch feat/peps-gaugeconsistency carried 4 sorrys in FundamentalTheorem.lean (post_absorption_edge_insertion_equality, gaugeConsistency, the hDim in fundamentalTheorem_PEPS, gauge_unique_mod_edge_scalars); this PR closes the first and third, leaving 2.
  • The two remaining sorrys — gaugeConsistency (:371) and gauge_unique_mod_edge_scalars (:809) — are pre-existing, carry **Proof status:** markers, and cite docs/paper-gaps/peps_injective_ft_section3_route.tex / peps_gauge_edge_scalars.tex. Acceptable under paper-realignment mode; the PR does not claim to close them. No axiom/admit/native_decide.

New since the last review cycle — EdgeScalarSolve.lean + perVertexScalar (sorry-free, sound)

The recent commits (ea7f42d32842d2) add the combinatorial backbone of the absorption step, and it is correct:

  • EdgeScalarSolve.lean (new, +503, sorry-free): the spanning-tree coboundary solve. prod_orientedIncidence_eq_one (necessity: any oriented incidence product has global product 1, via the edge-endpoint cancellation prod_incVertex_endpoint + sigmaSwap) and exists_edgeScalars_of_connected (sufficiency: induction on card V, deleting a vertex via …exists_connected_induce_compl_singleton_of_finite_nontrivial, transferring incidences through incEquiv/prod_free_eq and folding the deleted vertex's scalar into its neighbour t' W₀ = t w₀ · t v₀). The vertex-deletion bookkeeping (liftEdge/restrictEdge, the v0Inc subsingleton, orientedIncidence_split) is carefully done. This is exactly the solvability criterion the connectivity gap note identifies.
  • perVertexScalar (FundamentalTheorem.lean:310, sorry-free): genuinely produces the per-vertex scalar c ≠ 0 with A_v = c · gaugeVertex B Z v, composing one_vertex_complement_comparison with sameTwoBlockInsertions_of_edgeInsertedCoeff_eq and the four two-block injectivity facts. Real progress — gaugeConsistency's remaining sorry is now reduced to the documented assembly (∏ c_v = 1 + gauge-inversion packaging), which the in-source comment lays out honestly.
  • glTranspose/glTranspose_inv_coe/reindexAlgEquiv_transpose (EdgeGaugeFamily.lean): correct — val_inv/inv_val use transpose_mul as an anti-homomorphism; glTranspose_inv_coe routes through transpose_nonsing_inv.

🟡 New build warnings — unused [Fintype V] on isVertexInjective_reindexTensor

The build emits two warnings on the new declaration isVertexInjective_reindexTensor (FundamentalTheorem.lean:281/285, not present on base):

warning: …:285:0: automatically included section variable(s) unused …: [Fintype V]
warning: …:281:0: `isVertexInjective_reindexTensor` does not use … [Fintype V]

It trips linter.unusedSectionVars and linter.unusedFintypeInType. The fix is one line and matches the file's own convention (omit [Fintype V] in is already used at lines 173, 186, 521…): prefix the theorem with

omit [Fintype V] in
theorem isVertexInjective_reindexTensor

Fix this →

✅ Previously-flagged items — confirmed resolved on this head

Naming (openBondContraction_of_sameInsertions), docstring "implies", unscoped maxHeartbeats removed, dead twoBlockComb/twoBlockLeftInverse cluster removed, unused imports in GaugeAction.lean/VertexComplement/Basic.lean removed, operator-Schmidt sectioning comment added. The vertexComplementKernelCondition_empty_eq_zero d=0 concern remains a confirmed false positive.

ℹ️ Advisory / out of scope

  • The remaining open threads are Blueprint↔Lean sync (notably the codex P1: thm:gaugeConsistency / thm:fundamentalTheorem_PEPS carry \leanok while their Lean proofs still rest transitively on sorry) and prose. Those belong to the dedicated workflow, but the \leanok-on-sorry pair is a genuine proof-integrity-adjacent issue worth resolving before merge.
  • set_option maxHeartbeats 400000 in on exists_bondGauge_of_fullContraction and glTranspose's Fin m/ specialization remain acceptable advisory items noted in prior cycles.

Once the one-line omit is added (clearing the new build warnings), this is approvable on the code/math scope.
· branch feat/peps-1361

@LionSR

LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@claude review

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

Review Summary — PR #2406

feat(peps): close two_injective_tensor_insertion_comparison (#1361)

This review covers 15 changed files (+5243/−871) across the PEPS capstone, gauge pipeline, connectivity counterexample, and the operator-Schmidt comparison. The review is conducted under the code-review categories listed in the PR instructions; blueprint-sync and prose-quality issues are excluded (handled by the dedicated workflow).

Per-category findings

🔴 Proof integrity (no issues found)

  • No sorry, axiom, native_decide, or unsafeCast appear in the diff. The two remaining sorrys — gaugeConsistency and gauge_unique_mod_edge_scalars — are pre-existing, documented in the PR body, and tracked in docs/paper-gaps/peps_injective_ft_section3_route.tex. This is acceptable under paper-realignment mode.

🔴 Proof correctness (no issues found)

  • exists_edgeScalars_aux in EdgeScalarSolve.lean is a clean induction on |V| with a spanning-tree coboundary construction. The identity stepA correctly handles the transitive evaluation of t''s product.
  • post_absorption_edge_insertion_equality chains exists_edgeGaugeFamilyhΦcoeff/hΦconjedgeInsertedCoeff_applyGauge correctly; the reindex-transpose lemmas (hZt, hZit) close the matrix-level equality.
  • exists_bondGauge_of_fullContraction in TwoInjectiveComparison/Basic.lean instantiates gauge_eq1/gauge_eq2/gauge_inv with the config-indexed linear independence from hA₁.config_linearIndependent et al., producing the invertible bond gauge. The operator-Schmidt uniqueness argument is correctly translated to the abstract two-block setting.
  • The connectivity counterexample in GaugeConsistencyConnectivityCounterexample.lean is mathematically correct: the empty graph on two vertices with A=(2,3), B=(6,1) satisfies SameState (both products are 6), vertex injectivity, and vacuous positivity, yet gaugeConsistency fails because A₀=2≠6=B₀.

🔴 Type safety (no issues found)

  • No universe polymorphism issues or missing DecidableEq/Fintype instances. Type coercions through Fin.cast, glReindex, finCongr, and Matrix.reindexAlgEquiv are correctly threaded.

🟡 Mathlib style (acceptable)

  • Naming follows conventions (camelCase for defs, snake_case for theorems). The handful of v0Inc_* lemma names mix the predicate identifier v0Inc (camelCase) into theorem names — not a linter violation but slightly inconsistent. No action required.

🟡 Performance (acceptable)

  • set_option maxHeartbeats 400000 at TwoInjectiveComparison/Basic.lean line 712 is correctly scoped to exists_bondGauge_of_fullContraction via set_option … in chained with open scoped Classical in. The raise is explained by the four noncomputable Fintype unifications across gauge_eq1/gauge_eq2 calls. No timeout risk.
  • No decide on large types, no unbounded simp sets.

🟡 Modularity & duplication (acceptable)

  • General linear-algebra lemmas (exists_dual_isolating, gauge_eq1, gauge_eq2, gauge_inv) in TwoInjectiveComparison/Basic.lean carry docstring notes acknowledging they belong in TNLean/Algebra/OperatorSchmidt.lean.
  • glTranspose and reindexAlgEquiv_transpose in EdgeGaugeFamily.lean are small GL/matrix utility lemmas that could be upstreamed, but their local placement is acceptable for now.

🟡 Documentation — one issue (must fix)

  • ⚠️ vcExtraIndicator_split (VertexComplement/KernelDescent.lean line 169) is the one new top-level theorem in this PR that lacks a /-- docstring. All new declarations should carry docstrings. An inline comment has been posted with the suggested content. This must be fixed before approval.

🟡 Paper-gap notes (acceptable)

  • docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex (new) follows docs/paper-gaps/policy.tex: it states the assertion, isolates the obstruction (oriented incidence product forces product 1 per component), gives a concrete counterexample with machine-checked refutation, identifies the correct hypothesis (G.Connected), and states what is established vs. remaining. The construction A₂, B₂ is explicit and checked in Lean. The note is self-contained for a mathematical reader.
  • docs/paper-gaps/peps_injective_ft_section3_route.tex (+19 lines) updates the remaining-obligations ledger to reflect newly proved results (post_absorption_edge_insertion_equality, perVertexScalar, two_injective_tensor_insertion_comparison) without altering the mathematical accounting.

Verdict: REQUEST_CHANGES

One 🟡 issue must be fixed:

  • Add a /-- docstring to vcExtraIndicator_split in TNLean/PEPS/VertexComplement/KernelDescent.lean.

This is a well-structured, mathematically careful PR. The new EdgeScalarSolve.lean provides a clean combinatorial lemma; the file splits improve modularity; and the connectivity counterexample gives an attested fix for a faithfulness gap. Once the missing docstring is added, this is ready to merge.

🤖 Generated with Claude Code

Comment thread TNLean/PEPS/FundamentalTheorem/GaugeAction.lean
Comment thread TNLean/PEPS/FundamentalTheorem/GaugeAction.lean
@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Follow-up to the CHANGES_REQUESTED review — documentation finding is broader than stated

The submitted summary lists vcExtraIndicator_split as "the one new top-level theorem that lacks a /-- docstring." That undercounts the gap. A full audit of the new declarations finds the following additional undocumented top-level lemmas/defs (all in newly-added or split-out files, so all on added lines):

  • prod_incident_eq_prod_edgeTNLean/PEPS/FundamentalTheorem/GaugeAction.lean:225 (a reusable reindexing identity; inline comment posted)
  • gauge_sum_left_right_matrix_invTNLean/PEPS/FundamentalTheorem/GaugeAction.lean:219 (inline comment posted)
  • assembleσ_of_neTNLean/PEPS/FundamentalTheorem/OneVertexComparison.lean:150 (companion to the documented assembleσ_of_eq)
  • edge0_inc_v0, edge0_inc_w0, edge0_v0IncTNLean/PEPS/EdgeScalarSolve.lean:247,254,261 (small facts about the documented edge0; a one-line docstring each, or a grouping /-! -/ section comment, suffices)
  • vcExtraIndicator_splitTNLean/PEPS/VertexComplement/KernelDescent.lean:169 (as already noted)

These are all 🟡 Documentation under the review rubric ("new definitions and key theorems"). The edge0_inc_* trio is the most minor (they are immediate corollaries of edge0); prod_incident_eq_prod_edge is the most worth documenting since it is a general reusable lemma. All should be addressed before approval.

Everything else in my independent re-review of the synchronized head (32842d2) agrees with the standing summary: the two remaining sorrys (gaugeConsistency, gauge_unique_mod_edge_scalars) are pre-existing, documented, and paper-gap–tracked (the PR is net sorry-reducing); EdgeScalarSolve.exists_edgeScalars_aux is a complete and correct spanning-tree coboundary induction; the connectivity counterexample faithfully refutes the connectivity-free statements; and the paper-gap note peps_gaugeConsistency_connectivity_gap.tex is self-contained and policy-conformant. The verdict stands: REQUEST_CHANGES on documentation grounds.

🤖 Generated with Claude Code

@LionSR

LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@LionSR

LionSR commented Jun 6, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Claude finished @LionSR's task in 4m 55s —— View job


Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: REQUEST_CHANGES — two newly-introduced 🟡 build-warning classes remain. The mathematics is sound and the headline result is genuinely closed; the docstring items from the two most recent review cycles are now fixed.

Scope: proof integrity, correctness, Mathlib style, type safety, modularity, documentation. Blueprint↔Lean sync and prose are handled by the dedicated workflow.

Build & integrity — verified

lake build TNLean.PEPS.FundamentalTheorem TNLean.PEPS.TwoInjectiveComparison TNLean.PEPS.VertexComplement.KernelDescent TNLean.PEPS.EdgeScalarSolve TNLean.PEPS.GaugeConsistencyConnectivityCounterexampleBuild completed successfully (2701 jobs).

  • Net −2 sorry: FundamentalTheorem.lean carried 4 sorrys on origin/feat/peps-gaugeconsistency and carries 2 here (gaugeConsistency at :401, gauge_unique_mod_edge_scalars at :846). Both are pre-existing, carry **Proof status:** markers, cite docs/paper-gaps/, and are not claimed closed. No new sorry/axiom/admit/native_decide in any changed file.
  • two_injective_tensor_insertion_comparison (PEPS FT: formalize the generalized two-injective-tensor comparison #1361) is genuinely sorry-free with no hypotheses beyond the source's (the [Nonempty …] instances encode the one-point spectator boundary). The operator-Schmidt route is correct and faithful.

✅ Resolved since the last cycle

The three missing-docstring items from the 21:53 / 22:07 reviews are addressed by commits 27ce9cc and ac021b8:

  • vcExtraIndicator_split (KernelDescent.lean:170) — now documented.
  • gauge_sum_left_right_matrix_inv (GaugeAction.lean:220) and prod_incident_eq_prod_edge (GaugeAction.lean:228) — now documented.

🟡 New build warnings (must fix before approval)

1. Unused [Fintype V] on isVertexInjective_reindexTensor (FundamentalTheorem.lean:281/285). The build emits:

warning: …:285:0: automatically included section variable(s) unused … `isVertexInjective_reindexTensor`
warning: …:281:0: `isVertexInjective_reindexTensor` does not use the following hypothesis in its type

This trips linter.unusedSectionVars / linter.unusedFintypeInType. This is the same item flagged on 21:58; it is still unaddressed. The fix is one line, matching the file's own convention (omit [Fintype V] in is already used elsewhere in this file and in EdgeScalarSolve.lean):

omit [Fintype V] in
theorem isVertexInjective_reindexTensor

Fix this →

2. Twelve show-tactic style warnings in the new EdgeScalarSolve.lean (lines 250, 251, 257, 258, 264, 265, 350, 353, 356, 368, 371, 374). The build emits, for each:

warning: …EdgeScalarSolve.lean:250:10: The `show` tactic should only be used to indicate intermediate goal states for readability.

These come from show-then-exact patterns used to definitionally unfold edge0/v0Inc, e.g. · left; show min v₀ w₀ = v₀; exact min_eq_left h.le (lines 250–251). The Mathlib style linter discourages this use of show for definitional change. Replace each with change (or drop the show and let exact unify, where it typechecks) so the new file builds warning-free, consistent with the rest of the PR.
Fix this →

ℹ️ Advisory

  • set_option maxHeartbeats 400000 in on exists_bondGauge_of_fullContraction (TwoInjectiveComparison/Basic.lean) is a PROOF_INTEGRITY.md warning, justified inline. Acceptable.
  • The general operator-Schmidt lemmas (gauge_eq1/2, gauge_inv, exists_dual_isolating) and glTranspose remain PEPS-free relocation/upstreaming candidates, already marked with sectioning comments. Acceptable.
  • Open blueprint/prose threads (the codex P1 \leanok-on-sorry pair, missing blueprint entries) are out of scope here and remain for the dedicated workflow.

What's solid

two_injective_tensor_insertion_comparison (#1361), post_absorption_edge_insertion_equality (#1364), and the fundamentalTheorem_PEPS bond-dimension equality (#874) are all closed. The new EdgeScalarSolve.lean spanning-tree coboundary solve (prod_orientedIncidence_eq_one, exists_edgeScalars_of_connected), perVertexScalar, and the GaugeConsistencyConnectivityCounterexample are sorry-free and mathematically correct. Once the two build-warning items above are cleared, this is approvable on the code/math scope.
· branch feat/peps-1361

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

Review summary — APPROVE

I reviewed this PR against the in-scope categories (proof integrity, proof correctness, Mathlib style, type safety, performance, modularity, documentation, and paper-gap notes). Blueprint ↔ Lean sync and prose/banned-language checks are excluded here per the dedicated Blueprint Sync & Prose Review workflow.

Proof integrity 🔴 — clean

  • The diff introduces zero new sorry/admit/axiom/native_decide and in fact removes three sorrys (the previously-open proof of two_injective_tensor_insertion_comparison).
  • The two sorrys remaining in TNLean/PEPS/FundamentalTheorem.lean (gaugeConsistency at line 401, gauge_unique_mod_edge_scalars at line 846) are pre-existing assembly obligations, unchanged by this PR, explicitly disclaimed in the PR body and documented in docs/paper-gaps/peps_injective_ft_section3_route.tex and docs/paper-gaps/peps_gauge_edge_scalars.tex. Acceptable under CLAUDE.md paper-realignment mode.
  • The one set_option maxHeartbeats 400000 (exists_bondGauge_of_fullContraction, TwoInjectiveComparison/Basic.lean:712) is a docs/PROOF_INTEGRITY.md warning, not a blocker, and carries an inline justification.

Proof correctness 🔴 — verified by compilation

The three genuinely new proof files compile cleanly under lake env lean (exit 0 each):

  • TNLean/PEPS/EdgeScalarSolve.lean — the spanning-tree coboundary / edge-scalar solve. The orientation convention in edgeScalarUnit (scalar s e at the lower endpoint, (s e)⁻¹ at the upper) is consistent across the necessity direction (prod_orientedIncidence_eq_one, cancelling each edge against its inverse over its two endpoints via prod_incVertex_endpoint) and the existence direction (exists_edgeScalars_aux by strong induction on Fintype.card V, deleting a vertex whose removal preserves connectivity). The base case correctly forces t v = 1 from ∏ t = 1 on a subsingleton.
  • TNLean/PEPS/VertexComplement/KernelDescent.lean — the star-boundary kernel descent establishing VertexComplementTensorInjective.
  • TNLean/PEPS/GaugeConsistencyConnectivityCounterexample.lean — a Lean-checked refutation of the connectivity-free statements.

Faithfulness of the new connectivity hypothesis — exemplary

Adding hconn : G.Connected to gaugeConsistency (threaded into fundamentalTheorem_PEPS) is a hypothesis-strengthening change, which CLAUDE.md's faithfulness rule requires to be documented. It is handled correctly: GaugeConsistencyConnectivityCounterexample.lean proves that the connectivity-free statement is false (empty graph on two vertices, A₀A₁ = 6 = B₀B₁ but A₀ = 2 ≠ 6 = B₀), so the added hypothesis is the source's implicit assumption rather than a smuggled-in restriction. The witness keeps positivity to isolate connectivity as the missing assumption.

Paper-gap notes 🟡 — pass against docs/paper-gaps/policy.tex

  • peps_gaugeConsistency_connectivity_gap.tex is self-contained: it states the cited assertion (paper_normal.tex:1207, "the constants λ can be incorporated into the gauge transformations"), isolates the structural obstruction (oriented incidence products have per-component product 1), gives a concrete witness, and renders a clear verdict (add a connectivity hypothesis; existence-vs-uniqueness gap distinguished from peps_gauge_edge_scalars.tex). The note's substitution of λ_v for the source's λ_i is a harmless notational alignment (already flagged advisory in a prior thread).
  • The peps_injective_ft_section3_route.tex addition is a coherent ledger item recording the now-formalized vertex-complement injectivity block.

Documentation 🟡 — resolved

The previous review cycle's in-scope documentation findings (missing docstrings on prod_incident_eq_prod_edge, gauge_sum_left_right_matrix_inv, and vcExtraIndicator_split) were addressed by the recent doc(peps) commits; I resolved those three threads.

Remaining open threads — out of scope here

All other unresolved threads are Category A (blueprint sync) and Category B (prose / Lean-identifiers-in-docstrings), which belong to the Blueprint Sync & Prose Review workflow and are not evaluated here.

Advisory (non-blocking)

  • EdgeScalarSolve.lean:227 v0Inc_subsingleton is declared instance but cannot be synthesized (explicit hw hypothesis); it is only used explicitly. Prefer a plain theorem. Inline comment posted.
  • EdgeGaugeFamily.lean:59 glTranspose is /Fin m-specific but field- and index-agnostic; a candidate for generalization/upstreaming (prior advisory thread).

No in-scope 🔴 or 🟡 issues remain outstanding. Approving.


/-- The edges of `G` incident to both `w` and `v₀` (with `w ≠ v₀`) form a
subsingleton. -/
instance v0Inc_subsingleton (v₀ w : V) (hw : w ≠ v₀) :

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ℹ️ Advisory (Mathlib style — instance keyword on a non-synthesizable declaration).

v0Inc_subsingleton is declared as an instance, but its explicit hypothesis hw : w ≠ v₀ cannot be supplied by typeclass synthesis, so this instance can never fire during resolution. The single use site (line 295) already invokes it explicitly: have : Subsingleton ... := v0Inc_subsingleton (G := G) v₀ w₀ hw₀ne. Since it is only ever applied by hand, prefer a theorem/lemma returning Subsingleton {ie : IncidentEdge G w // v0Inc v₀ ie.1} over instance, to avoid registering a never-matching candidate in the instance cache.

Non-blocking; correctness is unaffected.

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: APPROVE. No 🔴 or 🟡 issues remain that must block merge.

Scope: proof integrity, correctness, Mathlib style, type safety, performance, modularity, documentation, paper-gap notes. (Blueprint sync and prose quality are handled by the dedicated workflow.)


What was reviewed

This is a stacked PR (#2403→this) that closes two_injective_tensor_insertion_comparison (the generalized two-injective comparison, core of #1361) and modularizes the PEPS Fundamental Theorem into GaugeAction, EdgeInsertion, and OneVertexComparison. The PR adds 5250 lines and deletes 871 across 15 files. I built every changed module locally.

🔴 Proof integrity

The two remaining sorry markers (gaugeConsistency at FundamentalTheorem.lean:1451, gauge_unique_mod_edge_scalars at FundamentalTheorem.lean:825) are pre-existing obligations, explicitly documented in docs/paper-gaps/peps_injective_ft_section3_route.tex, and not claimed by this PR. Each carries a proof-status docstring listing the remaining assembly steps. No axiom, admit, native_decide, unsafeCast, or circular reasoning is present.

🔴 Proof correctness

All new sorry-free theorems are mathematically sound:

  • two_injective_tensor_insertion_comparison_core (TwoInjectiveComparison.lean:4390) — follows the operator-Schmidt route of docs/paper-gaps/peps_injective_ft_section3_route.tex: the fully contracted identity fullContraction_eq supplies a bond gauge via exists_bondGauge_of_fullContraction, the one-leg-open identities openBondContraction_of_sameInsertions force the master per-bond constraint bondGauge_master_constraint, and iterating that constraint forces g to be a nonzero scalar multiple of the identity (bondGauge_scalar_of_master). The empty-config vacuous case is handled by twoBlockReciprocalScalarProportional_of_isEmpty_config. The main theorem two_injective_tensor_insertion_comparison dispatches to these two cases.

  • exists_edgeScalars_of_connected (EdgeScalarSolve.lean:570) — spanning-tree coboundary proof by induction on Fintype.card V. The base case (card < 2, at most one vertex) is handled by the product-one condition. The induction step removes one vertex v₀ whose deletion keeps the graph connected, sets the scalar on {v₀, w₀} to absorb the product discrepancy, and assembles the edge-scalar family from the induction hypothesis on the vertex-deleted subgraph. The necessity direction prod_orientedIncidence_eq_one confirms the product-one condition is exactly the solvability criterion.

  • post_absorption_edge_insertion_equality (FundamentalTheorem.lean:1289) — obtains edge gauges from exists_edgeGaugeFamily, reindexes and transposes them to match B's bond spaces, and applies edgeInsertedCoeff_applyGauge for the open-edge conjugation.

  • bondDim_eq_of_matrixAlgEquiv (FundamentalTheorem.lean:1485) — standard dimension-count via Module.finrank. Correctly dispatches the bond-dimension equality previously gated by sorry in fundamentalTheorem_PEPS.

  • vertexComplementTensorInjective_of_isVertexInjective (VertexComplement/KernelDescent.lean) — finite kernel descent adapted to the vertex star. The vertexComplementKernelCondition_empty_eq_zero proof's derivation of Nonempty (Fin d) from IsVertexInjective is sound: if Fin d were empty, Fin d → ℂ is a subsingleton, so A.component v η₀ ≠ 0 (from LinearIndependent.ne_zero) would be contradictory.

🟡 Mathlib style

Naming follows conventions: snake_case for theorems (bondDim_eq_of_matrixAlgEquiv, prod_orientedIncidence_eq_one), camelCase for definitions (glTranspose, edgeScalarUnit). The previously-flaggged private lemmas gauge_sum_left_right_matrix_inv and prod_incident_eq_prod_edge now carry docstrings as promoted lemmas.

🟡 Performance

set_option maxHeartbeats 400000 in on exists_bondGauge_of_fullContraction (TwoInjectiveComparison/Basic.lean:5242) is properly scoped with in and carries an explanatory comment about the noncomputable Fintype instance. The linter should not flag it.

🟡 Modularity

General lemmas (glTranspose, linindep_recombine, piProductKernel_mul, piProductKernel_isUnit, bilinear_coeff_zero, reindex_update) remain in PEPS application files with docstring notes suggesting future upstreaming to Algebra/ modules. This is acceptable for now; these are well-isolated and their current locations match the import graph.

🟡 Documentation

All new top-level declarations carry docstrings. The file-split modules (GaugeAction.lean, EdgeInsertion.lean, OneVertexComparison.lean, VertexComplement/Basic.lean, VertexComplement/KernelDescent.lean, EdgeScalarSolve.lean, GaugeConsistencyConnectivityCounterexample.lean) each have module-level doc comments explaining their mathematical role and paper source.

🟡 Paper-gap notes

The new note docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex is self-contained: it introduces notation, states the source assertion (arXiv:1804.04964, line 1207), isolates the connectivity obstruction, provides a concrete machine-checked counterexample (empty graph on two vertices, 2·3=6=6·1 but 6≠2), gives the correct hypothesis (G.Connected), and distinguishes this existence gap from the balanced-edge-scalar uniqueness gap of peps_gauge_edge_scalars.tex. The prose is mathematical, not implementation-diary.

The update to docs/paper-gaps/peps_injective_ft_section3_route.tex adds a status entry documenting the vertex-complement injectivity infrastructure and accurately states what remains (the coefficient identity feeding one-bond insertions into the abstract comparison).

ℹ️ Advisory (import hygiene)

Mathlib.Combinatorics.SimpleGraph.Acyclic is imported in TNLean/PEPS/EdgeScalarSolve.lean but no lemma or definition from that module appears to be used in the file body. If the lemma exists_connected_induce_compl_singleton_of_finite_nontrivial is defined in Acyclic rather than Connected, the import is needed; otherwise it may be a stale leftover. Worth a quick check but not a merge blocker.

@LionSR LionSR merged commit 2b587fb into feat/peps-gaugeconsistency Jun 6, 2026
8 checks passed

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

Review: feat(peps): close two_injective_tensor_insertion_comparison (#1361) (synchronize)

Verdict: REQUEST_CHANGES — three newly-introduced 🟡 Mathlib-style build warnings. The mathematics is sound and the headline result (two_injective_tensor_insertion_comparison, closing #1361) is genuinely proved. The three issues below are small mechanical fixes.

Scope

Proof integrity, proof correctness, Mathlib style, type safety, performance, modularity, documentation, and paper-gap notes. Blueprint ↔ Lean \lean{}/\leanok/\uses{} sync and prose quality are out of scope (handled by the dedicated Blueprint Sync & Prose Review workflow).

Build & integrity — verified

lake build TNLean.PEPS.TwoInjectiveComparison TNLean.PEPS.FundamentalTheorem TNLean.PEPS.VertexComplement.KernelDescent TNLean.PEPS.EdgeScalarSolve TNLean.PEPS.GaugeConsistencyConnectivityCounterexampleBuild completed successfully (2701 jobs).

  • Net −2 sorry: the base branch feat/peps-gaugeconsistency carried 4 sorrys in changed files; this PR removes two_injective_tensor_insertion_comparison (#1361, lem:inj_equal_tensors_2, arXiv:1804.04964 lines 1067–1204) and post_absorption_edge_insertion_equality, leaving only the pre-existing gaugeConsistency and gauge_unique_mod_edge_scalars (both documented in docs/paper-gaps/peps_injective_ft_section3_route.tex).
  • No new sorry or axiom is introduced.
  • The Nonempty (Fin d) derivation in vertexComplementKernelCondition_empty_eq_zero (KernelDescent.lean:344) — previously flagged and re-reviewed as a false positive — is indeed sound: IsVertexInjective gives a nonzero component in Fin d → ℂ, and an empty Fin d would make that space a unit type, contradicting the nonzero.

🔴 Proof integrity & correctness — OK

  • two_injective_tensor_insertion_comparison follows the operator-Schmidt route: fully contracted equality → bond gauge → master per-bond constraint → scalar diagonal form → A₁ = λ·B₁, A₂ = λ⁻¹·B₂. The proof structure matches the paper-gap analysis.
  • EdgeScalarSolve (exists_edgeScalars_of_connected) is a clean induction on Fintype.card V, handling edge transfer through vertex deletion and oriented incidence products.
  • GaugeConsistencyConnectivityCounterexample is a tight refutation: the empty graph on two vertices with scalar tensors A=(2,3), B=(6,1) satisfies all hypotheses except connectivity, yet no gauge equivalence exists.
  • VertexComplement/KernelDescent uses a finite descent (erase one complement vertex at a time) with a clear factorization of the exposed indicator.

🟡 Mathlib style — must fix (3 issues)

  1. linter.style.show in EdgeScalarSolve.lean:368,371,374show is used to change the goal; change must be used instead per Mathlib convention. Three occurrences in the unit_at_w0 proof.

  2. linter.unusedSectionVars + linter.unusedFintypeInType in FundamentalTheorem.lean:281,285isVertexInjective_reindexTensor automatically includes [Fintype V] from the section variable block. Other theorems in the same file already use omit [Fintype V] in to suppress this. The fix is to add omit [Fintype V] in before the theorem.

  3. Unused import in FundamentalTheorem/GaugeAction.lean:3TNLean.PEPS.EdgeGaugeFamily is imported but no symbol from it (glTranspose, exists_edgeGaugeFamily, etc.) is referenced in the file body.

ℹ️ Advisory (non-blocking)

  • set_option maxHeartbeats 400000 in on exists_bondGauge_of_fullContraction (TwoInjectiveComparison/Basic.lean:712) — properly scoped with in, acceptable per Mathlib conventions.
  • glTranspose in EdgeGaugeFamily.lean:59 — specialized to Fin m over ; appropriate for the PEPS domain.
  • Two pre-existing sorry sites in FundamentalTheorem.lean (gaugeConsistency at line 371, gauge_unique_mod_edge_scalars at line 809) — both documented in paper-gap notes and not claimed closed by this PR.

Resolved from prior cycles

The following issues from previous review cycles have been correctly addressed in this push or earlier pushes on this branch:

  • sameOpenBondContraction renamed to openBondContraction_of_sameInsertions (naming convention) ✓
  • Unscoped maxHeartbeats in FundamentalTheorem.lean removed ✓
  • Unused imports TwoInjectiveComparison and KernelDescent in GaugeAction.lean removed ✓
  • Unused import TwoInjectiveComparison in VertexComplement/Basic.lean removed ✓
  • "equivalent" → "implies" docstring accuracy fix ✓
  • Dead-code cluster (twoBlockComb, twoBlockLeftInverse, etc.) removed ✓
  • glTranspose/glTranspose_inv_coe added for transpose-of-gauge conjugation ✓

Mathematics assessment

The mathematical content of this PR is substantial and correct. two_injective_tensor_insertion_comparison (arXiv:1804.04964, Lemma inj_equal_tensors_2) is now fully proved in Lean, and the proof route matches the source paper's operator-Schmidt uniqueness argument. The EdgeScalarSolve development (exists_edgeScalars_of_connected) resolves the spanning-tree coboundary step recorded in docs/paper-gaps/peps_gaugeConsistency_connectivity_gap.tex, and the counterexample file confirms that connectivity is genuinely required for gaugeConsistency and fundamentalTheorem_PEPS. The new paper-gap note peps_gaugeConsistency_connectivity_gap.tex is self-contained, notationally clear, and follows docs/paper-gaps/policy.tex.

edgeScalarUnit (G := G) s w₀ ⟨edge0 (G := G) v₀ w₀ hadj, hinc⟩ = (t v₀)⁻¹ := by
have hne : v₀ ≠ w₀ := G.ne_of_adj hadj
rw [edgeScalarUnit, hs0]
show (if (edge0 (G := G) v₀ w₀ hadj).1.1 = w₀ then _ else _) = (t v₀)⁻¹

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Mathlib style — show used where change is required.

The show tactic here changes the goal rather than describing it for readability. The Mathlib linter linter.style.show requires change in these cases.

Suggested change
show (if (edge0 (G := G) v₀ w₀ hadj).1.1 = w₀ then _ else _) = (t v₀)⁻¹
change (if (edge0 (G := G) v₀ w₀ hadj).1.1 = w₀ then _ else _) = (t v₀)⁻¹

Same issue applies at the next two show calls (current lines 371 and 374 in the inner have blocks). Replace all three show calls with change.

injectivity: the local coefficient family of the reindexed tensor is the
original family precomposed with the bondwise index recast, an injective
reindexing of the configuration type. -/
theorem isVertexInjective_reindexTensor (B : Tensor G d) {bd : Edge G → ℕ}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Mathlib style — unused section variable triggers linter.unusedSectionVars and linter.unusedFintypeInType.

The theorem isVertexInjective_reindexTensor automatically includes [Fintype V] from the section variable block at line 32, but the linter cannot see that IsVertexInjective (which appears in the conclusion) transitively requires it. Other theorems in this file already use omit [Fintype V] in to suppress this warning (e.g., lines 173, 186, 521, 535, 549).

Fix: Add omit [Fintype V] in before the theorem:

Suggested change
theorem isVertexInjective_reindexTensor (B : Tensor G d) {bd : Edge G → ℕ}
omit [Fintype V] in
theorem isVertexInjective_reindexTensor (B : Tensor G d) {bd : Edge G → ℕ}

This is the standard Mathlib idiom when section typeclasses are needed only in the proof body, not in the statement's explicit argument list.

@@ -0,0 +1,934 @@
import TNLean.PEPS.Blocking
import TNLean.PEPS.InsertionAlgebra
import TNLean.PEPS.EdgeGaugeFamily

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Mathlib style — unused import.

TNLean.PEPS.EdgeGaugeFamily is imported but no symbol from it is used in this file. The file references edgeGaugeAt, edgeLeftIncident, edgeRightIncident (from LocalGauge), edgeInsertedCoeff (from InsertionAlgebra), and GL/matrix operations (from Mathlib). No glTranspose, reindexAlgEquiv_finCongr_symm_round, exists_edgeGaugeFamily, or any other EdgeGaugeFamily symbol appears in the file body beyond the import line itself.

Remove this import line.

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

Review — feat(peps): close two_injective_tensor_insertion_comparison (#1361)

Scope: proof integrity, proof correctness, Mathlib style, type safety, performance, modularity, documentation, and the in-scope paper-gap notes. Blueprint↔Lean tag sync and prose/banned-term review of .tex/Lean docstrings are handled by the dedicated Blueprint Sync & Prose Review workflow and are excluded here (this exclusion does not cover the paper-gap notes, which I reviewed below).

Proof integrity 🔴 — clean

No new sorry/admit/axiom/native_decide. This PR reduces the sorry count in TNLean/PEPS/FundamentalTheorem.lean from 4 (base feat/peps-gaugeconsistency) to 2. The two remaining (gaugeConsistency, line 401, and gauge_unique_mod_edge_scalars, line 846) are pre-existing assembly obligations, each source-cited (arXiv:1804.04964 §3) and referred to docs/paper-gaps/peps_injective_ft_section3_route.tex / peps_gauge_edge_scalars.tex, consistent with paper-realignment mode. The bond-dimension equality previously left as sorry is now discharged via bondDim_eq_of_matrixAlgEquiv. The set_option maxHeartbeats 400000 on exists_bondGauge_of_fullContraction (TwoInjectiveComparison/Basic.lean:712) is a PROOF_INTEGRITY.md warning, justified inline (sharing the Classical-derived Fintype (SharedBondConfig …) across four extraction calls) and acceptable.

Proof correctness 🔴 — sound

The operator-Schmidt route for two_injective_tensor_insertion_comparison is logically sound. The empty-bond/empty-config edge case that a prior reviewer found false (twoBlockReciprocalScalarProportional with empty Bond) is correctly handled: bondGauge_scalar_of_master carries [Nonempty (SharedBondConfig bondDim)] (load-bearing, used to produce a nonzero lam), and the public theorem case-splits on Nonempty (SharedBondConfig bondDim), routing the vacuous side to twoBlockReciprocalScalarProportional_of_isEmpty_config. The scope-stronger twoBlockReciprocalScalarProportional_of_pointwise_mul_eq is confined to the single-shared-bond path and carries a **Scope restriction** marker. No dangling hypotheses in bondGauge_master_constraint, _core, or exists_bondGauge_of_fullContraction. The GaugeConsistencyConnectivityCounterexample arithmetic ($2\cdot3=6=6\cdot1$, $B_0=6\neq2=A_0$) genuinely refutes a connectivity-free copy of the gaugeConsistency conclusion (statement shape matches FundamentalTheorem.lean:377-380), not a strawman. The EdgeScalarSolve necessity (prod_orientedIncidence_eq_one) and the spanning-tree sufficiency induction (reusing Mathlib's Connected.exists_connected_induce_compl_singleton_of_finite_nontrivial) are correct. The vertex-complement kernel-descent chain is sound. All files build.

Type safety 🔴 — no issues

Fin.cast/finCongr/reindexAlgEquiv transports across bond-dimension equalities are direction-correct; Subsingleton.elim on -equality proofs is legitimate proof irrelevance; Fintype/DecidableEq instances synthesize.

Mathlib style 🟡 — must address before approval

  1. Redundant Fintype instanceinstFintypeVertexComplementPhysicalConfig (VertexComplement/Basic.lean:78), inline comment posted. inferInstance over a reducible abbrev Pi type that already synthesizes its Fintype; recommend deletion or an inline justification.
  2. instance that can never firev0Inc_subsingleton (EdgeScalarSolve.lean:227) is declared instance but carries an explicit hw : w ≠ v₀ that typeclass synthesis cannot supply, and is only ever applied explicitly (line 295). It should be a theorem/def. This was already raised in an unresolved review thread and has not been addressed in the latest push; flagging that it remains open.

Performance 🟡 / Modularity ℹ️

No timeout risks beyond the single justified maxHeartbeats override. Advisory upstreaming/dedup, non-blocking: glTranspose (EdgeGaugeFamily.lean:59) generalizes verbatim to GL n R over any CommRing and is a clean Mathlib candidate; the delta-collapse + reindex-to-doubled boilerplate is repeated across GaugeAction.lean:835, EdgeInsertion.lean:80, OneVertexComparison.lean:313 and could share a helper.

Paper-gap notes (in scope, reviewed against docs/paper-gaps/policy.tex)

Both changed notes are self-contained mathematical accounts. peps_gaugeConsistency_connectivity_gap.tex states the assertion, isolates the obstruction (oriented-incidence product is 1 per connected component, so the reciprocal vertex-scalar family is absorbable only when its per-component product is 1), gives a concrete machine-checked witness, and gives a clear verdict that G.Connected is the faithful repair. The new obligation item in peps_injective_ft_section3_route.tex is accurate; all cited Lean declarations exist.

One citation issue (already raised, still unresolved): the connectivity-gap note quotes the source as “the constants $\lambda_v$ can be incorporated into the gauge transformations” (line 25-26), but Papers/1804.04964/paper_normal.tex:1207 writes $\lambda_i$, not $\lambda_v$. Inside quotation marks this should reproduce the source notation verbatim or be reformulated as a paraphrase.

Verdict

REQUEST_CHANGES. The mathematics is strong: the capstone lemma is closed without new sorry, the connectivity-gap reasoning is correct and well-documented, and the proofs are sound and type-safe. The only blockers are the two minor-but-genuine Mathlib-style instance-keyword issues above (one new, one pre-existing-unaddressed), plus the still-open paper-gap quotation fix. All are mechanical; once resolved this is ready to approve.

Comment on lines +77 to +79

instance instFintypeVertexComplementPhysicalConfig (v : V) :
Fintype (VertexComplementPhysicalConfig (V := V) (d := d) v) :=

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Mathlib style — redundant Fintype instance.

instFintypeVertexComplementPhysicalConfig is declared as an instance whose body is inferInstance, but VertexComplementPhysicalConfig v is the reducible abbrev (w : {w : V // w ≠ v}) → Fin d. Typeclass synthesis already produces its Fintype directly via Pi.fintype (the subtype {w // w ≠ v} is a Fintype with DecidableEq, and Fin d is a Fintype). The explicit declaration adds a second, definitionally-identical candidate to synthesis without providing anything inferInstance would not already find at every use site.

Recommend deleting the instance. If it was added to work around a synthesis failure or to pin a specific term, please document that reason inline so the redundancy is justified. Minor, but should be resolved before merge.

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

Synchronize review — PR #2406

Resolved this cycle

  • PRRT_kwDORK8b986Hm24K (resolved): The proof block of thm:peps_isTwoBlockInjective_complementTwoBlock now correctly carries \uses{thm:peps_vertexComplementTensorInjective}. Resolved.

Prior unresolved threads still open

The following threads from earlier review cycles were not addressed in this synchronize and remain open:

Thread Issue
PRRT_kwDORK8b986HljsF Missing blueprint entries for sorry-free theorems in TwoInjectiveComparison/Basic.lean
PRRT_kwDORK8b986HlMcy Word-only contraction identity in proof of thm:peps_twoInjectiveTensorInsertionComparison (line 2585)
PRRT_kwDORK8b986Hluwl Word-only proof sketch
PRRT_kwDORK8b986Hluy1 Proof \leanok with no \uses{} block
PRRT_kwDORK8b986HlzR1 Word-only conjugation identity in proof of thm:peps_postAbsorptionEdgeInsertionEquality (line 2237)
PRRT_kwDORK8b986HmUh- Proof \leanok with no \uses{} block
PRRT_kwDORK8b986HmjF8 Word-only proof sketch; conjugation identity (line 2237)
PRRT_kwDORK8b986Hm26j Source-reference shorthand in GaugeAction.lean module docstring
PRRT_kwDORK8b986HmdeO Missing docstring (advisory)
PRRT_kwDORK8b986Hmi-A Banned term "bridge" in TwoInjectiveComparison/Basic.lean line 496
PRRT_kwDORK8b986Hmi_9 Banned phrase "at the heart of" in TwoInjectiveComparison/Basic.lean line 726
PRRT_kwDORK8b986HmjC9 Lean identifiers in prose, TwoInjectiveComparison/Basic.lean line 406
PRRT_kwDORK8b986HmjHm Lean identifier in docstring prose, VertexComplement/Basic.lean line 87

New finding this cycle

One new Category A issue found (inline comment posted above):

  • Incomplete proof \uses{} in thm:peps_postAbsorptionEdgeInsertionEquality (blueprint lines 2231–2232): edgeInsertedCoeff_applyGauge (FundamentalTheorem/EdgeInsertion.lean:255) is the key computational step in the now-proven Lean proof and is cited to arXiv:1804.04964, Section 3, eq:inj_equal_edge. It has no blueprint entry, so it cannot appear in \uses{}. A new entry thm:peps_edgeInsertedCoeff_applyGauge is needed.

Summary: 1 equivalence issue (incomplete \uses{}), 13 prose/status issues from prior cycles unresolved.

Comment on lines +2231 to +2232
\uses{thm:peps_exists_edgeGaugeFamily, thm:peps_edge_gauge_absorption,
def:peps_postAbsorptionEdgeInsertionEquality}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Category A — proof \uses{} incomplete: edgeInsertedCoeff_applyGauge has no blueprint entry

The new \begin{proof}\leanok block lists

\uses{thm:peps_exists_edgeGaugeFamily, thm:peps_edge_gauge_absorption,
    def:peps_postAbsorptionEdgeInsertionEquality}

but the Lean proof (FundamentalTheorem.lean, line 262) invokes edgeInsertedCoeff_applyGauge (defined in FundamentalTheorem/EdgeInsertion.lean, line 255) as the key computation:

rw [hΦcoeff e σ M, hΦconj e M, edgeInsertedCoeff_applyGauge]

edgeInsertedCoeff_applyGauge states the open-edge version of the gauge-insertion identity:
$$
\mathrm{edgeInsertedCoeff}(B^Z, e, \sigma, N)
= \mathrm{edgeInsertedCoeff}(B, e, \sigma,; Z_e^T N (Z_e^{-1})^T),
$$
and its docstring cites arXiv:1804.04964, Section 3, eq:inj_equal_edge. This is a mathematically substantive, sorry-free, source-cited result — not a trivial auxiliary lemma. Because it has no blueprint entry, it cannot appear in \uses{} and the proof dependency graph is incomplete.

Fix: add a new blueprint entry (e.g.\ thm:peps_edgeInsertedCoeff_applyGauge) with \lean{TNLean.PEPS.edgeInsertedCoeff_applyGauge}, \leanok, and proof \leanok, then add it to this \uses{} block.

(Note: thm:peps_edge_gauge_absorption — which records that (absorbEdgeGauges B X).component = gaugeVertex — is a trivial rfl and is not directly invoked in the Lean proof; the substantive step is edgeInsertedCoeff_applyGauge.)

@LionSR LionSR changed the title feat(peps): close two_injective_tensor_insertion_comparison (#1361) feat(peps): close the injective PEPS Fundamental Theorem (positivity + connectivity faithful) Jun 6, 2026
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