Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Second-order layers on ordered distinct pairs

Open
QAlgorithms.Papers.Independent.Intakenext100.P94.second_order_zero_diagonal

by Gohan · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

prove2quantum

Let n≥2n\ge2n≥2. Let LLL be a real linear endomorphism of zero-diagonal n×nn\times nn×n matrices, with the simultaneous inverse permutation action on both indices, and fix a shared pointwise nonlinearity ξ:R→R\xi:\mathbb R\to\mathbb Rξ:R→R. No symmetry of the matrices is assumed. Write Fi∗=∑kFikF_{i*}=\sum_kF_{ik}Fi∗​=∑k​Fik​, F∗i=∑kFkiF_{*i}=\sum_kF_{ki}F∗i​=∑k​Fki​ and F∗∗=∑k,lFklF_{**}=\sum_{k,l}F_{kl}F∗∗​=∑k,l​Fkl​. Then LLL is equivariant if and only if there are weights w0,…,w6∈Rw_0,\ldots,w_6\in\mathbb Rw0​,…,w6​∈R such that, for all inputs and all i≠ji\ne ji=j,

(LF)ij=w0Fij+w1Fji+w2Fi∗+w3F∗i+w4F∗j+w5Fj∗+w6F∗∗.(LF)_{ij}=w_0F_{ij}+w_1F_{ji}+w_2F_{i*}+w_3F_{*i}+w_4F_{*j}+w_5F_{j*}+w_6F_{**}.(LF)ij​=w0​Fij​+w1​Fji​+w2​Fi∗​+w3​F∗i​+w4​F∗j​+w5​Fj∗​+w6​F∗∗​.

The nonlinear layer applies ξ\xiξ to this expression on the ordered distinct-pair coordinates. This characterizes the linear map; independence of the seven weights is not claimed for n=2,3n=2,3n=2,3.

Preamble
import Definitions.Def_QAlgorithms_Papers_Independent_Intakenext100_P94
Formal statement
noncomputable section

namespace QAlgorithms.Papers.Independent.Intakenext100.P94

open scoped BigOperators

attribute [local instance] Classical.propDecidable

/-- Theorem 2, source PDF p.4 and pp.13–14. Output indices are distinct,
as in the proof. Ordered pairs, without symmetry; no independence claim for n<4. -/
theorem second_order_zero_diagonal (n : ℕ) (hn : 2 ≤ n) (xi : ℝ → ℝ)
    (L : DistinctSpace n 2 →ₗ[ℝ] DistinctSpace n 2) :
    (L ∈ equivariantLinearMaps (distinctAction (n := n) (k := 2)) distinctAction ↔
      ∃ w : Fin 7 → ℝ, ∀ F i j, i ≠ j →
        (L F).val ![i,j] = sevenFormula w F.val i j) ∧
    (L ∈ equivariantLinearMaps (distinctAction (n := n) (k := 2)) distinctAction →
      ∃ w : Fin 7 → ℝ, ∀ F i j, i ≠ j →
        xi ((L F).val ![i,j]) = xi (sevenFormula w F.val i j)) := by sorry

end QAlgorithms.Papers.Independent.Intakenext100.P94

end
Source
The general theory of permutation equivarant neural networks and higher order graph variational encoders, arXiv:2004.03990v1, PDF p. 4, Theorem 2 (§3): second order layer with zero diagonal
Read-back

What the Lean code literally says, in plain math · gpt-6.1-sol

For every natural number n≥2n\ge2n≥2, every function ξ:R→R\xi:\mathbb R\to\mathbb Rξ:R→R, and every real-linear map LLL from the space of real arrays (Fij)0≤i,j<n(F_{ij})_{0\le i,j<n}(Fij​)0≤i,j<n​ satisfying Fii=0F_{ii}=0Fii​=0 for every iii to that same space, define simultaneous permutation of the indices by (s⋅F)ij=Fs−1(i),s−1(j)(s\cdot F)_{ij}=F_{s^{-1}(i),s^{-1}(j)}(s⋅F)ij​=Fs−1(i),s−1(j)​. For seven real weights w0,…,w6w_0,\ldots,w_6w0​,…,w6​, put

Sw(F;i,j)=w0Fij+w1Fji+w2∑bFib+w3∑aFai+w4∑aFaj+w5∑bFjb+w6∑a,bFab,S_w(F;i,j)=w_0F_{ij}+w_1F_{ji} +w_2\sum_bF_{ib}+w_3\sum_aF_{ai} +w_4\sum_aF_{aj}+w_5\sum_bF_{jb} +w_6\sum_{a,b}F_{ab},Sw​(F;i,j)=w0​Fij​+w1​Fji​+w2​b∑​Fib​+w3​a∑​Fai​+w4​a∑​Faj​+w5​b∑​Fjb​+w6​a,b∑​Fab​,

where all summation indices range from 000 to n−1n-1n−1. The theorem asserts both that

[∀s,F, L(s⋅F)=s⋅(LF)]⟺[∃w∈R7, ∀F,i,j, i≠j⇒(LF)ij=Sw(F;i,j)],\bigl[\forall s,F,\ L(s\cdot F)=s\cdot(LF)\bigr] \quad\Longleftrightarrow\quad \bigl[\exists w\in\mathbb R^7,\ \forall F,i,j,\ i\ne j\Rightarrow(LF)_{ij}=S_w(F;i,j)\bigr],[∀s,F, L(s⋅F)=s⋅(LF)]⟺[∃w∈R7, ∀F,i,j, i=j⇒(LF)ij​=Sw​(F;i,j)],

and that equivariance of LLL implies the existence of seven real weights www for which ξ((LF)ij)=ξ(Sw(F;i,j))\xi((LF)_{ij})=\xi(S_w(F;i,j))ξ((LF)ij​)=ξ(Sw​(F;i,j)) for every such FFF and every pair i≠ji\ne ji=j. Neither formula is required at diagonal pairs; the domain and codomain already require the arrays themselves to vanish there. No condition is imposed on ξ\xiξ, no uniqueness of weights is asserted, and n=2n=2n=2 is included.

Human review
  • Endorsed by Shuze Chen · Oct 31, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Gohan · Oct 31, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me