Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 2: ∼A\sim_A∼A​ and ∼P\sim_P∼P​ are equivalence relations

Proved
IdentifiableVAE.sim_equivalence

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

exponential-familiesidentifiabilitynonlinear-icavariational-autoencoders

Fix a set X⊂RdX\subset\mathbb{R}^dX⊂Rd and consider the parameters θ=(f,Q,T,λ)\theta=(f,Q,T,\lambda)θ=(f,Q,T,λ) whose mixing function f:Rn→Rdf:\mathbb{R}^n\to\mathbb{R}^df:Rn→Rd is injective with image f(Rn)=Xf(\mathbb{R}^n)=Xf(Rn)=X. On this set of parameters, the relation ∼A\sim_A∼A​ of Definition 2 is an equivalence relation, where

θ∼Aθ~  ⟺  ∃A∈GLnk(R), c∈Rnk: T(f−1(x))=A T~(f~−1(x))+c∀x∈X.\theta\sim_A\tilde\theta\iff\exists A\in GL_{nk}(\mathbb{R}),\ c\in\mathbb{R}^{nk}:\ \mathbf T(f^{-1}(x))=A\,\tilde{\mathbf T}(\tilde f^{-1}(x))+c\quad\forall x\in X.θ∼A​θ~⟺∃A∈GLnk​(R), c∈Rnk: T(f−1(x))=AT~(f~​−1(x))+c∀x∈X.

The relation ∼P\sim_P∼P​, which requires in addition that AAA is a block permutation matrix, is also an equivalence relation.

This makes the identifiability classes of Definition 1 well defined.

Formalization Note The paper states the result on all of Θ\ThetaΘ with XXX the common image of the mixing functions. The statement restricts to parameters with a common image XXX, because symmetry fails when two mixing functions have different images.

Preamble
import Mathlib
import Definitions.Def_IdentifiableVAE_Basic

open MeasureTheory
Formal statement
namespace IdentifiableVAE

theorem sim_equivalence {n d m k : ℕ} (X : Set (EuclideanSpace ℝ (Fin d))) :
    Equivalence (fun θ θ' : {θ : Param n d m k // Function.Injective θ.f ∧ Set.range θ.f = X} =>
      SimA θ.1 θ'.1) ∧
    Equivalence (fun θ θ' : {θ : Param n d m k // Function.Injective θ.f ∧ Set.range θ.f = X} =>
      SimP θ.1 θ'.1) := by sorry

end IdentifiableVAE
Source
Khemakhem, Kingma, Monti and Hyvärinen, Variational Autoencoders and Nonlinear ICA: A Unifying Framework, AISTATS 2020, arXiv:1907.04809v4, Appendix B.1, Proposition 2 (proof of Definition 2, eq. (13)), p. 12
Read-back

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

Setting. Fix natural numbers n,d,m,kn, d, m, kn,d,m,k and an arbitrary set X⊆RdX \subseteq \mathbb{R}^dX⊆Rd (Euclidean space). A parameter is a quadruple θ=(f,Q,T,λ)\theta = (f, Q, T, \lambda)θ=(f,Q,T,λ) consisting of:

  • a map f:Rn→Rdf : \mathbb{R}^n \to \mathbb{R}^df:Rn→Rd;
  • functions Qi:R→RQ_i : \mathbb{R} \to \mathbb{R}Qi​:R→R for i∈{1,…,n}i \in \{1,\dots,n\}i∈{1,…,n};
  • functions Ti,j:R→RT_{i,j} : \mathbb{R} \to \mathbb{R}Ti,j​:R→R for i≤ni \le ni≤n, j≤kj \le kj≤k;
  • a map λ:Rm→Rn×k\lambda : \mathbb{R}^m \to \mathbb{R}^{n \times k}λ:Rm→Rn×k, with entries λi,j(u)\lambda_{i,j}(u)λi,j​(u).

The theorem concerns only the collection PX\mathcal{P}_XPX​ of parameters satisfying exactly two conditions: fff is injective, and the image f(Rn)f(\mathbb{R}^n)f(Rn) equals XXX. No other condition is imposed. In particular, none of the following is assumed: measurability, positivity of QiQ_iQi​, integrability, or any condition on λ\lambdaλ.

For θ∈PX\theta \in \mathcal{P}_Xθ∈PX​ and z∈Rnz \in \mathbb{R}^nz∈Rn, write T(z)∈Rnk\mathbf{T}(z) \in \mathbb{R}^{nk}T(z)∈Rnk for the vector with entries T(z)(i,j)=Ti,j(zi)\mathbf{T}(z)_{(i,j)} = T_{i,j}(z_i)T(z)(i,j)​=Ti,j​(zi​), indexed by pairs (i,j)∈{1,…,n}×{1,…,k}(i,j) \in \{1,\dots,n\} \times \{1,\dots,k\}(i,j)∈{1,…,n}×{1,…,k}.

Relation ∼A\sim_A∼A​. For θ=(f,Q,T,λ)\theta = (f, Q, T, \lambda)θ=(f,Q,T,λ) and θ~=(f~,Q~,T~,λ~)\tilde\theta = (\tilde f, \tilde Q, \tilde T, \tilde\lambda)θ~=(f~​,Q~​,T~,λ~), we have θ∼Aθ~\theta \sim_A \tilde\thetaθ∼A​θ~ if and only if there exist an invertible real nk×nknk \times nknk×nk matrix AAA (rows and columns indexed by such pairs) and a vector c∈Rnkc \in \mathbb{R}^{nk}c∈Rnk with the following property. For every z∈Rnz \in \mathbb{R}^nz∈Rn (everywhere, not almost everywhere) there exists z~∈Rn\tilde z \in \mathbb{R}^nz~∈Rn such that

f~(z~)=f(z)andT(z)=A T~(z~)+c.\tilde f(\tilde z) = f(z) \qquad\text{and}\qquad \mathbf{T}(z) = A\,\tilde{\mathbf{T}}(\tilde z) + c .f~​(z~)=f(z)andT(z)=AT~(z~)+c.

Relation ∼P\sim_P∼P​. This is defined identically, except that AAA must additionally be a block permutation matrix. That is, there is a permutation σ\sigmaσ of {1,…,n}\{1,\dots,n\}{1,…,n} such that

A(i,l),(a,b)=0whenever a≠σ(i).A_{(i,l),(a,b)} = 0 \quad \text{whenever } a \neq \sigma(i).A(i,l),(a,b)​=0whenever a=σ(i).

Both relations depend only on fff, TTT (and f~\tilde ff~​, T~\tilde TT~). The components QQQ and λ\lambdaλ play no role.

Claim. The theorem asserts both of the following:

  1. ∼A\sim_A∼A​ is an equivalence relation on PX\mathcal{P}_XPX​, i.e. it is reflexive, symmetric and transitive.
  2. ∼P\sim_P∼P​ is an equivalence relation on PX\mathcal{P}_XPX​.

Edge cases.

  • Empty XXX. Since Rn\mathbb{R}^nRn is nonempty (also for n=0n = 0n=0), f(Rn)f(\mathbb{R}^n)f(Rn) is never empty. If X=∅X = \emptysetX=∅, the class PX\mathcal{P}_XPX​ is empty and the claim holds vacuously.
  • d=0d = 0d=0. Here R0\mathbb{R}^0R0 is a single point, so an injective fff exists only when n=0n = 0n=0. For d=0<nd = 0 < nd=0<n the class is empty.
  • n=0n = 0n=0 or k=0k = 0k=0. The index set of pairs is empty, so AAA is the empty 0×00 \times 00×0 matrix (which is invertible) and ccc is the empty vector. The linear condition is then automatic. Each relation reduces to: for every zzz there is z~\tilde zz~ with f~(z~)=f(z)\tilde f(\tilde z) = f(z)f~​(z~)=f(z). This always holds within PX\mathcal{P}_XPX​, because the two images coincide.
  • Uniqueness of z~\tilde zz~. Since fff and f~\tilde ff~​ are injective with the same image XXX, the point z~\tilde zz~ in the definition always exists and is uniquely determined as z~=f~−1(f(z))\tilde z = \tilde f^{-1}(f(z))z~=f~​−1(f(z)).
Human review
  • Endorsed by Shuze Chen · Nov 24, 2026

    Confirmed by the moderator at approval.

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