leanprover-community/physlib

Documentation typo in tensor product example refers to undefined `T1` instead

開放

#1,543 建立於 2026年8月17日

 (0 則留言) (0 個反應) (0 位負責人)Lean (139 個分叉)auto 404
good first issue

倉庫指標

星標
 (642 顆星)
PR 合併指標
 (平均合併 2天 14小時) (30 天內合併 75 個 PR)

描述

⚠️ Found by a local LLM, not a human. This was flagged by an automated documentation-mistake finder (qwen3:14b) and passed 10/10 independent verification runs before filing, but it has not been reviewed by a person. Please check it's a genuine error before acting on it.


Summary

The documentation in Physlib/Relativity/Tensors/Elab.lean (around line 31) is incorrect.

Current text

Suppose `T2` is a tensor with color `![c3]`.
  Then `{T | μ ν ⊗ T2 | σ}ᵀ` is `prodNode (tensorNode T1) (tensorNode T2)`.

Why this is wrong

The documentation example claims that {T | μ ν ⊗ T2 | σ}ᵀ elaborates to prodNode (tensorNode T1) (tensorNode T2). This is incorrect because the preceding sentence introduces T, not T1, as the tensor with color ![c3]. The use of T1 refers to an undefined variable, while T is explicitly mentioned in the context.

The correction replaces T1 with T, aligning the example with the declared tensor name. This matches the structure of other examples in the file, which consistently use T and T2 when discussing tensor products. The error likely arose from a copy-paste mistake or typo during documentation authorship.

The fix ensures consistency with Lean's elaboration logic, as the code in TensorExpressionOperator.prod correctly constructs prodNode from the tensors passed to it. Using T1 would incorrectly imply a separate tensor not mentioned in the example.

Suggested correction

Suppose `T2` is a tensor with color `![c3]`.
  Then `{T | μ ν ⊗ T2 | σ}ᵀ` is `prodNode (tensorNode T) (tensorNode T2)`.

貢獻者指南