AFTD Auto-Formalizing Theoretical Domains

parallel_mw_transfer

def

For a natural number n, a function q : Fin n → ℕ, and indices i, j : Fin n, parallel_mw_transfer q i j is the function Fin n → ℕ defined by Function.update (Function.update q i (q i + 1)) j (q j - 1).

Statement

def parallel_mw_transfer {n : ℕ} (q : Fin n → ℕ) (i j : Fin n) : Fin n → ℕ
Defined in
OP-670
Verified
30 Oct 2026
Axioms
none listed
Used by 4

Read back from the Lean

Given n : ℕ, a function q : Fin n → ℕ, and indices i, j : Fin n, parallel_mw_transfer q i j is the function Fin n → ℕ obtained by updating q at i to q i + 1, and then updating the result at j to q j - 1.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The elementary transfer replacing (q_i, q_j) with (q_i + 1, q_j - 1). -/
def parallel_mw_transfer {n : ℕ} (q : Fin n → ℕ) (i j : Fin n) : Fin n → ℕ := Function.update (Function.update q i (q i + 1)) j (q j - 1)
See it in the graphDiscuss this resultChallenge it