AFTD Auto-Formalizing Theoretical Domains

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.
Verified
07 Oct 2026
Axioms
none listed
Built on 2
Used by 2

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))
See it in the graphDiscuss this resultChallenge it