AFTD Auto-Formalizing Theoretical Domains

wt

defimported Lean

The support $\mathrm{supp}(v) \subseteq \mathrm{Fin}\,n$ consists of coordinates where either component of $v$ is nonzero; the weight is $\mathrm{wt}(v) = |\mathrm{supp}(v)|$.

Statement

open scoped BigOperators in
set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
set_option linter.unnecessarySimpa false in
variable {n : ℕ} {p : ℕ} [Fact p.Prime] in
noncomputable def wt (v : V n p) : ℕ
Defined in
TCSlib, `wt`
Lean proof
By Allan Li, Hydroxyi (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
  • suppThe support $\mathrm{supp}(v) \subseteq \mathrm{Fin}\,n$ consists of coordinates where either component of $v$ is nonzero; the…
  • VThe ambient space $V = \mathbb{F}_p^n \times \mathbb{F}_p^n$ of pairs of coordinate vectors.
Used by 5
  • code_dist_le_nCode distance is at most the block length. Fix a prime $p$ and a natural number $n$, and let $V = \bbf_p^{\,n} \times \bbf_p^{\,n}$ carry…
  • code_dist_eq_zero_of_code_k_eq_zeroZero logical dimension forces zero distance. Let $p$ be a prime and let $S$ be a subspace of the symplectic space…
  • wt_le_nWeight bound. Fix a prime $p$ and a natural number $n$, and let $v \in \bbf_p^n \times \bbf_p^n$. Then the weight $\mathrm{wt}(v)$…
  • dist_implies_correctableErasure correction below the code distance. Let $p$ be prime and let $S$ be an $\mathbb{F}_p$-subspace of the symplectic space…
  • code_dist$d(S) = \min\{\mathrm{wt}(v) \mid v \in S^{\perp_\omega} \setminus S,\; \mathrm{wt}(v) \neq 0\}$ (or $0$ if no such $v$ exists).

Lean source view module on GitHub

open scoped BigOperators in
set_option linter.mathlibStandardSet false in
open scoped BigOperators in
open scoped Real in
open scoped Nat in
open Classical in
open scoped Pointwise in
set_option maxRecDepth 4000 in
set_option synthInstance.maxHeartbeats 20000 in
set_option synthInstance.maxSize 128 in
set_option relaxedAutoImplicit false in
set_option autoImplicit false in
set_option linter.unnecessarySimpa false in
variable {n : ℕ} {p : ℕ} [Fact p.Prime] in
/-- Weight of a vector v in V -/
noncomputable def wt (v : V n p) : ℕ := (supp v).card
See it in the graphDiscuss this resultChallenge it