Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1, eq. (8): the linear system for fff at an input xxx

Proved
LinearIdentifiability.f_linear_system

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

identifiabilitylinear-algebrarepresentation-learningsoftmax-models

Let pDp_{\mathcal D}pD​ be a data distribution, let (f′,g′)(f',g')(f′,g′) and (f∗,g∗)(f^*,g^*)(f∗,g∗) be models of the form (1) with p′=p∗p'=p^*p′=p∗ on the data, and fix an input xxx. Suppose there are MMM tuples (yA(i),yB(i))(y_A^{(i)},y_B^{(i)})(yA(i)​,yB(i)​), i=1,…,Mi=1,\dots,Mi=1,…,M, such that for each iii both 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 such that the matrices L′L'L′ and 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 (the diversity condition at xxx). Then

L′⊤f′(x)=L∗⊤f∗(x),f′(x)=(L∗L′−1)⊤f∗(x),L'^\top f'(x)=L^{*\top}f^*(x),\qquad f'(x)=(L^*L'^{-1})^\top f^*(x),L′⊤f′(x)=L∗⊤f∗(x),f′(x)=(L∗L′−1)⊤f∗(x),

and (L∗L′−1)⊤(L^*L'^{-1})^\top(L∗L′−1)⊤ is invertible.

Formalization Note The paper says the tuples are distinct; this follows from the invertibility of L′L'L′ and is not stated separately. The text after eq. (8) writes A=L∗L′−1A=L^*L'^{-1}A=L∗L′−1 while eq. (8) has the transpose; the statement follows eq. (8).

Preamble
import Mathlib
import Definitions.Def_LinearIdentifiability_Basic

open Matrix
Formal statement
namespace LinearIdentifiability

theorem f_linear_system {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)
    (x : X) (a b : Fin M → Y)
    (hab : ∀ 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) :
    (diffMatrix g' a b)ᵀ *ᵥ f' x = (diffMatrix gstar a b)ᵀ *ᵥ fstar x ∧
      f' x = (diffMatrix gstar a b * (diffMatrix g' a b)⁻¹)ᵀ *ᵥ fstar x ∧
      IsUnit (diffMatrix gstar a b * (diffMatrix g' a b)⁻¹)ᵀ.det := by sorry

end LinearIdentifiability
Source
Roeder, Metz and Kingma, On Linear Identifiability of Learned Representations, arXiv:2007.00810v3 (2020), Section 3.2, diversity condition and proof of Theorem 1, eq. (8), pp. 4-5
Read-back

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

Setting. Let XXX (inputs) and YYY (targets) be arbitrary types, and let M≥0M \ge 0M≥0 be a natural number. M=0M = 0M=0 is allowed.

Data distribution. Let pDp_DpD​ be a 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. Call a pair (x,S)(x, S)(x,S) supported if pD(x,y,S)≠0p_D(x, y, S) \neq 0pD​(x,y,S)=0 for some yyy. The theorem assumes pDp_DpD​ is a data distribution, meaning:

  • pDp_DpD​ has finite support; and
  • for every supported pair (x,S)(x, S)(x,S) and every y∈Yy \in Yy∈Y, pD(x,y,S)≠0  ⟺  y∈Sp_D(x, y, S) \neq 0 \iff y \in SpD​(x,y,S)=0⟺y∈S.

In particular, every supported SSS is nonempty.

Two models. Let 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 be arbitrary functions. For a pair (f,g)(f, g)(f,g), the model probability is

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))​.

The theorem assumes the two 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).

The fixed input and the target tuples. Fix a single input x∈Xx \in Xx∈X. This xxx is not separately assumed to occur in the data. Fix two MMM-tuples of targets a=(a1,…,aM)a = (a_1, \dots, a_M)a=(a1​,…,aM​) and b=(b1,…,bM)b = (b_1, \dots, b_M)b=(b1​,…,bM​) in YYY. Assume that for each index iii there is some finite set S(i)S^{(i)}S(i) such that:

  • (x,S(i))(x, S^{(i)})(x,S(i)) is supported; and
  • ai,bi∈S(i)a_i, b_i \in S^{(i)}ai​,bi​∈S(i).

The set S(i)S^{(i)}S(i) may differ from index to index. When M=0M = 0M=0 this hypothesis is vacuous.

The difference matrices. For a map ggg, 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​). Write L′=Lg′L' = L_{g'}L′=Lg′​ and L∗=Lg∗L^* = L_{g^*}L∗=Lg∗​. Assume both det⁡L′≠0\det L' \neq 0detL′=0 and det⁡L∗≠0\det L^* \neq 0detL∗=0. For M≥1M \ge 1M≥1, this forces ai≠bia_i \neq b_iai​=bi​ for every iii. For M=0M = 0M=0, both matrices are empty with determinant 111.

Conclusion. Under these hypotheses, all three of the following hold.

  1. The two linear systems agree:
(L′)⊤f′(x)=(L∗)⊤f∗(x).(L')^\top f'(x) = (L^*)^\top f^*(x).(L′)⊤f′(x)=(L∗)⊤f∗(x).

Equivalently, for every iii,

(g′(ai)−g′(bi))⊤f′(x)=(g∗(ai)−g∗(bi))⊤f∗(x).\big(g'(a_i) - g'(b_i)\big)^\top f'(x) = \big(g^*(a_i) - g^*(b_i)\big)^\top f^*(x).(g′(ai​)−g′(bi​))⊤f′(x)=(g∗(ai​)−g∗(bi​))⊤f∗(x).
  1. The representation at xxx is recovered linearly:
f′(x)=(L∗(L′)−1)⊤f∗(x),f'(x) = \big(L^* (L')^{-1}\big)^\top f^*(x),f′(x)=(L∗(L′)−1)⊤f∗(x),

where (L′)−1(L')^{-1}(L′)−1 is the genuine inverse of L′L'L′.

  1. The transfer matrix is invertible:
det⁡((L∗(L′)−1)⊤)≠0.\det\Big(\big(L^* (L')^{-1}\big)^\top\Big) \neq 0.det((L∗(L′)−1)⊤)=0.

Scope of the conclusion.

  • All of this is asserted only at the single chosen input xxx.
  • The matrix (L∗(L′)−1)⊤\big(L^*(L')^{-1}\big)^\top(L∗(L′)−1)⊤ depends only on aaa, bbb, g′g'g′ and g∗g^*g∗.
  • Nothing is claimed about other inputs or about g′g'g′ versus g∗g^*g∗.
  • When M=0M = 0M=0, all three statements hold trivially.
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