AFTD Auto-Formalizing Theoretical Domains

Matrix.PosSemidef.outer_self_conj

theoremverifiedformalizationimported Lean

Matrix.PosSemidef.outer_self_conj

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Matrix Matrix.PosSemidef in
open BigOperators in
variable {n ๐•œ : Type*} in
variable [RCLike ๐•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open Kronecker in
open scoped ComplexOrder in
variable {m n ๐•œ : Type*} in
variable [Fintype m] [Fintype n] in
variable [RCLike ๐•œ] [dn : DecidableEq n] in
variable {A : Matrix m m ๐•œ} {B : Matrix m m ๐•œ} in
variable (hA : A.PosSemidef) (hB : B.PosSemidef) in
omit dn in
open ComplexConjugate in
theorem Matrix.PosSemidef.outer_self_conj (v : n โ†’ ๐•œ) : PosSemidef (vecMulVec v (conj v))
Formalizes
QuantumInfo, `Matrix.PosSemidef.outer_self_conj`
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 1

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open Matrix Matrix.PosSemidef in
open BigOperators in
variable {n ๐•œ : Type*} in
variable [RCLike ๐•œ] [DecidableEq n] in
open scoped ComplexOrder MatrixOrder in
open Kronecker in
open scoped ComplexOrder in
variable {m n ๐•œ : Type*} in
variable [Fintype m] [Fintype n] in
variable [RCLike ๐•œ] [dn : DecidableEq n] in
variable {A : Matrix m m ๐•œ} {B : Matrix m m ๐•œ} in
variable (hA : A.PosSemidef) (hB : B.PosSemidef) in
omit dn in
open ComplexConjugate in
theorem Matrix.PosSemidef.outer_self_conj (v : n โ†’ ๐•œ) : PosSemidef (vecMulVec v (conj v)) := by
  constructor
  ยท ext
    simp [vecMulVec_apply, mul_comm]
  ยท intro x
    rw [Finsupp.sum_fintype _ _ (by simp)]
    conv =>
      enter [2, 2, i]
      rw [Finsupp.sum_fintype _ _ (by simp)]
    simp_rw [RCLike.star_def,
      vecMulVec_apply, mul_assoc, โ† Finset.mul_sum, โ† mul_assoc, โ† Finset.sum_mul]
    change
      0 โ‰ค (โˆ‘ i : n, conj (x i) * v i) * โˆ‘ i : n, conj (v i) * x i
    have : (โˆ‘ i : n, conj (x i) * v i) =
        (โˆ‘ i : n, conj (conj (v i) * x i)) := by
          simp only [mul_comm (conj (x _)) (v _), map_mul,
          RingHomCompTriple.comp_apply, RingHom.id_apply]
    rw [this, โ† map_sum, โ† RCLike.normSq_eq_conj_mul_self, RCLike.ofReal_nonneg]
    exact RCLike.normSq_nonneg _
See it in the graphDiscuss this resultChallenge it