AFTD Auto-Formalizing Theoretical Domains

ErrorCorrectingCodes.Codeword.uniform_vector_dist

defimported Lean

The uniform probability mass function on $\alpha^n$, encoded as a function $\alpha^n\to\mathbb{R}$ assigning $1/|\alpha|^n$ to each vector.

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.uniform_vector_dist (n : ℕ) (α : Type*) [Fintype α] [DecidableEq α] :
    (Codeword n α) → ℝ
Defined in
TCSlib, `ErrorCorrectingCodes.Codeword.uniform_vector_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 1
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 uniform distribution on length-`n` vectors: each vector has probability `1/|α|^n`. -/
noncomputable def ErrorCorrectingCodes.Codeword.uniform_vector_dist (n : ℕ) (α : Type*) [Fintype α] [DecidableEq α] :
    (Codeword n α) → ℝ :=
  fun _ => 1 / ((Fintype.card α) ^ n)
See it in the graphDiscuss this resultChallenge it