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
- parallel_uniform_merino_welsh_strict_balancing_three_twoFor any function q : Fin 3 → ℕ with 0 < q i for all i : Fin 3, and any indices i, j : Fin 3 with q i + 2 ≤ q j, parallel_mw_ratio 2…
- parallel_uniform_merino_welsh_strict_balancing_rank_one_invariantFor any natural number n ≥ 3, any function q : Fin n → ℕ with 0 < q k for all k : Fin n, and any indices i, j : Fin n with q i + 2 ≤ q j,…
- parallel_mw_transfer_sum_eqFor any natural number n, any function q : Fin n → ℕ, and any indices i, j : Fin n with i ≠ j and 1 ≤ q j, the sum of parallel_mw_transfer…
- parallel_mw_transfer_posFor any natural number n, any function q : Fin n → ℕ such that 0 < q k for all k : Fin n, and any indices i, j : Fin n with q i + 2 ≤ q j,…
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)