leanprover-community / leanprover-community/physlib
Documentation typo in tensor product example refers to undefined `T1` instead
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 750
- Forks
- 191
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 75
Description
⚠️ 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)`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Physlib/Relativity/Tensors/Elab.lean around lines 31–32 and review the tensor product example in context. Verify that the introduced tensor is named T, then correct the example so its prodNode reference uses T consistently with T2. Done means the documentation no longer refers to the undefined T1.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100