Skip to content

LinearCodes: general Singleton bound + exact-MDS for RS and generators#32

Open
Praz314159 wants to merge 2 commits into
z-tech:mainfrom
Praz314159:z-tech/singleton-bound
Open

LinearCodes: general Singleton bound + exact-MDS for RS and generators#32
Praz314159 wants to merge 2 commits into
z-tech:mainfrom
Praz314159:z-tech/singleton-bound

Conversation

@Praz314159

Copy link
Copy Markdown

"achieved with equality" from docstring is not matched by reality, where only lower bound is proved. Proving singleton bound generically so it can be inherited by codes wherever possible.

Add Generator.fnSingleton_bound (dim c + d ≤ |α| + 1 for any code c ⊆ α → F, via puncturing) and Generator.fn_exists_minWeight (Singleton attained ⇒ a nonzero codeword of weight exactly |α| − k + 1). Stated over a generic finite index type, so they cover Fin n → F and S → F uniformly.

Wire them into the repo's MDS-claiming codes, turning "achieved with equality" from docstring into theorem: reedSolomonSubmodule_minWeight_attained (RS), univariatePowers_minWeight_attained and affineLine_minWeight_attained (generators).

Add `Generator.fnSingleton_bound` (dim c + d ≤ |α| + 1 for any code
c ⊆ α → F, via puncturing) and `Generator.fn_exists_minWeight` (Singleton
attained ⇒ a nonzero codeword of weight exactly |α| − k + 1). Stated over a
generic finite index type, so they cover Fin n → F and S → F uniformly.

Wire them into the repo's MDS-claiming codes, turning "achieved with
equality" from docstring into theorem: reedSolomonSubmodule_minWeight_attained
(RS), univariatePowers_minWeight_attained and affineLine_minWeight_attained
(generators). 0 sorry, 0 user axioms; lake build clean.
@Praz314159 Praz314159 marked this pull request as draft June 23, 2026 14:22
@Praz314159 Praz314159 marked this pull request as ready for review June 23, 2026 15:14
@z-tech

z-tech commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Hi 👋, this is the first PR someone (I don't know) has opened up against my repo.

A non-blocking thought: the RS theorem seems to rely on hammingWeight and fnHammingWeight being definitionally equal on Fin n. Could we add an explicit bridge lemma, maybe fnHammingWeight_eq_hammingWeight, and use it here? That would make the dependency clearer and avoid brittle failures if either definition is refactored later.

Also, since fnSingleton_bound and fn_exists_minWeight are stated for arbitrary Submodule F (α → F), could they live in a more neutral namespace than Generator? They don’t seem generator-specific to me.

Do you plan to use this for something or just fun atm? Overall I'm happy to merge this.

Add `fnHammingWeight_eq_hammingWeight` (rfl) and use it in
`reedSolomonSubmodule_minWeight_attained` instead of relying on defeq.
Move `fnSingleton_bound` / `fn_exists_minWeight` from `Generator` to the
neutral `LinearCodes` namespace; update call sites.
@Praz314159

Copy link
Copy Markdown
Author

Do you plan to use this for something or just fun atm? Overall I'm happy to merge this.

Hey what's up! Was just getting my feet wet, and realized that the MDS claims weren't tight. I am pretty interested in the work here, and am curious what you have planned (if anything) for it. I didn't have anything particular in mind, but I'm familiar with most of the papers referenced in the repo, so can probably be somewhat useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants