Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Averaging a matrix triple over simultaneous coordinate permutations

Definition
HlawkaSchatten_DiagonalConstruction_OrbitAveraging

by savarin · Sep 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

convexitydiagonal-constructionhlawka-schattenorbit-averagingpermutation-symmetry

Five definitions implement averaging a 3×33\times33×3 real matrix (Triple, from the Localization bundle) over the six simultaneous permutations of its column and coordinate indices by one common permutation.

conjugate applies a permutation eee of {0,1,2}\{0,1,2\}{0,1,2} to both indices of a matrix at once:

conjugate⁡(e,X)(j,i)=X(e(j),e(i)).\operatorname{conjugate}(e,X)(j,i) = X\big(e(j),e(i)\big).conjugate(e,X)(j,i)=X(e(j),e(i)).

Both indices are permuted by the same eee; permuting them separately is not the operation used here.

permutations (marked private) lists the six elements of the symmetric group on {0,1,2}\{0,1,2\}{0,1,2}: the identity, the three transpositions, and the two 333-cycles obtained by composing transpositions.

orbitAverage is the average of a matrix over its orbit under all six of these simultaneous permutations:

orbitAverage⁡(X)=16∑k=05conjugate⁡(permutations⁡(k), X).\operatorname{orbitAverage}(X) = \frac16\sum_{k=0}^{5} \operatorname{conjugate}\big(\operatorname{permutations}(k),\,X\big).orbitAverage(X)=61​k=0∑5​conjugate(permutations(k),X).

averageDiagonal and averageOffDiagonal are the average of the three diagonal entries and the average of the six off-diagonal entries of a matrix,

averageDiagonal⁡(X)=X(0,0)+X(1,1)+X(2,2)3,averageOffDiagonal⁡(X)=X(0,1)+X(0,2)+X(1,0)+X(1,2)+X(2,0)+X(2,1)6.\begin{gathered} \operatorname{averageDiagonal}(X) = \frac{X(0,0)+X(1,1)+X(2,2)}{3}, \\ \qquad \operatorname{averageOffDiagonal}(X) = \frac{X(0,1)+X(0,2)+X(1,0)+X(1,2)+X(2,0)+X(2,1)}{6}. \end{gathered}averageDiagonal(X)=3X(0,0)+X(1,1)+X(2,2)​,averageOffDiagonal(X)=6X(0,1)+X(0,2)+X(1,0)+X(1,2)+X(2,0)+X(2,1)​.​

By a theorem in the same source module, orbitAverage⁡(X)\operatorname{orbitAverage}(X)orbitAverage(X) is determined by exactly these two averages, with every diagonal entry equal to d=averageDiagonal⁡(X)d=\operatorname{averageDiagonal}(X)d=averageDiagonal(X) and every off-diagonal entry equal to o=averageOffDiagonal⁡(X)o=\operatorname{averageOffDiagonal}(X)o=averageOffDiagonal(X). When X∈entryBox⁡X\in\operatorname{entryBox}X∈entryBox, d<0<od<0<od<0<o and −d/o∈[1/2,2]-d/o\in[1/2,2]−d/o∈[1/2,2], so the average is ooo times the cyclic witness triple at parameter −d/o-d/o−d/o. An arbitrary triple need not have these signs. Together with convexity of the triple deficit on the cyclic coordinate box (entryBox), Jensen's inequality applied to this six-fold average is what lets a bound proved for the cyclic family transfer to every matrix in the box.

Definition code
import Definitions.Def_HlawkaSchatten_DiagonalConstruction_Localization
import Mathlib.Analysis.Complex.ExponentialBounds
import Mathlib.Analysis.Convex.Deriv
import Mathlib.Analysis.Convex.Function
import Mathlib.Analysis.Convex.Jensen
import Mathlib.Analysis.Convex.SpecificFunctions.Basic
import Mathlib.Analysis.Convex.SpecificFunctions.Pow
import Mathlib.Analysis.InnerProductSpace.Basic
import Mathlib.Analysis.InnerProductSpace.Dual
import Mathlib.Analysis.InnerProductSpace.NormPow
import Mathlib.Analysis.Normed.Lp.PiLp
import Mathlib.Analysis.Normed.Module.FiniteDimension
import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
import Mathlib.Data.Fin.VecNotation
import Mathlib.Data.Real.Basic
import Mathlib.Data.Sign.Basic
import Mathlib.LinearAlgebra.Dimension.Finite
import Mathlib.Tactic.Abel
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.LinearCombination
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
import Mathlib.Topology.Instances.Sign
import Mathlib.Topology.Order.Compact

/-
Copyright (c) 2026 Ezzeri Esa. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ezzeri Esa
-/

/-! # Simultaneous permutation averaging on the cyclic box -/

namespace HlawkaSchatten.DiagonalConstruction



def conjugate (e : Equiv.Perm (Fin 3)) (X : Triple) : Triple :=
  fun j i ↦ X (e j) (e i)



private def permutations : Fin 6 → Equiv.Perm (Fin 3) :=
  ![Equiv.refl _, Equiv.swap 0 1, Equiv.swap 0 2, Equiv.swap 1 2,
    (Equiv.swap 0 1).trans (Equiv.swap 1 2), (Equiv.swap 1 2).trans (Equiv.swap 0 1)]



noncomputable def orbitAverage (X : Triple) : Triple :=
  ∑ k : Fin 6, (1 / 6 : ℝ) • conjugate (permutations k) X

noncomputable def averageDiagonal (X : Triple) : ℝ := (X 0 0 + X 1 1 + X 2 2) / 3

noncomputable def averageOffDiagonal (X : Triple) : ℝ :=
  (X 0 1 + X 0 2 + X 1 0 + X 1 2 + X 2 0 + X 2 1) / 6

















end HlawkaSchatten.DiagonalConstruction
Source
https://github.com/savarin/hlawka-schatten/blob/79aa498bfcf7b22bd91d771fb32ec278e2d4704b/HlawkaSchatten/DiagonalConstruction/OrbitAveraging.lean#L29-L58
Human review
  • Endorsed by Shuze Chen · Sep 29, 2026

    Confirmed by the moderator at approval.

  • Endorsed by savarin · Sep 29, 2026

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

  • Endorsed by marwahaha · Sep 30, 2026

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me