Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Section III, p. 385 — |x₀| and |y| are determined by |x|; |x| = 3n² + 4n gives |x₀| = n, |y| = 3n (corrected: |x₀| is the quotient and |y| the remainder)

Proved
IntractableCoding.Weights.weight_quotient_remainder

by mikedeng1 · Oct 24, 2026 · Mathlib 0df444a (Lean v4.33.1)

linear-codesp2o-batch-pfp2ap2o-correctedp2o-gran-per-chapterp2o-plan-paperp2o-v1three-dimensional-matching

In the setting of the weight identity (xA=0xA=0xA=0, x0x_0x0​ the first ttt components of xxx, y=x0By=x_0By=x0​B, n=∣T∣n=|T|n=∣T∣):

  1. 0≤∣y∣≤3n0\le|y|\le 3n0≤∣y∣≤3n;
  2. ∣x0∣|x_0|∣x0​∣ is the quotient and ∣y∣|y|∣y∣ the remainder of ∣x∣|x|∣x∣ divided by 3n+13n+13n+1:
∣x0∣=⌊∣x∣3n+1⌋,∣y∣=∣x∣ mod (3n+1);|x_0|=\left\lfloor\frac{|x|}{3n+1}\right\rfloor,\qquad |y|=|x|\bmod(3n+1);∣x0​∣=⌊3n+1∣x∣​⌋,∣y∣=∣x∣mod(3n+1);
  1. in particular, if ∣x∣=3n2+4n|x|=3n^2+4n∣x∣=3n2+4n then ∣x0∣=n|x_0|=n∣x0​∣=n and ∣y∣=3n|y|=3n∣y∣=3n.

So ∣x0∣|x_0|∣x0​∣ and ∣y∣|y|∣y∣ are uniquely determined by ∣x∣|x|∣x∣; this is what turns a word of weight 3n2+4n3n^2+4n3n2+4n into nnn rows of BBB summing to 11⋯111\cdots111⋯1.

Differences from the source:

  • correction: |x₀| and |y| are the remainder and quotient (in that order) when |x| is divided by 3n + 1 → |x₀| = |x| / (3n + 1) (quotient) and |y| = |x| % (3n + 1) (remainder); reason: the printed order is false: n = 1, U = {(1,1,1)}, x = all ones (t = 1) has xA = 0, |x₀| = 1, |y| = 3, |x| = 7 = 1·4 + 3, so the remainder 3 ≠ |x₀| and the quotient 1 ≠ |y|; the paper's next sentence (|x| = 3n² + 4n gives |x₀| = n, |y| = 3n) uses the correct order
  • encoding: input a set U ⊆ T × T × T of triples over a finite set T → ThreeDMInstance = ⟨n, edge⟩ with T = Fin n and U = {(a,b,c) | edge a b c}; the triples listed lexicographically, the incidence columns in three blocks a, n + b, 2n + c; reason: any finite T is in bijection with Fin |T|; the row and column orders change no weight and no instance's answer
  • encoding: binary matrix A, row vector x, xA computed mod 2 → Matrix (Fin m) (Fin n) (ZMod 2), Matrix.vecMul x A, Hamming weight hammingNorm; reason: GF(2) = ZMod 2; xA with x indexed by the rows is Matrix.vecMul
Preamble
import Mathlib
import Definitions.Def_IntractableCoding_Weights_Reductions
Formal statement
namespace IntractableCoding.Weights

open PricingWithTips

/-- For every `x` with `xA = 0` (`A = subspaceMatrix I`, `n = |T|`), with `x₀ = firstPart I x`
and `y = x₀ B`: `|y| ≤ 3n`, `|x₀|` is the quotient and `|y|` the remainder of `|x|` divided by
`3n + 1`, and if `|x| = 3n² + 4n` then `|x₀| = n` and `|y| = 3n`. -/
theorem weight_quotient_remainder (I : ThreeDMInstance)
    (x : Fin (tCount I + 3 * I.1 * (tCount I + 1)) → ZMod 2)
    (hx : Matrix.vecMul x (subspaceMatrix I) = 0) :
    hammingNorm (Matrix.vecMul (firstPart I x) (incidence I)) ≤ 3 * I.1 ∧
      hammingNorm (firstPart I x) = hammingNorm x / (3 * I.1 + 1) ∧
      hammingNorm (Matrix.vecMul (firstPart I x) (incidence I)) = hammingNorm x % (3 * I.1 + 1) ∧
      (hammingNorm x = 3 * I.1 ^ 2 + 4 * I.1 →
        hammingNorm (firstPart I x) = I.1 ∧
          hammingNorm (Matrix.vecMul (firstPart I x) (incidence I)) = 3 * I.1) := by sorry

end IntractableCoding.Weights
Source
Berlekamp, McEliece & van Tilborg, On the Inherent Intractability of Certain Coding Problems, IEEE Trans. Inform. Theory IT-24(3), 1978, https://doi.org/10.1109/TIT.1978.1055873, p. 385, Section III, reduction of THREE-DIMENSIONAL MATCHING to SUBSPACE WEIGHTS ("Since 0 ≤ |y| ≤ 3n, …")
Human review
  • Endorsed by Shuze Chen · Oct 24, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 24, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me