AFTD Auto-Formalizing Theoretical Domains

HermitianMat.nonSingular_iff_ker_bot

theoremverifiedformalizationimported Lean

HermitianMat.nonSingular_iff_ker_bot

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open HermitianMat in
variable {n m R ๐•œ : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] in
variable [CommRing R] [StarRing R] [RCLike ๐•œ] in
variable (A : HermitianMat n R) (B : HermitianMat m R) in
variable {A : HermitianMat n ๐•œ} {B : HermitianMat m ๐•œ} {C : Matrix n n ๐•œ} in
open ComplexOrder in
theorem HermitianMat.nonSingular_iff_ker_bot : NonSingular A โ†” A.ker = โŠฅ
Formalizes
QuantumInfo, `HermitianMat.nonSingular_iff_ker_bot`
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 132
Used by 1

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open HermitianMat in
variable {n m R ๐•œ : Type*} [Fintype n] [DecidableEq n] [Fintype m] [DecidableEq m] in
variable [CommRing R] [StarRing R] [RCLike ๐•œ] in
variable (A : HermitianMat n R) (B : HermitianMat m R) in
variable {A : HermitianMat n ๐•œ} {B : HermitianMat m ๐•œ} {C : Matrix n n ๐•œ} in
open ComplexOrder in
theorem HermitianMat.nonSingular_iff_ker_bot : NonSingular A โ†” A.ker = โŠฅ := by
  rw [nonSingular_iff_det_ne_zero];
  have h_det_nonzero_to_ker_trivial : A.mat.det โ‰  0 โ†’ A.ker = โŠฅ := by
    intro h_det_nonzero
    rw [Submodule.eq_bot_iff]
    have h_inv : Invertible A.mat := by
      convert Matrix.invertibleOfDetInvertible A.mat
      exact invertibleOfNonzero h_det_nonzero
    have h_ker_trivial (x : n โ†’ ๐•œ) (hx : A.mat.mulVec x = 0) : x = 0 := by
      simpa using congr_arg (h_inv.1.mulVec) hx
    intro x hx
    rw [mem_ker_iff_mulVec_zero] at hx
    exact PiLp.ext (fun i => congr_fun (h_ker_trivial x.ofLp hx) i)
  refine โŸจh_det_nonzero_to_ker_trivial, fun h h' => ?_โŸฉ
  obtain โŸจx, hxโŸฉ := Matrix.exists_mulVec_eq_zero_iff.mpr h'
  have h_inj : Function.Injective (Matrix.mulVecLin A.mat) := by
    rw [โ† LinearMap.ker_eq_bot, Submodule.eq_bot_iff]
    intro y hy
    rw [LinearMap.mem_ker, Matrix.mulVecLin_apply] at hy
    have hm : (WithLp.toLp 2 y) โˆˆ A.ker := (mem_ker_iff_mulVec_zero A _).mpr hy
    rw [h] at hm
    have := (Submodule.mem_bot (R := ๐•œ)).mp hm
    simpa using this
  specialize @h_inj x 0
  simp_all
See it in the graphDiscuss this resultChallenge it