ErrorCorrectingCodes.Codeword.matrix_dist
defimported Lean
$\mu_x(v)$ is the fraction of $n\times k$ matrices $G$ satisfying $Gx=v$.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in set_option linter.unusedSectionVars false in open Set Filter Asymptotics Finset in variable {α : Type*} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] in variable {n k m : ℕ} in noncomputable def ErrorCorrectingCodes.Codeword.matrix_dist (n k : ℕ) (x : Codeword k α) : (Codeword n α) → ℝ
- Defined in
- TCSlib, `ErrorCorrectingCodes.Codeword.matrix_dist`
- Lean proof
- By Allan Li (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.ErrorCorrectingCodes.Codeword.matrix_dist← ErrorCorrectingCodes.Codeword.matrix_dist (TCSlib/ErrorCorrectingCodes/LinearCodes.lean:89): verbatim
- Verified
- 07 Oct 2026
- Axioms
- none listed
- Built on 2
- ErrorCorrectingCodes.Codeword.finite_matrix_distFiniteness of the solution set of a linear matrix equation. Let $\alpha$ be a finite field, and let $n$ and $k$ be natural numbers. Fix a…
- ErrorCorrectingCodes.CodewordA codeword of length $n$ over alphabet $\alpha$ is a function $c : \mathrm{Fin}\,n \to \alpha$.
- Used by 2
- ErrorCorrectingCodes.Codeword.prob_leq_ball_sizeWeight distribution of a random linear image is dominated by a Hamming ball. Let $\alpha$ be a finite field, let $n$ and $k \ge 1$ be…
- ErrorCorrectingCodes.Codeword.uniformity_lemmaRandom matrix images of a nonzero vector are uniform. Let $\alpha$ be a finite field, and fix $n \ge 0$ and $k \ge 1$. Let…
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in set_option linter.unusedSectionVars false in open Set Filter Asymptotics Finset in variable {α : Type*} [Fintype α] [Nonempty α] [DecidableEq α] [Field α] in variable {n k m : ℕ} in /-- The distribution on `αⁿ` induced by applying a uniformly random `n×k` matrix to `x`: `matrix_dist n k x v = |{G | G·x = v}| / |α|^(n·k)`. -/ noncomputable def ErrorCorrectingCodes.Codeword.matrix_dist (n k : ℕ) (x : Codeword k α) : (Codeword n α) → ℝ := fun v => (Set.Finite.toFinset (finite_matrix_dist n k v x)).card / ((Fintype.card α) ^ (n * k))