Skip to content

fix(issue-211): prove linsolve_some#378

Open
eliasjudin wants to merge 1 commit intoVerified-zkEVM:mainfrom
eliasjudin:feat/issue-211-linsolve-some
Open

fix(issue-211): prove linsolve_some#378
eliasjudin wants to merge 1 commit intoVerified-zkEVM:mainfrom
eliasjudin:feat/issue-211-linsolve-some

Conversation

@eliasjudin
Copy link
Contributor

@eliasjudin eliasjudin commented Feb 26, 2026

This PR adds proofs autoformalised by @Aristotle-Harmonic.

linsolve A b = some x → A.mulVec x = b (linsolve_some).

  • touched file: ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • linsolve is kept noncomputable with witness extraction via Classical.choose
  • linsolve_none is left for PR fix(issue-214): prove linsolve_none #379

Resolves #211.

Co-authored-by: Aristotle (Harmonic) aristotle-harmonic@harmonic.fun

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

🤖 Gemini PR Summary

Mathematical Formalization

Proves the linsolve_some theorem: linsolve A b = some x → A.mulVec x = b. This establishes that any solution returned by the solver correctly satisfies the linear system $Ax = b$ within the Berlekamp-Welch implementation.

Technical Implementation

Metadata


Analysis of Changes

Metric Count
📝 Files Changed 1
Lines Added 18
Lines Removed 8

Lean Declarations

✏️ **Removed:** 1 declaration(s)
  • opaque linsolve (A : Matrix (Fin n) (Fin m) F) (b : Fin n → F) : Option (Fin m → F) in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean

sorry Tracking

✅ **Removed:** 2 `sorry`(s)
  • theorem linsolve_some {A : Matrix (Fin n) (Fin m) F} {b : Fin n → F} {x : Fin m → F} in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean
  • opaque linsolve (A : Matrix (Fin n) (Fin m) F) (b : Fin n → F) : Option (Fin m → F) in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean

🎨 **Style Guide Adherence**

The following lines violate the ArkLib style guide:

  • Line 53: Option (Fin m → F) := violates "Use 2 spaces for indentation." (indented 4 spaces instead of 2).
  • Line 54: by violates "Tactic Mode: Place by at the end of the line preceding the tactic block." (placed on its own line instead of at the end of line 53).
  • Line 55: classical violates "Use 2 spaces for indentation." (indented 4 spaces instead of 2).
  • Line 56: exact if h : ∃ x, A.mulVec x = b then some (Classical.choose h) else none violates "Use 2 spaces for indentation." (indented 4 spaces instead of 2).
  • Line 56: exact if h : ∃ x, A.mulVec x = b then some (Classical.choose h) else none violates "Avoid parentheses where possible. Use <| (pipe left) and |> (pipe right) to reduce nesting." (use some <| Classical.choose h instead).
  • Line 66: : A.mulVec x = b := by violates "Operators: ... Place them [:] before a line break rather than at the start of the next line." (the colon should be placed at the end of line 65).

📄 **Per-File Summaries**
  • ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean: Replaces the opaque placeholder for the linsolve linear system solver with a formal noncomputable definition and provides the proof for its basic correctness theorem.

Last updated: 2026-03-02 10:48 UTC.

@eliasjudin eliasjudin marked this pull request as draft February 26, 2026 19:47
eliasjudin added a commit to eliasjudin/ArkLib that referenced this pull request Mar 2, 2026
Prove `linsolve_some` in `ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean`
by splitting on existence in `linsolve` and extracting the chosen witness.

Keep `linsolve_none` unsolved on this branch so PR Verified-zkEVM#378 stays scoped to issue Verified-zkEVM#211.

Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
@eliasjudin eliasjudin force-pushed the feat/issue-211-linsolve-some branch from b1116f1 to 180e710 Compare March 2, 2026 10:29
Prove `linsolve_some` in `ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean`
by splitting on existence in `linsolve` and extracting the chosen witness.

Keep `linsolve_none` unsolved on this branch so PR Verified-zkEVM#378 stays scoped to issue Verified-zkEVM#211.

Co-authored-by: Aristotle (Harmonic) <aristotle-harmonic@harmonic.fun>
@eliasjudin eliasjudin force-pushed the feat/issue-211-linsolve-some branch from 180e710 to 8a3ac7c Compare March 2, 2026 10:46
@eliasjudin eliasjudin marked this pull request as ready for review March 2, 2026 10:46
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.

Proof obligation for linsolve_some in ArkLib/Data/CodingTheory/BerlekampWelch/Sorries.lean

1 participant