Weighted sums with wedge factors assigned to channels
DefinitionVWZClique_FoldedSumThree factorized channels with specified active binary factors are contracted using identities or partial swaps on two pivot pairs.
import Definitions.Def_VWZClique_Contraction
namespace VWZClique
abbrev EdgeSlot := Fin 3 × Slot × Slot
def placedChannel {F : Type*} [Field F] {L : ℕ} (E : Finset EdgeSlot)
(w : ChannelKey L → F) (h : Fin 3) (a b : Block L) : F :=
let x : Slot → Bits L := Sum.elim a b
(∏ i : Slot, w (h, .inl (i, x i))) *
∏ v ∈ E, if v.1 = h then w (h, .inr (v.2.1, v.2.2, x v.2.1, x v.2.2)) else 1
open Classical in
noncomputable def maskKernel {F : Type*} [Field F] {L : ℕ}
(m : Option (Mask L)) (x y : PairBits L) : F :=
match m with
| none => if x = y then 1 else 0
| some s => if swapOK s x y then 1 else 0
noncomputable def placedFold {F : Type*} [Field F] {L : ℕ} (E : Finset EdgeSlot)
(a b : Option (Mask L)) (w : ChannelKey L → F) : F :=
∑ z₁ : Bits L, ∑ z₂ : Bits L, ∑ c : Block L,
∑ x : PairBits L, ∑ x' : PairBits L, ∑ y : PairBits L, ∑ y' : PairBits L,
maskKernel a x x' * maskKernel (F := F) b y y' *
placedChannel E w 0 (block x z₁) (block y z₂) *
placedChannel E w 1 (block y' z₂) c * placedChannel E w 2 c (block x' z₁)
def wedgePlaced (E : Finset EdgeSlot) (left right : Fin 3) : Prop :=
(left, Sum.inl 0, Sum.inl 2) ∈ E ∧ (right, Sum.inr 1, Sum.inr 2) ∈ E
end VWZClique
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6), independent blind auditor
Edge slots. An edge slot is an ordered triple , where and each belong to the six-element set . The two slots can coincide, and exchanging distinct slots gives a different triple.
Placed channel. For any field and natural number , put and . Take any finite , channel , and ordered triples . Write and for . The input assigns arbitrary field values to all single-slot keys and all ordered two-slot keys , with and , for each of the three channels. The placed channel is . An empty second product equals one. For , the unique possible string is empty.
Mask kernel. For any field , natural number , ordered pairs of length- bit strings, and optional mask , the value is zero or one. If is absent, it is one exactly when . A present mask has one entry for each of the coordinates, each entry either blank or an ordered quadruple of bits. The kernel is one exactly when every blank coordinate satisfies and every specified quadruple at equals . In each case it is zero otherwise. At it is one for either choice of mask presence.
Placed fold. For any field , natural number , string set , and six slots , take a finite , optional masks , and arbitrary -valued weights and for all channels , slots , and strings . For , assign for , and put . For , is the indicator of equality if is absent. If is present it is the indicator that, at every coordinate, the ordered bits of reverse those of for a blank mask entry, or the four bits of in order equal the specified quadruple for a filled entry. Write . The placed fold is the field element
All seven variables range independently. At the sum has one term and both indicators equal one.
Placed wedge. For any finite set of triples consisting of a channel and two ordered slots from , and any channel indices , the predicate requires both and . The indices may coincide.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.