AFTD Auto-Formalizing Theoretical Domains

swap_witness_w0

def

For finite types dA and dR, the swap-based witness W_0 is the complex matrix on (dA × (dA × dR)) defined by (card dA : ℂ) • 1 - S_R, where S_R has entry 1 if a₁ = a'₂ ∧ a'₁ = a₂ ∧ r₁ = r₂ and 0 otherwise, representing (d 1_{AA'} - S_{AA'}) ⊗ 1_R.

Statement

def swap_witness_w0 (dA dR : Type*) [Fintype dA] [DecidableEq dA] [Fintype dR] [DecidableEq dR] :
    Matrix (dA × (dA × dR)) (dA × (dA × dR)) ℂ
Defined in
arXiv:2610.34972 eq. (3)
Verified
07 Nov 2026
Axioms
none listed

Read back from the Lean

Given types dA and dR, both equipped with Fintype and DecidableEq instances, swap_witness_w0 dA dR is defined as the complex matrix with rows and columns indexed by dA × (dA × dR), equal to (Fintype.card dA : ℂ) • 1 (the identity matrix scaled by the cardinality of dA) minus the matrix whose entry at row (a1, (a'1, r1)) and column (a2, (a'2, r2)) is 1 if a1 = a'2 ∧ a'1 = a2 ∧ r1 = r2 and 0 otherwise.

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 swap-based witness W_0 = (d • 1 - S) ⊗ 1 on (dA × (dA × dR)). -/
def swap_witness_w0 (dA dR : Type*) [Fintype dA] [DecidableEq dA] [Fintype dR] [DecidableEq dR] :
    Matrix (dA × (dA × dR)) (dA × (dA × dR)) ℂ := (Fintype.card dA : ℂ) • 1 -
    Matrix.of (fun (a1, (a'1, r1)) (a2, (a'2, r2)) =>
      if a1 = a'2 ∧ a'1 = a2 ∧ r1 = r2 then (1 : ℂ) else 0)
See it in the graphDiscuss this resultChallenge it