leanprover-community / leanprover-community/physlib

Incorrect type name in documentation for WickAlgebra grading

Open Beginner friendly
#1,529 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue help-wanted
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/QFT/PerturbationTheory/WickAlgebra/Grading.lean (around line 393) is incorrect.

Current text
For a field statistic `𝓕`, the algebra `𝓕.WickAlgebra` is graded by `FieldStatistic`.
Why this is wrong

The documentation comment claims that 𝓕 is a FieldStatistic, but the variable is actually a FieldSpecification. The file defines an instance WickAlgebraGrade : GradedAlgebra (A := 𝓕.WickAlgebra) statSubmodule where 𝓕 is bound as a FieldSpecification in the namespace FieldSpecification. This means the algebra 𝓕.WickAlgebra is graded by FieldStatistic, but the parameter 𝓕 itself is not a statistic – it's a specification containing field data. The correction replaces "field statistic" with "field specification" to match the actual type of 𝓕.

The error arises because FieldStatistic refers to an enum (bosonic/fermionic) used to classify fields, while FieldSpecification is a structure defining field properties. The grading mechanism uses FieldStatistic as the grading group, but the parameter 𝓕 must be a specification to contain the necessary data for computing statistics like 𝓕 |>ₛ φs. The fix aligns the documentation with the Lean code's type declarations and usage context.

The GradedAlgebra instance correctly grades 𝓕.WickAlgebra by FieldStatistic, but this depends on 𝓕 being a specification that can compute statistics. Referring to 𝓕 as a statistic in the documentation creates confusion between the grading group and the parameter's actual type.

Suggested correction
For a field specification `𝓕`, the algebra `𝓕.WickAlgebra` is graded by `FieldStatistic`.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open Physlib/QFT/PerturbationTheory/WickAlgebra/Grading.lean around line 393 and read the surrounding FieldSpecification namespace and WickAlgebraGrade instance to confirm the parameter type. Update the comment to call 𝓕 a field specification while retaining FieldStatistic as the grading type, then check the documentation change against the declaration context.

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
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.