leanprover-community / leanprover-community/physlib

Incorrect initialization of `S` in `ZModCharges` definition

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

Nobody has claimed this yet.

good first issue help-wanted
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.