AFTD Auto-Formalizing Theoretical Domains

restrictToC

defimported Lean

For $C \subseteq \mathrm{Fin}\,n$, the linear map $V_C \to (C \to \mathbb{F}_p) \times (C \to \mathbb{F}_p)$ sending a vector supported on $C$ to its two component functions restricted to $C$.

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
variable {n : ℕ} {p : ℕ} [Fact p.Prime] in
noncomputable def restrictToC (C : Finset (Fin n)) :
    V_sub (p:=p) C →ₗ[F p] (C → F p) × (C → F p)
Defined in
TCSlib, `restrictToC`
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
  • V_subFor $C \subseteq \mathrm{Fin}\,n$, the support submodule $V_C = \{v \in V \mid \mathrm{supp}(v) \subseteq C\}$.
  • FThe prime field $\mathrm{GF}(p)$, realized as $\mathbb{Z}/p\mathbb{Z}$ via ZMod.
Used by 3
  • restrictToC_extendFromCRestriction inverts extension on coordinates in $C$. Fix a prime $p$, a natural number $n$, and a subset $C \subseteq \{0,1,\dots,n-1\}$…
  • extendFromC_restrictToCExtension recovers a vector supported on $C$. Fix a prime $p$ and a subset $C \subseteq \{1,\dots,n\}$ of coordinates, and let…
  • V_sub_isoV_sub_iso

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
variable {n : ℕ} {p : ℕ} [Fact p.Prime] in
noncomputable def restrictToC (C : Finset (Fin n)) :
    V_sub (p:=p) C →ₗ[F p] (C → F p) × (C → F p) where
  toFun := fun ⟨v, _⟩ => (fun c => v.1 c.1, fun c => v.2 c.1)
  map_add' := by
    rintro ⟨x, hx⟩ ⟨y, hy⟩
    ext c <;> simp
  map_smul' := by
    intro r x
    rcases x with ⟨x, hx⟩
    ext c <;> simp
See it in the graphDiscuss this resultChallenge it