AFTD Auto-Formalizing Theoretical Domains

word_block_exchange_is_commuting

def

A mask N of XBAY is commuting for exchange E if its U-projections and V-projections on the exchanged blocks satisfy A_U B_U = B_U A_U and A_V B_V = B_V A_V.

Statement

def word_block_exchange_is_commuting {α : Type*} (E : WordBlockExchange α) (N : List Bool) : Prop
Defined in
arXiv:2610.39941, Section 4, equation (1)
Verified
31 Oct 2026
Axioms
none listed
Built on 2
  • WordBlockExchangeA word block exchange consists of four words X, A, B, Y over an alphabet.
  • word_projThe projection of a word under a binary mask keeps only the letters at positions where the mask equals a given target boolean.
Used by 3
  • word_block_exchange_cThe commuting minimum degree word_block_exchange_c E u v is the infimum in WithTop Nat of mask_u_runs N over all commuting masks N of the…
  • word_block_exchange_bThe noncommuting minimum degree word_block_exchange_b E u v is the infimum in WithTop Nat of mask_u_runs N over all noncommuting masks N…
  • word_block_exchange_transport_back_is_mask_iffFor an exchange E and a mask N satisfying is_word_mask u v (word_block_exchange_after E) N, the backward-transported mask…

Read back from the Lean

For a type α, a WordBlockExchange α structure E (with fields X, A, B, Y : List α), and a boolean list N: Let maskB be the sublist of N of length up to E.B.length obtained after dropping the first E.X.length elements. Let maskA be the sublist of N of length up to E.A.length obtained after dropping the first E.X.length + E.B.length elements. Let AU (respectively, AV) be the list of elements of E.A at indices where the corresponding element of maskA is true (respectively, false), truncated if maskA is shorter than E.A. Let BU (respectively, BV) be the list of elements of E.B at indices where the corresponding element of maskB is true (respectively, false), truncated if maskB is shorter than E.B. The definition asserts that AU ++ BU = BU ++ AU and AV ++ BV = BV ++ AV (i.e., AU and BU commute under concatenation, and AV and BV commute under concatenation).

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

/-- A mask N of XBAY is commuting for E if A_U B_U = B_U A_U and A_V B_V = B_V A_V. -/
def word_block_exchange_is_commuting {α : Type*} (E : WordBlockExchange α) (N : List Bool) : Prop :=
  let maskB := (N.drop E.X.length).take E.B.length
  let maskA := (N.drop (E.X.length + E.B.length)).take E.A.length
  let AU := word_proj true E.A maskA
  let BU := word_proj true E.B maskB
  let AV := word_proj false E.A maskA
  let BV := word_proj false E.B maskB
  AU ++ BU = BU ++ AU ∧ AV ++ BV = BV ++ AV
See it in the graphDiscuss this resultChallenge it