Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.3: identifying content with an invertible encoder

Proved
ContentStyle.invertible_encoder_block_identifies

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

data-augmentationidentifiabilitylatent-variable-modelsself-supervised-learning

Assume the setting and conditions (i)–(iii) of Theorem 4.2 for the true process, with 1≤nc1\le n_c1≤nc​ and 1≤ns1\le n_s1≤ns​. Let g:X→Zg:\mathcal X\to\mathcal Zg:X→Z be a smooth bijection that minimises

LAlign(g)=E(x,x~)∼px,x~∥g(x)1:nc−g(x~)1:nc∥22L_{\mathrm{Align}}(g)=\mathbb E_{(x,\tilde x)\sim p_{x,\tilde x}}\big\|g(x)_{1:n_c}-g(\tilde x)_{1:n_c}\big\|_2^2LAlign​(g)=E(x,x~)∼px,x~​​​g(x)1:nc​​−g(x~)1:nc​​​22​

over all smooth bijections X→Z\mathcal X\to\mathcal ZX→Z. Then ggg block-identifies the true content: g(f(c,s))1:nc=h(c)g(f(c,s))_{1:n_c}=h(c)g(f(c,s))1:nc​​=h(c) on Z\mathcal ZZ for some hhh injective on C\mathcal CC.

Formalization Note The theorem refers to "conditions (i)–(iv) as in Theorem 4.2", but Theorem 4.2 has only conditions (i)–(iii), and those three are assumed here. "Smooth and invertible" is read as a smooth bijection of X\mathcal XX onto Z\mathcal ZZ, and the minimisation is over that class, which contains f−1f^{-1}f−1.

Preamble
import Mathlib
import Definitions.Def_ContentStyle_Basic

open MeasureTheory
open scoped ContDiff
Formal statement
namespace ContentStyle

theorem invertible_encoder_block_identifies {nc ns d : ℕ} (hnc : 1 ≤ nc) (hns : 1 ≤ ns)
    (C : Set (Fin nc → ℝ)) (S : Set (Fin ns → ℝ)) (hZ : IsLatentSpace C S)
    (M : LatentModel nc ns) (f : Latent nc ns → Obs d)
    (hM : IsAugModel C S M) (hi : CondI C S f) (hii : CondII C S M) (hiii : CondIII S M)
    (g : Obs d → Latent nc ns) (hg : IsSmoothInvertible C S f g)
    (hmin : ∀ g' : Obs d → Latent nc ns, IsSmoothInvertible C S f g' →
      alignLoss C S M f g ≤ alignLoss C S M f g') :
    BlockIdentifies C S f (fun x => (g x).1) := by sorry

end ContentStyle
Source
von Kügelgen, Sharma, Gresele, Brendel, Schölkopf, Besserve and Locatello, Self-Supervised Learning with Data Augmentations Provably Isolates Content from Style, NeurIPS 2021, arXiv:2106.04619v4, Section 4.2, Theorem 4.3, eq. (4), p. 6; proof in Appendix A.2, pp. 19-20
Read-back

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

Let nc,ns,dn_c, n_s, dnc​,ns​,d be natural numbers with nc≥1n_c \ge 1nc​≥1 and ns≥1n_s \ge 1ns​≥1. There is no constraint on ddd. A latent is a pair z=(c,s)z = (c, s)z=(c,s) with content c∈Rncc \in \mathbb{R}^{n_c}c∈Rnc​ and style s∈Rnss \in \mathbb{R}^{n_s}s∈Rns​. An observation is a vector in Rd\mathbb{R}^dRd.

For a subset A⊆{1,…,ns}A \subseteq \{1,\dots,n_s\}A⊆{1,…,ns​} of style indices, the following notation is used:

  • sA∈RAs_A \in \mathbb{R}^AsA​∈RA is the restriction of sss to the coordinates in AAA.
  • SA={sA:s∈S}S_A = \{ s_A : s \in S \}SA​={sA​:s∈S} is the image of SSS under this restriction.
  • mergeA(s,t)\mathrm{merge}_A(s, t)mergeA​(s,t), for t∈RAt \in \mathbb{R}^At∈RA, is the style vector that equals ttt on AAA and sss off AAA.

When A=∅A = \emptysetA=∅, RA\mathbb{R}^ARA is a one-point space, and Lebesgue measure on it is the unit point mass.

The data. The theorem takes:

  • Arbitrary sets C⊆RncC \subseteq \mathbb{R}^{n_c}C⊆Rnc​ and S⊆RnsS \subseteq \mathbb{R}^{n_s}S⊆Rns​. Write Z=C×SZ = C \times SZ=C×S.
  • A "latent model" MMM, which is three arbitrary real-valued functions:
    • pz:Rnc×Rns→Rp_z : \mathbb{R}^{n_c}\times\mathbb{R}^{n_s} \to \mathbb{R}pz​:Rnc​×Rns​→R;
    • pAp_ApA​, a real number assigned to each of the 2ns2^{n_s}2ns​ subsets AAA, including ∅\emptyset∅ and the full set;
    • for each AAA, a function qA:RA×RA→Rq_A : \mathbb{R}^A \times \mathbb{R}^A \to \mathbb{R}qA​:RA×RA→R, written qA(a,t)q_A(a, t)qA​(a,t).
  • An arbitrary function f:Rnc×Rns→Rdf : \mathbb{R}^{n_c}\times\mathbb{R}^{n_s} \to \mathbb{R}^df:Rnc​×Rns​→Rd.
  • An arbitrary function g:Rd→Rnc×Rnsg : \mathbb{R}^d \to \mathbb{R}^{n_c}\times\mathbb{R}^{n_s}g:Rd→Rnc​×Rns​.

Smoothness on a set. "Smooth on a set TTT" means the following: every point of TTT has an open neighbourhood UUU and a function that is C∞C^\inftyC∞ on UUU and agrees with the given function on U∩TU \cap TU∩T.

The pair expectation. For a function φ≥0\varphi \ge 0φ≥0 on pairs of latents (possibly taking the value +∞+\infty+∞), define

E[φ]  =  ∑A⊆{1..ns}pA(A)+∫Zpz(z)+∫RAqA(sA,t)+ φ((c,s), (c,mergeA(s,t))) dt dz,\mathbb{E}[\varphi] \;=\; \sum_{A \subseteq \{1..n_s\}} p_A(A)^+ \int_{Z} p_z(z)^+ \int_{\mathbb{R}^A} q_A(s_A, t)^+\, \varphi\big((c,s),\,(c,\mathrm{merge}_A(s,t))\big)\, dt\, dz,E[φ]=A⊆{1..ns​}∑​pA​(A)+∫Z​pz​(z)+∫RA​qA​(sA​,t)+φ((c,s),(c,mergeA​(s,t)))dtdz,

where x+=max⁡(x,0)x^+ = \max(x,0)x+=max(x,0) and z=(c,s)z=(c,s)z=(c,s). All integrals are Lebesgue lower integrals with values in [0,∞][0,\infty][0,∞], so no measurability of φ\varphiφ is required.

The alignment loss. For any g′:Rd→Rnc×Rnsg' : \mathbb{R}^d \to \mathbb{R}^{n_c}\times\mathbb{R}^{n_s}g′:Rd→Rnc​×Rns​, write g′(x)1:ncg'(x)_{1:n_c}g′(x)1:nc​​ for its content (first) component. The loss is

L(g′)=E[ ∥g′(f(z))1:nc−g′(f(z~))1:nc∥22 ]∈[0,∞],L(g') = \mathbb{E}\Big[\, \big\| g'(f(z))_{1:n_c} - g'(f(\tilde z))_{1:n_c} \big\|_2^2 \,\Big] \in [0, \infty],L(g′)=E[​g′(f(z))1:nc​​−g′(f(z~))1:nc​​​22​]∈[0,∞],

where (z,z~)(z, \tilde z)(z,z~) denotes the pair argument.

Hypotheses.

  1. Latent space. C×SC \times SC×S is open in Rnc×Rns\mathbb{R}^{n_c}\times\mathbb{R}^{n_s}Rnc​×Rns​ and is simply connected as a subspace. In particular it is nonempty and path-connected.

  2. Model axioms.

    • pzp_zpz​ is Borel measurable on the whole space.
    • pz≥0p_z \ge 0pz​≥0 on ZZZ, and ∫Zpz+ dλ=1\int_Z p_z^+ \, d\lambda = 1∫Z​pz+​dλ=1.
    • pA(A)≥0p_A(A) \ge 0pA​(A)≥0 for every AAA, and ∑ApA(A)=1\sum_A p_A(A) = 1∑A​pA​(A)=1.
    • For every AAA:
      • (a,t)↦qA(a,t)(a,t) \mapsto q_A(a,t)(a,t)↦qA​(a,t) is measurable;
      • for every a∈SAa \in S_Aa∈SA​ and every ttt, qA(a,t)≥0q_A(a,t) \ge 0qA​(a,t)≥0, and ∫RAqA(a,t)+ dt=1\int_{\mathbb{R}^A} q_A(a,t)^+\,dt = 1∫RA​qA​(a,t)+dt=1;
      • for every s∈Ss \in Ss∈S and every t∈RAt \in \mathbb{R}^At∈RA with mergeA(s,t)∉S\mathrm{merge}_A(s,t) \notin SmergeA​(s,t)∈/S, we have qA(sA,t)=0q_A(s_A, t) = 0qA​(sA​,t)=0.
  3. Condition (i).

    • fff is smooth on ZZZ and injective on ZZZ.
    • The function inv\mathrm{inv}inv is smooth on the image f(Z)f(Z)f(Z). Here inv(x)\mathrm{inv}(x)inv(x) is some chosen z∈Zz \in Zz∈Z with f(z)=xf(z) = xf(z)=x when such a zzz exists, and an unspecified value otherwise.
  4. Condition (ii). pzp_zpz​ is C∞C^\inftyC∞ on ZZZ, and pz>0p_z > 0pz​>0 at Lebesgue-almost every point of ZZZ.

  5. Condition (iii). For every style index l∈{1,…,ns}l \in \{1,\dots,n_s\}l∈{1,…,ns​} there is a subset AAA with all of the following properties:

    • l∈Al \in Al∈A and pA(A)>0p_A(A) > 0pA​(A)>0;
    • qAq_AqA​ is C∞C^\inftyC∞ on SA×SAS_A \times S_ASA​×SA​, a set that need not be open;
    • for every a∈SAa \in S_Aa∈SA​ there is an open set O⊆RAO \subseteq \mathbb{R}^AO⊆RA containing aaa with qA(a,t)>0q_A(a,t) > 0qA​(a,t)>0 for all t∈Ot \in Ot∈O.
  6. ggg is admissible. ggg is smooth on f(Z)f(Z)f(Z), and ggg restricted to f(Z)f(Z)f(Z) is a bijection from f(Z)f(Z)f(Z) onto ZZZ.

  7. Minimality. For every g′g'g′ that is admissible in the sense of hypothesis 6, L(g)≤L(g′)L(g) \le L(g')L(g)≤L(g′), as an inequality in [0,∞][0,\infty][0,∞]. No particular value of L(g)L(g)L(g) is asserted or assumed; for example, it is not assumed to be 000.

Conclusion. The content part of ggg block-identifies the true content. That is, there exists a function h:Rnc→Rnch : \mathbb{R}^{n_c} \to \mathbb{R}^{n_c}h:Rnc​→Rnc​ that is injective on CCC such that

g(f(c,s))1:nc=h(c)for all c∈C, s∈S.g\big(f(c,s)\big)_{1:n_c} = h(c) \qquad \text{for all } c \in C,\ s \in S.g(f(c,s))1:nc​​=h(c)for all c∈C, s∈S.

Nothing further is asserted about hhh. In particular, it is not claimed to be continuous, smooth, surjective onto anything, or invertible beyond injectivity on CCC. Nothing is asserted about ggg outside f(Z)f(Z)f(Z).

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