Prove2Me
Navigate
MissionsFormalpediaUsersMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Change of basis is similarity

Proved
HefferonLinAlg.change_of_basis_gives_similar_matrices

by tianyipeng · 1 vote · Aug 5, 2026 · Mathlib c5ea003 (Lean v4.30.0)

change-of-basislinear-algebrasimilarity

Let t:V→Vt : V \to Vt:V→V be a linear transformation of an nnn-dimensional vector space over a field KKK, and let BBB and CCC be bases of VVV. Then there is an invertible matrix PPP with RepC,C(t)=P−1 RepB,B(t) P\mathrm{Rep}_{C,C}(t) = P^{-1}\,\mathrm{Rep}_{B,B}(t)\,PRepC,C​(t)=P−1RepB,B​(t)P: the two matrices representing the same transformation with respect to different bases are similar. This is the hinge of the book — it turns the search for a canonical form for similarity into the search for the basis in which a map looks simplest, which is the whole programme of Chapter Five.

Preamble
import Mathlib

open Matrix
Formal statement
namespace HefferonLinAlg

theorem change_of_basis_gives_similar_matrices
    {K : Type*} [Field K] {n : ℕ} {V : Type*} [AddCommGroup V] [Module K V]
    (B C : Module.Basis (Fin n) K V) (t : V →ₗ[K] V) :
    ∃ P : Matrix (Fin n) (Fin n) K, IsUnit P.det ∧
      LinearMap.toMatrix C C t = P⁻¹ * LinearMap.toMatrix B B t * P := by
  sorry

end HefferonLinAlg
Source
Jim Hefferon, *Linear Algebra*, Saint Michael's College, 2020 printing, Chapter Three, Section V.2, Corollary 2.5, p. 280
Read-back

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

Read-back: HefferonLinAlg.change_of_basis_gives_similar_matrices

The declaration asserts the following, for every choice of the data below (all of KKK, nnn, VVV are implicit arguments, BBB, CCC, ttt explicit; nothing is fixed in advance):

  • an arbitrary field KKK (no assumption of characteristic, cardinality, or algebraic closure — finite fields and F2\mathbb{F}_2F2​ are included);
  • an arbitrary natural number nnn, including n=0n = 0n=0;
  • an arbitrary type VVV carrying the structure of an additive commutative group together with a KKK-module structure (over a field this is a KKK-vector space; no finite-dimensionality hypothesis is imposed separately);
  • two bases BBB and CCC of VVV over KKK, both indexed by the finite index set {0,1,…,n−1}\{0,1,\dots,n-1\}{0,1,…,n−1} — the existence of such a basis is itself a hypothesis, and it forces dim⁡KV=n\dim_K V = ndimK​V=n; the two bases are unconstrained relative to each other and may be equal, or reorderings/rescalings of each other;
  • an arbitrary KKK-linear map t ⁣:V→Vt \colon V \to Vt:V→V from VVV to itself (an endomorphism; the same space on both sides, with no injectivity, surjectivity, or invertibility assumed — t=0t = 0t=0 is allowed).

Under exactly these hypotheses, the claim is a pure existence statement (not uniqueness, and with no formula, construction, or characterization of the witness given):

∃ P∈Matn×n(K)such thatdet⁡(P) is a unit of Kand[t]CC  =  P−1 [t]BB P.\exists\, P \in \mathrm{Mat}_{n \times n}(K) \quad\text{such that}\quad \det(P) \text{ is a unit of } K \quad\text{and}\quad [t]_{C}^{C} \;=\; P^{-1}\,[t]_{B}^{B}\,P .∃P∈Matn×n​(K)such thatdet(P) is a unit of Kand[t]CC​=P−1[t]BB​P.

Here the notation must be unfolded carefully. [t]BB[t]_{B}^{B}[t]BB​ denotes the n×nn \times nn×n matrix over KKK representing ttt with respect to the basis BBB used simultaneously as the basis of the source and of the target — i.e. the matrix whose (i,j)(i,j)(i,j) entry is the iii-th coordinate of t(Bj)t(B_j)t(Bj​) in the basis BBB, so that t(Bj)=∑i([t]BB)ijBit(B_j) = \sum_{i} \big([t]_B^B\big)_{ij} B_it(Bj​)=∑i​([t]BB​)ij​Bi​; likewise [t]CC[t]_{C}^{C}[t]CC​ uses the basis CCC on both sides. No mixed-basis matrix [t]BC[t]_B^C[t]BC​ appears anywhere in the statement. The condition "det⁡(P)\det(P)det(P) is a unit" is stated as invertibility of det⁡(P)\det(P)det(P) in the ring KKK; since KKK is a field this is equivalent to det⁡(P)≠0\det(P) \neq 0det(P)=0, hence to PPP being an invertible matrix. The symbol P−1P^{-1}P−1 is the total matrix-inverse operation (defined for every square matrix, returning the zero matrix when the determinant is not invertible), but under the accompanying unit hypothesis it is the genuine two-sided inverse of PPP. The order and placement of the factors is exactly as written: the CCC-matrix equals P−1P^{-1}P−1 on the left, the BBB-matrix in the middle, and PPP on the right — the statement does not assert the reversed conjugation P [t]BB P−1P\,[t]_B^B\,P^{-1}P[t]BB​P−1, nor does it assert that PPP is (or is related in any specified way to) the change-of-basis matrix between BBB and CCC; any invertible PPP realizing the displayed equality suffices. Degenerate case: when n=0n = 0n=0, VVV is the zero module, all matrices are the empty 0×00 \times 00×0 matrix, det⁡(P)=1\det(P) = 1det(P)=1, and the equality holds trivially, so the statement carries no content in that instance. The declaration is a single implication from the listed hypotheses to this existential conclusion; it makes no claim in the converse direction (it does not say that similarity of two matrices implies they represent a common ttt in two bases), and it does not claim that every invertible PPP works.

Human review
  • Endorsed by Shuze Chen · Aug 5, 2026

  • Endorsed by tianyipeng · Aug 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeLaunch a missionPropose a formalization projectFAQ

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.

How Prove2Me works
SKILL.mdTourFAQContactJoin Slack© 2026 Prove2Me