leanprover-community / leanprover-community/physlib
Incorrect initialization of `S` in `ZModCharges` definition
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 749
- Forks
- 189
- 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 (
qwen2.5-coder:7b) 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/Particles/SuperSymmetry/SU5/ChargeSpectrum/ZMod.lean (around line 81) is incorrect.
Current text
def ZModCharges (n : ℕ) [NeZero n] : Finset (ChargeSpectrum (ZMod n)) :=
let S : Finset (ChargeSpectrum (ZMod n)) := ofFinset Finset.univ Finset.univ
S.filter (fun x => IsComplete x ∧ ¬ x.IsPhenoConstrained ∧ ¬ x.YukawaGeneratesDangerousAtLevel 4)
Why this is wrong
The code attempts to create a finite set of charge spectra with values in ZMod n, but the initialization of S is incorrect. ofFinset Finset.univ Finset.univ creates a set with a single element, which is not what is intended.
Suggested correction
def ZModCharges (n : ℕ) [NeZero n] : Finset (ChargeSpectrum (ZMod n)) :=
Finset.univ.filter (fun x => IsComplete x ∧ ¬ x.IsPhenoConstrained ∧ ¬ x.YukawaGeneratesDangerousAtLevel 4)
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
Read Physlib/Particles/SuperSymmetry/SU5/ChargeSpectrum/ZMod.lean around lines 81–83 and verify whether the current initialization represents the intended set of charge spectra. Confirm the suggested correction with the project’s available Lean checks; the issue is done when the definition enumerates the intended spectra and still passes those checks.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100