Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1 (as proved): linear identifiability of fff and affine identifiability of the context map ggg

Proved
LinearIdentifiability.linear_identifiability

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

identifiabilitylinear-algebrarepresentation-learningsoftmax-models

Let pDp_{\mathcal D}pD​ be an empirical data distribution as in Section 2.1, and let (f′,g′)(f',g')(f′,g′) and (f∗,g∗)(f^*,g^*)(f∗,g∗) be two models of the form (1), f:X→RMf:X\to\mathbb R^Mf:X→RM, g:Y→RMg:Y\to\mathbb R^Mg:Y→RM, with p′=p∗p'=p^*p′=p∗ on the data. Assume:

  1. (diversity for fff) there are MMM tuples (yA(i),yB(i))(y_A^{(i)},y_B^{(i)})(yA(i)​,yB(i)​) such that for every input xxx in the data and every iii, yA(i)y_A^{(i)}yA(i)​ and yB(i)y_B^{(i)}yB(i)​ lie in some candidate set SSS with pD(x,S)>0p_{\mathcal D}(x,S)>0pD​(x,S)>0, and the matrices L′L'L′, L∗L^*L∗ with columns g′(yA(i))−g′(yB(i))g'(y_A^{(i)})-g'(y_B^{(i)})g′(yA(i)​)−g′(yB(i)​) and g∗(yA(i))−g∗(yB(i))g^*(y_A^{(i)})-g^*(y_B^{(i)})g∗(yA(i)​)−g∗(yB(i)​) are invertible;
  2. (diversity for ggg) there are M+1M+1M+1 pairs (x(i),S(i))(x^{(i)},S^{(i)})(x(i),S(i)) occurring in the data such that every target yyy in the data lies in every S(i)S^{(i)}S(i), and the matrices M′\mathbf M'M′, M∗\mathbf M^*M∗ with columns f~′(x(i),S(i))\tilde f'(x^{(i)},S^{(i)})f~​′(x(i),S(i)) and f~∗(x(i),S(i))\tilde f^*(x^{(i)},S^{(i)})f~​∗(x(i),S(i)) are invertible.

Then:

  1. there is an invertible M×MM\times MM×M matrix AAA with f′(x)=Af∗(x)f'(x)=Af^*(x)f′(x)=Af∗(x) for every input xxx in the data;
  2. there is an invertible (M+1)×(M+1)(M+1)\times(M+1)(M+1)×(M+1) matrix CCC with g~′(y)=Cg~∗(y)\tilde g'(y)=C\tilde g^*(y)g~​′(y)=Cg~​∗(y) for every target yyy in the data, where g~(y)=[1;g(y)]\tilde g(y)=[1;g(y)]g~​(y)=[1;g(y)];
  3. there are an invertible M×MM\times MM×M matrix BBB and a vector c∈RMc\in\mathbb R^Mc∈RM with g′(y)=Bg∗(y)+cg'(y)=Bg^*(y)+cg′(y)=Bg∗(y)+c for every target yyy in the data.

Thus the representation fff is identifiable up to an invertible linear map, and the context map ggg up to an invertible affine map.

Formalization Note This is Theorem 1 as its proof establishes it, not as printed. (a) The printed conclusion g′=Bg∗g'=Bg^*g′=Bg∗ is false: g′=g∗+cg'=g^*+cg′=g∗+c, f′=f∗f'=f^*f′=f∗ gives p′=p∗p'=p^*p′=p∗ for every constant vector ccc, and the paper's own diversity conditions can hold in that example; the proof's step from AAA to BBB drops the first column of the row-reduction matrix. The proof does establish g~′=Ag~∗\tilde g'=A\tilde g^*g~​′=Ag~​∗, which is stated as conclusion 2. Conclusion 2 alone does not give an invertible M×MM\times MM×M block, so conclusion 3 is stated separately: it follows from eq. (7) at the inputs x(i)x^{(i)}x(i) together with conclusion 1, since the vectors f∗(x(i))f^*(x^{(i)})f∗(x(i)) span RM\mathbb R^MRM when M∗\mathbf M^*M∗ is invertible. The shift ccc cannot be removed. (b) The printed diversity conditions choose the tuples separately for each xxx (resp. each yyy), and then the matrix (L∗L′−1)⊤(L^*L'^{-1})^\top(L∗L′−1)⊤ depends on xxx; with such tuples no single AAA need exist. The proof treats L′,L∗L',L^*L′,L∗ (resp. M′,M∗\mathbf M',\mathbf M^*M′,M∗) as fixed matrices, so the tuples are taken uniform over the data, as stated. (c) The equalities are asserted on the inputs and targets that occur in the data, since p′=p∗p'=p^*p′=p∗ on the data says nothing about f,gf,gf,g elsewhere.

Preamble
import Mathlib
import Definitions.Def_LinearIdentifiability_Basic

open Matrix
Formal statement
namespace LinearIdentifiability

theorem linear_identifiability {X Y : Type*} {M : ℕ}
    (pD : PMF (X × Y × Finset Y)) (hD : IsDataDistribution pD)
    (f' fstar : X → Fin M → ℝ) (g' gstar : Y → Fin M → ℝ)
    (hp : ModelsAgreeOnData pD f' g' fstar gstar)
    (a b : Fin M → Y)
    (hab : ∀ x ∈ inputSupport pD, ∀ i, ∃ S, IsSupported pD x S ∧ a i ∈ S ∧ b i ∈ S)
    (hL' : IsUnit (diffMatrix g' a b).det) (hLstar : IsUnit (diffMatrix gstar a b).det)
    (xs : Fin (M + 1) → X) (Ss : Fin (M + 1) → Finset Y)
    (hxs : ∀ i, IsSupported pD (xs i) (Ss i)) (hcov : ∀ y ∈ targetSupport pD, ∀ i, y ∈ Ss i)
    (hM' : IsUnit (augFMatrix f' g' xs Ss).det) (hMstar : IsUnit (augFMatrix fstar gstar xs Ss).det) :
    (∃ A : Matrix (Fin M) (Fin M) ℝ, IsUnit A.det ∧
        ∀ x ∈ inputSupport pD, f' x = A *ᵥ fstar x) ∧
      (∃ C : Matrix (Fin (M + 1)) (Fin (M + 1)) ℝ, IsUnit C.det ∧
        ∀ y ∈ targetSupport pD, augG g' y = C *ᵥ augG gstar y) ∧
      (∃ (B : Matrix (Fin M) (Fin M) ℝ) (c : Fin M → ℝ), IsUnit B.det ∧
        ∀ y ∈ targetSupport pD, g' y = B *ᵥ gstar y + c) := by sorry

end LinearIdentifiability
Source
Roeder, Metz and Kingma, On Linear Identifiability of Learned Representations, arXiv:2007.00810v3 (2020), Section 3.2, Theorem 1, eq. (4), p. 4; proof on pp. 4-5 and Appendix C, eqs. (9)-(18), pp. 14-15
Read-back

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

Let XXX and YYY be arbitrary types (inputs and targets), and let M∈NM \in \mathbb{N}M∈N be arbitrary, including M=0M = 0M=0. Vectors in RM\mathbb{R}^MRM are indexed by {0,…,M−1}\{0,\dots,M-1\}{0,…,M−1}. Let pDp_DpD​ be any probability mass function on triples (x,y,S)(x, y, S)(x,y,S), where x∈Xx \in Xx∈X, y∈Yy \in Yy∈Y and SSS is a finite subset of YYY. The theorem uses the following auxiliary notions.

  • Supported pair. A pair (x,S)(x,S)(x,S) is supported if pD(x,y,S)≠0p_D(x,y,S) \neq 0pD​(x,y,S)=0 for some y∈Yy \in Yy∈Y.
  • Input support. This is the set
XD={x:(x,S) is supported for some S}.\mathcal{X}_D = \{x : (x,S) \text{ is supported for some } S\}.XD​={x:(x,S) is supported for some S}.
  • Target support. This is the set
YD={y:pD(x,y,S)≠0 for some x,S}.\mathcal{Y}_D = \{y : p_D(x,y,S) \neq 0 \text{ for some } x, S\}.YD​={y:pD​(x,y,S)=0 for some x,S}.
  • Model probability. For maps f:X→RMf : X \to \mathbb{R}^Mf:X→RM and g:Y→RMg : Y \to \mathbb{R}^Mg:Y→RM,
pf,g(y∣x,S)=exp⁡(f(x)⊤g(y))∑y′∈Sexp⁡(f(x)⊤g(y′)).p_{f,g}(y \mid x, S) = \frac{\exp\big(f(x)^\top g(y)\big)}{\sum_{y' \in S} \exp\big(f(x)^\top g(y')\big)}.pf,g​(y∣x,S)=∑y′∈S​exp(f(x)⊤g(y′))exp(f(x)⊤g(y))​.
  • Log-normaliser. This is
Zf,g(x,S)=log⁡∑y′∈Sexp⁡(f(x)⊤g(y′)).Z_{f,g}(x,S) = \log \sum_{y' \in S} \exp\big(f(x)^\top g(y')\big).Zf,g​(x,S)=logy′∈S∑​exp(f(x)⊤g(y′)).
  • Augmented vectors. These are f~f,g(x,S)=(−Zf,g(x,S), f(x))∈RM+1\tilde f_{f,g}(x,S) = \big({-Z_{f,g}(x,S)},\, f(x)\big) \in \mathbb{R}^{M+1}f~​f,g​(x,S)=(−Zf,g​(x,S),f(x))∈RM+1 and g~(y)=(1, g(y))∈RM+1\tilde g(y) = \big(1,\, g(y)\big) \in \mathbb{R}^{M+1}g~​(y)=(1,g(y))∈RM+1. In each case the new coordinate is placed first.

The hypotheses are as follows.

  1. pDp_DpD​ is a data distribution. The support of pDp_DpD​ is finite. Moreover, for every supported pair (x,S)(x,S)(x,S) and every y∈Yy \in Yy∈Y,
pD(x,y,S)≠0  ⟺  y∈S.p_D(x,y,S) \neq 0 \iff y \in S.pD​(x,y,S)=0⟺y∈S.

In particular, every supported SSS is nonempty.

  1. Model maps. There are four maps f′,f∗:X→RMf', f^* : X \to \mathbb{R}^Mf′,f∗:X→RM and g′,g∗:Y→RMg', g^* : Y \to \mathbb{R}^Mg′,g∗:Y→RM.

  2. The models agree on the data. For every supported pair (x,S)(x,S)(x,S) and every y∈Sy \in Sy∈S,

pf′,g′(y∣x,S)=pf∗,g∗(y∣x,S).p_{f',g'}(y \mid x,S) = p_{f^*,g^*}(y \mid x,S).pf′,g′​(y∣x,S)=pf∗,g∗​(y∣x,S).
  1. Target tuples. There are MMM-tuples a=(a0,…,aM−1)a = (a_0,\dots,a_{M-1})a=(a0​,…,aM−1​) and b=(b0,…,bM−1)b = (b_0,\dots,b_{M-1})b=(b0​,…,bM−1​) of elements of YYY. For every x∈XDx \in \mathcal{X}_Dx∈XD​ and every index iii, there is some SSS such that (x,S)(x,S)(x,S) is supported and both ai∈Sa_i \in Sai​∈S and bi∈Sb_i \in Sbi​∈S. The set SSS may depend on both xxx and iii.

  2. Difference matrices. Let LgL_gLg​ be the M×MM \times MM×M real matrix whose iii-th column is g(ai)−g(bi)g(a_i) - g(b_i)g(ai​)−g(bi​). Then both det⁡Lg′≠0\det L_{g'} \neq 0detLg′​=0 and det⁡Lg∗≠0\det L_{g^*} \neq 0detLg∗​=0. When M=0M = 0M=0 these are empty matrices with determinant 111, so the condition holds automatically.

  3. Input tuples. There are (M+1)(M+1)(M+1)-tuples x0,…,xM∈Xx_0,\dots,x_M \in Xx0​,…,xM​∈X and finite sets S0,…,SM⊆YS_0,\dots,S_M \subseteq YS0​,…,SM​⊆Y.

    • Each pair (xi,Si)(x_i, S_i)(xi​,Si​) is supported.
    • Every y∈YDy \in \mathcal{Y}_Dy∈YD​ belongs to every SiS_iSi​.
    • Combined with hypothesis 1, which gives Si⊆YDS_i \subseteq \mathcal{Y}_DSi​⊆YD​, this forces Si=YDS_i = \mathcal{Y}_DSi​=YD​ for every iii. In particular YD\mathcal{Y}_DYD​ must be finite.
  4. Augmented matrices. Let F~f,g\tilde F_{f,g}F~f,g​ be the (M+1)×(M+1)(M+1)\times(M+1)(M+1)×(M+1) real matrix whose iii-th column is f~f,g(xi,Si)\tilde f_{f,g}(x_i,S_i)f~​f,g​(xi​,Si​). Then both det⁡F~f′,g′≠0\det \tilde F_{f',g'} \neq 0detF~f′,g′​=0 and det⁡F~f∗,g∗≠0\det \tilde F_{f^*,g^*} \neq 0detF~f∗,g∗​=0.

    • Each matrix is built with its own pair (f,g)(f,g)(f,g), both inside ZZZ and in the remaining coordinates.
    • When M=0M = 0M=0, each is the 1×11\times 11×1 matrix with entry −log⁡∣S0∣-\log|S_0|−log∣S0​∣. Its determinant is nonzero exactly when ∣S0∣≠1|S_0| \neq 1∣S0​∣=1.

The conclusion is the conjunction of three statements. Nothing relates AAA, CCC, BBB and ccc to one another.

  1. There is an invertible M×MM\times MM×M real matrix AAA such that
f′(x)=A f∗(x)for all x∈XD.f'(x) = A\, f^*(x) \quad \text{for all } x \in \mathcal{X}_D.f′(x)=Af∗(x)for all x∈XD​.
  1. There is an invertible (M+1)×(M+1)(M+1)\times(M+1)(M+1)×(M+1) real matrix CCC such that
(1,g′(y))=C (1,g∗(y))for all y∈YD.\big(1, g'(y)\big) = C\,\big(1, g^*(y)\big) \quad \text{for all } y \in \mathcal{Y}_D.(1,g′(y))=C(1,g∗(y))for all y∈YD​.
  1. There are an invertible M×MM\times MM×M real matrix BBB and a vector c∈RMc \in \mathbb{R}^Mc∈RM such that
g′(y)=B g∗(y)+cfor all y∈YD.g'(y) = B\, g^*(y) + c \quad \text{for all } y \in \mathcal{Y}_D.g′(y)=Bg∗(y)+cfor all y∈YD​.

All three statements are asserted only on the supports XD\mathcal{X}_DXD​ and YD\mathcal{Y}_DYD​, not on all of XXX or YYY. The relation for ggg in the third statement is affine, with a possibly nonzero shift ccc, rather than purely linear.

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