Partial swaps and product-basis entries
DefinitionVWZClique_OperatorsThe mask fixes a quadruple on exceptional bits and enforces crossed equalities elsewhere. The four one-bit vectors and their tensor products determine the low-rank factors.
import Mathlib
namespace VWZClique
abbrev Bits (L : ℕ) := Fin L → Bool
abbrev PairBits (L : ℕ) := Bits L × Bits L
abbrev BasisLabel (L : ℕ) := Fin L → Fin 4
abbrev Mask (L : ℕ) := Fin L → Option (Bool × Bool × Bool × Bool)
def swapOK {L : ℕ} (m : Mask L) (x y : PairBits L) : Prop :=
∀ i, match m i with
| none => x.1 i = y.2 i ∧ x.2 i = y.1 i
| some r => (x.1 i, x.2 i, y.1 i, y.2 i) = r
def oneBit (j : Fin 4) (s u : Bool) : ℚ :=
if j = 0 then (if !s && !u then 1 else 0)
else if j = 1 then (if s && u then 1 else 0)
else if s = u then 0
else if j = 2 ∨ s = false then 1 else -1
def basisEntry {L : ℕ} (j : BasisLabel L) (x : PairBits L) : ℚ :=
∏ i, oneBit (j i) (x.1 i) (x.2 i)
open Classical in
noncomputable def swapEntry {L : ℕ} (m : Mask L) (x y : PairBits L) : ℚ :=
if swapOK m x y then 1 else 0
end VWZClique
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6), independent blind auditor
Bits. For any natural number , a bit string of length is a function from the indices to the two Boolean values (false) and (true). At there is exactly one such function, the empty string.
PairBits. For any natural number , a pair of bit strings is an ordered pair of functions from the indices to the Booleans. At there is one pair, consisting of two empty strings.
BasisLabel. For any natural number , a basis label is a function from the indices to . At there is one label, the empty function.
Mask. For any natural number , a mask assigns to each of the indices either no value or an ordered quadruple of Booleans. At there is one mask, the empty function.
swapOK. Given any natural number , a mask assigning either no value or four ordered bits to each index, and two ordered pairs and of length- bit strings, the condition holds precisely when every index satisfies its specified test. If has no value, both and must hold. If has value , then must hold. At the condition always holds.
oneBit. For any label and bits , the value is rational. In the order , with false written as and true as , its four values are for , for , for , and for .
basisEntry. Given any natural number , a label assigning an element of to each of the indices, and an ordered pair of length- bit strings, the entry is the rational product . With arguments in the order and the bits representing false and true, the value rows for are respectively , , and . The empty product at is .
swapEntry. For any natural number , any mask assigning either no value or four ordered bits to each index, and any ordered pairs and of length- bit strings, the entry is the rational number if every index passes the following test, and otherwise. At an index with no mask value one requires both and . At an index with value one requires . The entry is at .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.