Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 5: compositional if and only if the compositional contrast vanishes

Proved
ObjectCentric.compositional_iff_contrast_zero

by Xeroth · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

identifiabilityjacobian-rankobject-centric-learningrepresentation-learning

Let f:(RM)K→RN\mathbf f:(\mathbb R^M)^K\to\mathbb R^Nf:(RM)K→RN be differentiable. Then f\mathbf ff is compositional (Definition 1) if and only if

Ccomp(f,z)=0for all z∈Z.C_{\mathrm{comp}}(\mathbf f,\mathbf z)=0\qquad\text{for all }\mathbf z\in\mathcal Z.Ccomp​(f,z)=0for all z∈Z.

The contrast therefore vanishes identically exactly on the compositional maps.

Preamble
import Mathlib
import Definitions.Def_ObjectCentric_Basic

open MeasureTheory
Formal statement
namespace ObjectCentric

theorem compositional_iff_contrast_zero {K M N : ℕ} (f : Lat K M → Obs N)
    (hf : Differentiable ℝ f) :
    IsCompositional f ↔ ∀ z : Lat K M, compContrast f z = 0 := by sorry

end ObjectCentric
Source
Brady, Zimmermann, Sharma, Schölkopf, von Kügelgen and Brendel, Provably Learning Object-Centric Representations, ICML 2023, arXiv:2305.14229v1 (2023), Section 3, Definition 7, eq. (6), p. 6; Appendix A, Lemma 5, pp. 20-21
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let K,M,NK, M, NK,M,N be arbitrary natural numbers, with no positivity assumed. The latent space is Z=(RM)K\mathcal Z = (\mathbb R^M)^KZ=(RM)K. A point z∈Zz \in \mathcal Zz∈Z is a KKK-tuple of "slots" z1,…,zKz_1, \dots, z_Kz1​,…,zK​, and each slot zk∈RMz_k \in \mathbb R^Mzk​∈RM has coordinates zk,1,…,zk,Mz_{k,1}, \dots, z_{k,M}zk,1​,…,zk,M​. The pixel space is RN\mathbb R^NRN, with pixel coordinates indexed by n∈{1,…,N}n \in \{1, \dots, N\}n∈{1,…,N}.

The theorem concerns any map

f:(RM)K→RNf : (\mathbb R^M)^K \to \mathbb R^Nf:(RM)K→RN

under a single hypothesis: fff is (Fréchet) differentiable at every point of (RM)K(\mathbb R^M)^K(RM)K. Nothing more is assumed. In particular, it does not assume continuous differentiability, injectivity, invertibility, or that fff is a diffeomorphism onto its image.

Derived quantities. For z∈Zz \in \mathcal Zz∈Z, let Df(z)Df(z)Df(z) be the derivative of fff at zzz.

  • Slot gradient. For each pixel nnn and slot kkk, the slot gradient is the vector
∂fn∂zk(z)=(∂fn∂zk,1(z),…,∂fn∂zk,M(z))∈RM.\frac{\partial f_n}{\partial z_k}(z) = \Big(\frac{\partial f_n}{\partial z_{k,1}}(z), \dots, \frac{\partial f_n}{\partial z_{k,M}}(z)\Big) \in \mathbb R^M.∂zk​∂fn​​(z)=(∂zk,1​∂fn​​(z),…,∂zk,M​∂fn​​(z))∈RM.

Its mmm-th entry is the nnn-th component of Df(z)Df(z)Df(z) applied to the standard basis vector that is 111 in coordinate (k,m)(k,m)(k,m) and 000 elsewhere.

  • Index set. The index set of slot kkk at zzz is
Ik(z)={n∈{1,…,N}:∂fn∂zk(z)≠0∈RM}.I_k(z) = \Big\{ n \in \{1,\dots,N\} : \frac{\partial f_n}{\partial z_k}(z) \neq 0 \in \mathbb R^M \Big\}.Ik​(z)={n∈{1,…,N}:∂zk​∂fn​​(z)=0∈RM}.

This is the set of pixels whose slot-kkk gradient is not the zero vector.

  • Compositionality. fff is compositional if, for every z∈Zz \in \mathcal Zz∈Z and every pair of distinct slots k≠jk \neq jk=j,
Ik(z)∩Ij(z)=∅.I_k(z) \cap I_j(z) = \emptyset.Ik​(z)∩Ij​(z)=∅.
  • Compositional contrast. The compositional contrast at zzz is the real number
Ccomp(f,z)=∑n=1N∑k=1K∑j=k+1K∥∂fn∂zk(z)∥2 ∥∂fn∂zj(z)∥2.C_{\mathrm{comp}}(f, z) = \sum_{n=1}^{N} \sum_{k=1}^{K} \sum_{j=k+1}^{K} \Big\| \frac{\partial f_n}{\partial z_k}(z) \Big\|_2 \, \Big\| \frac{\partial f_n}{\partial z_j}(z) \Big\|_2 .Ccomp​(f,z)=n=1∑N​k=1∑K​j=k+1∑K​​∂zk​∂fn​​(z)​2​​∂zj​∂fn​​(z)​2​.

Here ∥v∥2=∑m=1Mvm2\|v\|_2 = \sqrt{\sum_{m=1}^M v_m^2}∥v∥2​=∑m=1M​vm2​​ is the Euclidean norm on RM\mathbb R^MRM. The inner sum runs over slots jjj strictly greater than kkk in the usual order on {1,…,K}\{1,\dots,K\}{1,…,K}.

Assertion. For every such differentiable fff, the following equivalence holds in both directions:

f is compositional  ⟺  Ccomp(f,z)=0 for every z∈(RM)K.f \text{ is compositional} \iff C_{\mathrm{comp}}(f, z) = 0 \text{ for every } z \in (\mathbb R^M)^K.f is compositional⟺Ccomp​(f,z)=0 for every z∈(RM)K.

Degenerate cases. In each of the following cases both sides of the equivalence hold trivially:

  • If K≤1K \le 1K≤1, there are no pairs of distinct slots and the contrast is an empty sum.
  • If N=0N = 0N=0, all index sets are empty and the contrast is an empty sum.
  • If M=0M = 0M=0, every slot gradient is the zero vector in R0\mathbb R^0R0, so all index sets are empty and every norm is 000.
Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 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