AFTD Auto-Formalizing Theoretical Domains

HermitianMat.range_le_ker_imp_zero

theoremverifiedformalizationimported Lean

HermitianMat.range_le_ker_imp_zero

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open HermitianMat in
variable {ฮฑ R ๐•œ : Type*} {m n : Type*} in
variable [Star R] [TrivialStar R] in
variable [RCLike ๐•œ] in
variable {d dโ‚‚ : Type*} [Fintype d] [DecidableEq d] [Fintype dโ‚‚] [DecidableEq dโ‚‚] in
theorem HermitianMat.range_le_ker_imp_zero {A : HermitianMat d ๐•œ}
    (h : LinearMap.range A.mat.toEuclideanLin โ‰ค LinearMap.ker A.mat.toEuclideanLin) : A = 0
Formalizes
QuantumInfo, `HermitianMat.range_le_ker_imp_zero`
Lean proof
By Alex Meiburg, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
17 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 81
Used by 1

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open HermitianMat in
variable {ฮฑ R ๐•œ : Type*} {m n : Type*} in
variable [Star R] [TrivialStar R] in
variable [RCLike ๐•œ] in
variable {d dโ‚‚ : Type*} [Fintype d] [DecidableEq d] [Fintype dโ‚‚] [DecidableEq dโ‚‚] in
theorem HermitianMat.range_le_ker_imp_zero {A : HermitianMat d ๐•œ}
    (h : LinearMap.range A.mat.toEuclideanLin โ‰ค LinearMap.ker A.mat.toEuclideanLin) : A = 0 := by
  rw [HermitianMat.ext_iff, mat_zero]
  ext i j
  have hA_sq : (A.mat * A.mat) = 0 := by
    simp_all only [SetLike.le_def, LinearMap.mem_range, LinearMap.mem_ker, forall_exists_index,
      forall_apply_eq_imp_iff]
    simp_all only [โ† Matrix.ext_iff, Matrix.mul_apply, mat_apply, Matrix.zero_apply]
    intro i j
    specialize h ( EuclideanSpace.single j 1 )
    simpa [ Matrix.mulVec, dotProduct ] using congr(WithLp.ofLp $(h) i)
  simp_all only [mat_apply, Matrix.zero_apply]
  replace hA_sq := congr_fun ( congr_fun hA_sq i ) i
  simp_all only [Matrix.mul_apply, mat_apply, Matrix.zero_apply] ;
  -- Since $A$ is Hermitian, we have $A i x * A x i = |A i x|^2$.
  have h_abs : โˆ€ x, (A i x) * (A x i) = โ€–A i xโ€– ^ 2 := by
    intro x; have := A.2
    simp_all only [val_eq_coe, sq] ;
    have := congr_fun ( congr_fun this i ) x
    simp_all only [Matrix.star_apply, mat_apply, RCLike.star_def] ;
    simp only [โ† this, mul_comm, RCLike.norm_conj];
    simp [ โ† sq, RCLike.mul_conj ];
  simp_rw [h_abs] at hA_sq
  norm_cast at hA_sq
  simp_all [Finset.sum_eq_zero_iff_of_nonneg]
See it in the graphDiscuss this resultChallenge it