Rank plus nullity equals the dimension of the domain
ProvedHefferonLinAlg.rank_plus_nullityLet be a linear map of vector spaces over a field , with finite-dimensional. Then the dimension of the range space of plus the dimension of its null space equals the dimension of . Hefferon presents this as the map-level analogue of 'general = particular + homogeneous' for a linear system.
import Mathlib
namespace HefferonLinAlg
theorem rank_plus_nullity
{K V W : Type*} [Field K]
[AddCommGroup V] [Module K V] [FiniteDimensional K V]
[AddCommGroup W] [Module K W] (f : V →ₗ[K] W) :
Module.finrank K (LinearMap.range f) + Module.finrank K (LinearMap.ker f) =
Module.finrank K V := by
sorry
end HefferonLinAlgRead-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back: HefferonLinAlg.rank_plus_nullity
For every field and every pair of types and (at arbitrary universe levels) that are each equipped with the structure of an additive commutative group together with a -module structure, and under the additional standing assumption that is a finite-dimensional -vector space (no finiteness whatsoever is assumed of , which may be infinite-dimensional or zero), the claim is that for every -linear map the equation
holds, where: is the image submodule of and is the kernel submodule of , each regarded as a -module in its own right; each of the three occurrences of is the natural-number-valued rank function Module.finrank (the cardinality of a basis, which by convention returns the junk value for a module that is not finite-dimensional — a case that cannot arise here, since finite-dimensional forces both the kernel, as a submodule of , and the image, as a quotient-like image of , to be finite-dimensional as well); and the sum on the left is ordinary addition of natural numbers, so the equation is an identity in rather than in or a cardinal arithmetic. The statement is universally quantified over , , , all four typeclass structures listed above, the finite-dimensionality hypothesis on , and the map ; there are no other hypotheses, in particular no injectivity, surjectivity, or nondegeneracy assumption on , and no assumption that or is nonzero. Degenerate instances are therefore included: when the assertion reads ; when is the zero map it reads ; when is injective it reads ; and when it likewise reads . Note that the summand order is image-rank first and kernel-rank second, and that the equality is an unconditional equality of the two natural numbers, not an inequality or a bound in either direction. The declaration is stated inside the namespace HefferonLinAlg, and its proof is left as sorry, i.e. the file contains no proof of this claim.
Confirmed by the mission captain (proposal self-audit).