Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Lemma A.4 - Balancedness along fine-tuning

Proved
FeatureDistortion.BalancednessInvariant

by Minghui · Sep 26, 2026 · Mathlib c5ea003 (Lean v4.30.0)

linear-algebramachine-learningprobability

Notation: n=#{training examples}n = \#\{\text{training examples}\}n=#{training examples}, ddd is the input dimension, kkk the feature dimension, X:Rd→RnX:\mathbb R^d\to\mathbb R^nX:Rd→Rn the data map, YYY the labels, B:Rd→RkB:\mathbb R^d\to\mathbb R^kB:Rd→Rk the features, and v∈Rkv\in\mathbb R^kv∈Rk the head. Adjoint means Euclidean transpose. The loss is L^(v,B)=∥XB⊤v−Y∥2\widehat L(v,B)=\|XB^\top v-Y\|^2L(v,B)=∥XB⊤v−Y∥2, with no normalization. The probability model, when present, is explicitly specified below; deterministic flow statements involve no random data assumption.

For every triple of natural numbers n,d,kn,d,kn,d,k, every continuous real-linear map X:Rd→RnX:\mathbb R^d\to\mathbb R^nX:Rd→Rn, every Y∈RnY\in\mathbb R^nY∈Rn, every v0∈Rkv_0\in\mathbb R^kv0​∈Rk, every continuous real-linear map B0:Rd→RkB_0:\mathbb R^d\to\mathbb R^kB0​:Rd→Rk, and every pair of functions a:R→Rka:\mathbb R\to\mathbb R^ka:R→Rk and F:R→L(Rd,Rk)F:\mathbb R\to\mathcal L(\mathbb R^d,\mathbb R^k)F:R→L(Rd,Rk), assume a(0)=v0a(0)=v_0a(0)=v0​, F(0)=B0F(0)=B_0F(0)=B0​, and that at every real s≥0s\geq0s≥0 the derivatives within [0,∞)[0,\infty)[0,∞) are a˙(s)=−2F(s)X∗(XF(s)∗a(s)−Y)\dot a(s)=-2F(s)X^*(XF(s)^*a(s)-Y)a˙(s)=−2F(s)X∗(XF(s)∗a(s)−Y) and F˙(s)=[x↦−2⟨X∗(XF(s)∗a(s)−Y),x⟩a(s)]\dot F(s)=\bigl[x\mapsto-2\langle X^*(XF(s)^*a(s)-Y),x\rangle a(s)\bigr]F˙(s)=[x↦−2⟨X∗(XF(s)∗a(s)−Y),x⟩a(s)], with the latter derivative in the space of continuous linear maps. Then for every real t≥0t\geq0t≥0, a(t)a(t)T−F(t)F(t)∗=v0v0T−B0B0∗a(t)a(t)^{\mathsf T}-F(t)F(t)^*=v_0v_0^{\mathsf T}-B_0B_0^*a(t)a(t)T−F(t)F(t)∗=v0​v0T​−B0​B0∗​ as endomorphisms of Rk\mathbb R^kRk: for every z∈Rkz\in\mathbb R^kz∈Rk, ⟨a(t),z⟩a(t)−F(t)F(t)∗z=⟨v0,z⟩v0−B0B0∗z\langle a(t),z\rangle a(t)-F(t)F(t)^*z=\langle v_0,z\rangle v_0-B_0B_0^*z⟨a(t),z⟩a(t)−F(t)F(t)∗z=⟨v0​,z⟩v0​−B0​B0∗​z. Adjoints are Euclidean. No normalization or zero initial balance is assumed. Zero dimensions are allowed; for k=0k=0k=0 this is equality of the sole endomorphism of the zero space. The assertion is conditional on these curves and concerns nonnegative times only.

Formalization note: Direct source invariant, without an initial normalization assumption. Source: Kumar, Raghunathan, Jones, Ma, and Liang, Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution, ICLR 2022, https://arxiv.org/pdf/2202.10054v1. Appendix A.2, PDF p. 24, Lemma A.4, equations (A.19)--(A.20). Source-backed parent: Section 3.4, PDF p. 10, Proposition 3.7, equations (3.10)--(3.11); Appendix A.7, PDF pp. 45--47.

Preamble
import Definitions.Def_FeatureDistortion_Model
open MeasureTheory Filter
open scoped Topology
Formal statement
namespace FeatureDistortion
theorem BalancednessInvariant :
  ∀ (n d k : ℕ) (X : Vec d →L[ℝ] Vec n) (Y : Vec n)
    (v₀ : Vec k) (B₀ : Features d k) (γ : Trajectory d k),
    IsFineTuningFlow X Y v₀ B₀ γ →
    ∀ t : ℝ, 0 ≤ t → balance (γ.head t) (γ.features t) = balance v₀ B₀ := by sorry
end FeatureDistortion
Source
Kumar, Raghunathan, Jones, Ma, and Liang, Fine-Tuning can Distort Pretrained Features and Underperform Out-of-Distribution, ICLR 2022, https://arxiv.org/pdf/2202.10054v1. Appendix A.2, PDF p. 24, Lemma A.4, equations (A.19)--(A.20). Source-backed parent: Section 3.4, PDF p. 10, Proposition 3.7, equations (3.10)--(3.11); Appendix A.7, PDF pp. 45--47.
Read-back

What the Lean code literally says, in plain math · gpt-6

For every triple of natural numbers n,d,kn,d,kn,d,k, every continuous real-linear map X:Rd→RnX:\mathbb R^d\to\mathbb R^nX:Rd→Rn, every Y∈RnY\in\mathbb R^nY∈Rn, every v0∈Rkv_0\in\mathbb R^kv0​∈Rk, every continuous real-linear map B0:Rd→RkB_0:\mathbb R^d\to\mathbb R^kB0​:Rd→Rk, and every pair of functions a:R→Rka:\mathbb R\to\mathbb R^ka:R→Rk and F:R→L(Rd,Rk)F:\mathbb R\to\mathcal L(\mathbb R^d,\mathbb R^k)F:R→L(Rd,Rk), assume a(0)=v0a(0)=v_0a(0)=v0​, F(0)=B0F(0)=B_0F(0)=B0​, and that at every real s≥0s\geq0s≥0 the derivatives within [0,∞)[0,\infty)[0,∞) are a˙(s)=−2F(s)X∗(XF(s)∗a(s)−Y)\dot a(s)=-2F(s)X^*(XF(s)^*a(s)-Y)a˙(s)=−2F(s)X∗(XF(s)∗a(s)−Y) and F˙(s)=[x↦−2⟨X∗(XF(s)∗a(s)−Y),x⟩a(s)]\dot F(s)=\bigl[x\mapsto-2\langle X^*(XF(s)^*a(s)-Y),x\rangle a(s)\bigr]F˙(s)=[x↦−2⟨X∗(XF(s)∗a(s)−Y),x⟩a(s)], with the latter derivative in the space of continuous linear maps. Then for every real t≥0t\geq0t≥0, a(t)a(t)T−F(t)F(t)∗=v0v0T−B0B0∗a(t)a(t)^{\mathsf T}-F(t)F(t)^*=v_0v_0^{\mathsf T}-B_0B_0^*a(t)a(t)T−F(t)F(t)∗=v0​v0T​−B0​B0∗​ as endomorphisms of Rk\mathbb R^kRk: for every z∈Rkz\in\mathbb R^kz∈Rk, ⟨a(t),z⟩a(t)−F(t)F(t)∗z=⟨v0,z⟩v0−B0B0∗z\langle a(t),z\rangle a(t)-F(t)F(t)^*z=\langle v_0,z\rangle v_0-B_0B_0^*z⟨a(t),z⟩a(t)−F(t)F(t)∗z=⟨v0​,z⟩v0​−B0​B0∗​z. Adjoints are Euclidean. No normalization or zero initial balance is assumed. Zero dimensions are allowed; for k=0k=0k=0 this is equality of the sole endomorphism of the zero space. The assertion is conditional on these curves and concerns nonnegative times only.

Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Minghui · Sep 27, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me