chars
int64
40
24k
content_type
stringclasses
9 values
id
stringlengths
13
64
source
stringclasses
5 values
subset
stringclasses
31 values
text
stringlengths
40
24k
1,595
leanexplore_declaration
leanexplore:379109
leanexplore_sqlite
leanexplore_declarations
lemma log_kron_diagonal {m n 𝕜 : Type*} [Fintype m] [DecidableEq m] [Fintype n] [DecidableEq n] [RCLike 𝕜] {d₁ : m → ℝ} {d₂ : n → ℝ} (h₁ : ∀ i, 0 < d₁ i) (h₂ : ∀ j, 0 < d₂ j) : (diagonal 𝕜 d₁ ⊗ₖ diagonal 𝕜 d₂).log = (diagonal 𝕜 d₁).log ⊗ₖ 1 + 1 ⊗ₖ (diagonal 𝕜 d₂).log := by have h_eq : (diagonal 𝕜 d...
263
leanexplore_declaration
leanexplore:379110
leanexplore_sqlite
leanexplore_declarations
/-- The logarithm of a Hermitian matrix conjugated by a unitary matrix is the conjugate of the logarithm. -/ lemma log_conj_unitary (A : HermitianMat d 𝕜) (U : Matrix.unitaryGroup d 𝕜) : (A.conj U.val).log = A.log.conj U.val := cfc_conj_unitary _ Real.log U
164
leanexplore_declaration
leanexplore:379111
leanexplore_sqlite
leanexplore_declarations
theorem inner_log_smul_of [NonSingular A] {x : ℝ} (hx : x ≠ 0) : ⟪(x • A).log, B⟫ = Real.log x * B.trace + ⟪A.log, B⟫ := by simp [log_smul hx, inner_add_left]
632
leanexplore_declaration
leanexplore:379112
leanexplore_sqlite
leanexplore_declarations
lemma log_kron_diagonal_with_proj {f : d → ℝ} {g : d₂ → ℝ} : (diagonal 𝕜 f ⊗ₖ diagonal 𝕜 g).log = (diagonal 𝕜 f).log ⊗ₖ (diagonal 𝕜 g).supportProj + (diagonal 𝕜 f).supportProj ⊗ₖ (diagonal 𝕜 g).log := by have h_diag_kron : (diagonal 𝕜 f ⊗ₖ diagonal 𝕜 g).log = diagonal 𝕜 (fun i ↦ Real.log (f i.1 ...
689
leanexplore_declaration
leanexplore:379113
leanexplore_sqlite
leanexplore_declarations
/-- Generalization of `HermitianMat.log_kron` for possibly singular matrices. -/ lemma log_kron_with_proj : (A ⊗ₖ B).log = A.log ⊗ₖ B.supportProj + A.supportProj ⊗ₖ B.log := by obtain ⟨UA, DA, rfl⟩ : ∃ UA : Matrix.unitaryGroup d 𝕜, ∃ DA, A = (diagonal 𝕜 DA).conj UA.val := ⟨_, _, eq_conj_diagonal A⟩ obtain ⟨UB...
297
leanexplore_declaration
leanexplore:379114
leanexplore_sqlite
leanexplore_declarations
/-- The matrix logarithm of the Kronecker product of two nonsingular Hermitian matrices is the sum of the Kronecker products of their logarithms with the identity matrix. -/ theorem log_kron [NonSingular A] [NonSingular B] : (A ⊗ₖ B).log = A.log ⊗ₖ 1 + 1 ⊗ₖ B.log := by simp [log_kron_with_proj]
188
leanexplore_declaration
leanexplore:379115
leanexplore_sqlite
leanexplore_declarations
theorem isUnit_smul {c : R} (hA : IsUnit c) {M : Matrix d d S} (hM : IsUnit M) : IsUnit (c • M : Matrix d d S) := by obtain ⟨d, rfl⟩ := hA obtain ⟨M', rfl⟩ := hM use d • M' rfl
154
leanexplore_declaration
leanexplore:379116
leanexplore_sqlite
leanexplore_declarations
theorem isUnit_natCast {n : ℕ} (hn : n ≠ 0) [CharZero F] : IsUnit (n : Matrix d d F) := by exact (IsUnit.mk0 (n : F) (mod_cast hn)).map (algebraMap F _)
146
leanexplore_declaration
leanexplore:379117
leanexplore_sqlite
leanexplore_declarations
theorem isUnit_real_smul {r : ℝ} (hr : r ≠ 0) {M : Matrix d d 𝕜} (hM : IsUnit M) : IsUnit (r • M : Matrix d d 𝕜) := isUnit_smul hr.isUnit hM
122
leanexplore_declaration
leanexplore:379118
leanexplore_sqlite
leanexplore_declarations
theorem isUnit_real_cast {r : ℝ} (hr : r ≠ 0) : IsUnit (r • 1 : Matrix d d 𝕜) := by exact isUnit_real_smul hr isUnit_one
77
leanexplore_declaration
leanexplore:379119
leanexplore_sqlite
leanexplore_declarations
class NonSingular (A : HermitianMat n R) : Prop where isUnit : IsUnit A.mat
96
leanexplore_declaration
leanexplore:379120
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem isUnit_mat_of_nonSingular [NonSingular A] : IsUnit A.mat := NonSingular.isUnit
119
leanexplore_declaration
leanexplore:379121
leanexplore_sqlite
leanexplore_declarations
theorem nonsingular_iff_isUnit : NonSingular A ↔ IsUnit A.mat := by exact Iff.intro (fun h ↦ h.isUnit) NonSingular.mk
102
leanexplore_declaration
leanexplore:379122
leanexplore_sqlite
leanexplore_declarations
instance instHasInv_of_invertible [i : Invertible A.mat] : NonSingular A := ⟨isUnit_of_invertible _⟩
97
leanexplore_declaration
leanexplore:379123
leanexplore_sqlite
leanexplore_declarations
instance instInvertible_of_hasInv [h : NonSingular A] : Invertible A.mat := h.isUnit.invertible
96
leanexplore_declaration
leanexplore:379124
leanexplore_sqlite
leanexplore_declarations
instance : NonSingular (1 : HermitianMat n R) := instHasInv_of_invertible (i := invertibleOne)
82
leanexplore_declaration
leanexplore:379125
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_of_posDef (hA : A.mat.PosDef) : NonSingular A := ⟨hA.isUnit⟩
206
leanexplore_declaration
leanexplore:379126
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_posDef_of_PSD (hA : 0 ≤ A) : NonSingular A ↔ A.mat.PosDef := by refine ⟨fun h ↦ ?_, fun hA₂ ↦ nonSingular_of_posDef hA₂⟩ have : IsUnit A.mat := h.isUnit grind [zero_le_iff]
128
leanexplore_declaration
leanexplore:379127
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_smul [i : NonSingular A] {c : ℝ} (hc : IsUnit c) : NonSingular (c • A) := ⟨Matrix.isUnit_smul hc i.isUnit⟩
145
leanexplore_declaration
leanexplore:379128
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_zero_notMem_spectrum : NonSingular A ↔ 0 ∉ spectrum ℝ A.mat := by simp [nonsingular_iff_isUnit, spectrum, resolventSet]
179
leanexplore_declaration
leanexplore:379129
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_eigenvalue_ne_zero : NonSingular A ↔ ∀ i, A.H.eigenvalues i ≠ 0 := by simp [nonSingular_iff_zero_notMem_spectrum, A.H.spectrum_real_eq_range_eigenvalues]
135
leanexplore_declaration
leanexplore:379130
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_det_ne_zero : NonSingular A ↔ A.mat.det ≠ 0 := by simp [Matrix.isUnit_iff_isUnit_det, nonsingular_iff_isUnit]
1,116
leanexplore_declaration
leanexplore:379131
leanexplore_sqlite
leanexplore_declarations
theorem 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 ...
714
leanexplore_declaration
leanexplore:379132
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_support_top : NonSingular A ↔ A.support = ⊤ := by simp only [support, Submodule.eq_top_iff'] refine ⟨fun hA ↦ ?_, fun hA ↦ ?_⟩ · intro x have hA_inv : IsUnit A.mat := hA.isUnit rcases hA_inv.exists_right_inv with ⟨y, hy⟩ exact ⟨WithLp.toLp 2 (y.mulVec x.ofLp), by apply Pi...
129
leanexplore_declaration
leanexplore:379133
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_iff_neg : NonSingular (-A) ↔ NonSingular A := by simp [nonSingular_iff_det_ne_zero, Matrix.det_neg]
169
leanexplore_declaration
leanexplore:379134
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_iff_inv : NonSingular (A⁻¹) ↔ NonSingular A := by rw [nonsingular_iff_isUnit, nonsingular_iff_isUnit] exact Matrix.isUnit_nonsing_inv_iff
191
leanexplore_declaration
leanexplore:379135
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_iff_kronecker [Nonempty n] [Nonempty m] : NonSingular (A ⊗ₖ B) ↔ NonSingular A ∧ NonSingular B := by simp [nonSingular_iff_det_ne_zero, Matrix.det_kronecker]
157
leanexplore_declaration
leanexplore:379136
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_iff_conj (hC : IsUnit C) : NonSingular (A.conj C) ↔ NonSingular A := by simp_all [Matrix.isUnit_iff_isUnit_det, nonsingular_iff_isUnit]
298
leanexplore_declaration
leanexplore:379137
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_iff_reindex (e : n ≃ m) : NonSingular (A.reindex e) ↔ NonSingular A := by rw [nonSingular_iff_det_ne_zero, nonSingular_iff_det_ne_zero] rw [reindex_eq_conj, ← Matrix.det_reindex_self e, conj_apply_mat] congr! 2 ext : 2 simp [Matrix.mul_apply, Matrix.one_apply]
105
leanexplore_declaration
leanexplore:379138
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_empty [IsEmpty n] : NonSingular A := by rw [Subsingleton.eq_one A] infer_instance
91
leanexplore_declaration
leanexplore:379139
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_det_ne_zero : A.mat.det ≠ 0 := by rwa [← nonSingular_iff_det_ne_zero]
87
leanexplore_declaration
leanexplore:379140
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_ker_bot : A.ker = ⊥ := by rwa [← nonSingular_iff_ker_bot]
99
leanexplore_declaration
leanexplore:379141
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem nonSingular_support_top : A.support = ⊤ := by rwa [← nonSingular_iff_support_top]
77
leanexplore_declaration
leanexplore:379142
leanexplore_sqlite
leanexplore_declarations
instance nonSingular_neg : NonSingular (-A) := by rwa [nonSingular_iff_neg]
78
leanexplore_declaration
leanexplore:379143
leanexplore_sqlite
leanexplore_declarations
instance nonSingular_inv : NonSingular (A⁻¹) := by rwa [nonSingular_iff_inv]
140
leanexplore_declaration
leanexplore:379144
leanexplore_sqlite
leanexplore_declarations
instance nonSingular_kron [Nonempty n] [Nonempty m] : NonSingular (A ⊗ₖ B) := nonSingular_iff_kronecker.mpr ⟨inferInstance, inferInstance⟩
103
leanexplore_declaration
leanexplore:379145
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_conj (hC : IsUnit C) : NonSingular (A.conj C) := by rwa [nonSingular_iff_conj hC]
143
leanexplore_declaration
leanexplore:379146
leanexplore_sqlite
leanexplore_declarations
instance nonSingular_conj_isometry {B : HermitianMat n 𝕜} [NonSingular B] : NonSingular (A.conj B.mat) := by simpa [nonSingular_iff_conj]
116
leanexplore_declaration
leanexplore:379147
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_zero_notMem_spectrum : 0 ∉ spectrum ℝ A.mat := by rwa [← nonSingular_iff_zero_notMem_spectrum]
118
leanexplore_declaration
leanexplore:379148
leanexplore_sqlite
leanexplore_declarations
theorem nonSingular_eigenvalue_ne_zero : ∀ i, A.H.eigenvalues i ≠ 0 := by rwa [← nonSingular_iff_eigenvalue_ne_zero]
198
leanexplore_declaration
leanexplore:379149
leanexplore_sqlite
leanexplore_declarations
/-- The `MatrixOrder` instance for Matrix (the Loewner order) we keep open for HermitianMat, always. -/ instance : PartialOrder (HermitianMat n 𝕜) := inferInstanceAs (PartialOrder (selfAdjoint _))
106
leanexplore_declaration
leanexplore:379150
leanexplore_sqlite
leanexplore_declarations
instance : IsOrderedAddMonoid (HermitianMat n 𝕜) := inferInstanceAs (IsOrderedAddMonoid (selfAdjoint _))
59
leanexplore_declaration
leanexplore:379151
leanexplore_sqlite
leanexplore_declarations
theorem le_iff : A ≤ B ↔ (B - A).mat.PosSemidef := by rfl
76
leanexplore_declaration
leanexplore:379152
leanexplore_sqlite
leanexplore_declarations
theorem zero_le_iff : 0 ≤ A ↔ A.mat.PosSemidef := by rw [le_iff, sub_zero]
182
leanexplore_declaration
leanexplore:379153
leanexplore_sqlite
leanexplore_declarations
theorem le_iff_mulVec_le : A ≤ B ↔ ∀ x, star x ⬝ᵥ A.mat *ᵥ x ≤ star x ⬝ᵥ B.mat *ᵥ x := by simp [le_iff, Matrix.posSemidef_iff_dotProduct_mulVec, B.H.sub A.H, Matrix.sub_mulVec]
139
leanexplore_declaration
leanexplore:379154
leanexplore_sqlite
leanexplore_declarations
instance [DecidableEq n] : ZeroLEOneClass (HermitianMat n 𝕜) where zero_le_one := by rw [zero_le_iff] exact Matrix.PosSemidef.one
84
leanexplore_declaration
leanexplore:379155
leanexplore_sqlite
leanexplore_declarations
theorem lt_iff_posdef : A < B ↔ (B - A).mat.PosSemidef ∧ A ≠ B := lt_iff_le_and_ne
648
leanexplore_declaration
leanexplore:379156
leanexplore_sqlite
leanexplore_declarations
instance : IsStrictOrderedModule ℝ (HermitianMat n 𝕜) where smul_lt_smul_of_pos_left a ha b b₂ hb := by rw [HermitianMat.lt_iff_posdef] at hb ⊢ simp only [← smul_sub, ne_eq, smul_right_inj ha.ne'] exact ⟨hb.left.smul ha.le, hb.right⟩ smul_lt_smul_of_pos_right a ha b b2 hb := by rw [HermitianMat.lt_...
224
leanexplore_declaration
leanexplore:379157
leanexplore_sqlite
leanexplore_declarations
theorem posSemidef_iff_spectrum_Ici [DecidableEq n] (A : HermitianMat n 𝕜) : 0 ≤ A ↔ spectrum ℝ A.mat ⊆ Set.Ici 0 := by rw [zero_le_iff, Matrix.posSemidef_iff_isHermitian_and_spectrum_nonneg] simp [A.H, Set.Ici.eq_1]
165
leanexplore_declaration
leanexplore:379158
leanexplore_sqlite
leanexplore_declarations
theorem posSemidef_iff_spectrum_nonneg [DecidableEq n] (A : HermitianMat n 𝕜) : 0 ≤ A ↔ ∀ x ∈ spectrum ℝ A.mat, 0 ≤ x := by exact A.posSemidef_iff_spectrum_Ici
119
leanexplore_declaration
leanexplore:379159
leanexplore_sqlite
leanexplore_declarations
theorem trace_nonneg (hA : 0 ≤ A) : 0 ≤ A.trace := by exact (RCLike.nonneg_iff.mp (zero_le_iff.mp hA).trace_nonneg).1
315
leanexplore_declaration
leanexplore:379160
leanexplore_sqlite
leanexplore_declarations
theorem trace_pos (hA : 0 < A) : 0 < A.trace := by open ComplexOrder in have hA' := hA.le rw [HermitianMat.zero_le_iff] at hA' have h_pos := Matrix.PosSemidef.trace_pos hA' (by simpa [HermitianMat.ext_iff] using hA.ne') rw [HermitianMat.trace_eq_re_trace] rw [RCLike.pos_iff] at h_pos exact h_pos.left
513
leanexplore_declaration
leanexplore:379161
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.trace`: nonneg when the matrix is nonneg, positive when the matrix is positive. -/ @[positivity HermitianMat.trace _] meta def evalHermitianMatTrace : PositivityExt where eval {_u _α} _zα _pα e := do let .app _tr (A : Expr) ← whnfR e | throwError "not HermitianMat.trace" l...
60
leanexplore_declaration
leanexplore:379162
leanexplore_sqlite
leanexplore_declarations
instance : PosSMulMono ℝ (HermitianMat n 𝕜) := inferInstance
60
leanexplore_declaration
leanexplore:379163
leanexplore_sqlite
leanexplore_declarations
instance : SMulPosMono ℝ (HermitianMat n 𝕜) := inferInstance
84
leanexplore_declaration
leanexplore:379164
leanexplore_sqlite
leanexplore_declarations
instance : PosSMulReflectLE ℝ (HermitianMat n 𝕜) := PosSMulMono.toPosSMulReflectLE
341
leanexplore_declaration
leanexplore:379165
leanexplore_sqlite
leanexplore_declarations
theorem le_trace_smul_one [DecidableEq n] (hA : 0 ≤ A) : A ≤ A.trace • 1 := by have hA' : A.mat.PosSemidef := zero_le_iff.mp hA refine (Matrix.PosSemidef.le_smul_one_of_eigenvalues_iff hA'.1 A.trace).mp ?_ rw [← A.sum_eigenvalues_eq_trace] intro i exact Finset.single_le_sum (fun j _ ↦ hA'.eigenvalues_nonneg j...
288
leanexplore_declaration
leanexplore:379166
leanexplore_sqlite
leanexplore_declarations
/-- The Kronecker product of two nonnegative Hermitian matrices is nonnegative. -/ theorem kronecker_nonneg {A : HermitianMat m 𝕜} (hA : 0 ≤ A) (hB : 0 ≤ B) : 0 ≤ A ⊗ₖ B := by rw [zero_le_iff, kronecker_mat] classical exact (zero_le_iff.mp hA).PosSemidef_kronecker (zero_le_iff.mp hB)
393
leanexplore_declaration
leanexplore:379167
leanexplore_sqlite
leanexplore_declarations
/-- The Kronecker product of two positive Hermitian matrices is positive. -/ theorem kronecker_pos {A : HermitianMat m 𝕜} (hA : 0 < A) (hB : 0 < B) : 0 < A ⊗ₖ B := by apply lt_of_le_of_ne (kronecker_nonneg hA.le hB.le) intro h replace h := congr(trace $h) simp only [trace_zero, trace_kronecker, zero_eq_mul] at...
99
leanexplore_declaration
leanexplore:379168
leanexplore_sqlite
leanexplore_declarations
theorem posSemidef_to_nonneg {A : Matrix n n 𝕜} (hA : A.PosSemidef) : 0 ≤ A := by exact hA.nonneg
193
leanexplore_declaration
leanexplore:379169
leanexplore_sqlite
leanexplore_declarations
theorem posDef_to_pos {A : Matrix n n 𝕜} (hA : A.PosDef) [Nonempty n] : 0 < A := by apply lt_of_le_of_ne hA.posSemidef.nonneg rintro rfl classical simpa [Matrix.det_zero] using hA.det_pos
2,109
leanexplore_declaration
leanexplore:379170
leanexplore_sqlite
leanexplore_declarations
/-- Given an expression `e` (a matrix) and a proof expression `p` whose type may be `Matrix.PosSemidef A`, `Matrix.PosDef A`, or `And P Q` (syntactically), attempt to find a proof of nonnegativity or positivity for `e`. Only syntactic matching on the head constant is used; `isDefEq` is used only to compare the matrix a...
780
leanexplore_declaration
leanexplore:379171
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `Matrix`: looks for `A.PosSemidef` or `A.PosDef` in the local context (including syntactic `And` conjunctions) to prove `0 ≤ A` or `0 < A`. -/ @[positivity (_ : HermitianMat _ _)] meta def evalMatrixPSD : PositivityExt where eval {_u _α} _zα _pα e := do let lctx ← getLCtx let mut best :...
88
leanexplore_declaration
leanexplore:379172
leanexplore_sqlite
leanexplore_declarations
theorem mat_posSemidef_to_nonneg (hA : A.mat.PosSemidef) : 0 ≤ A := zero_le_iff.mpr hA
97
leanexplore_declaration
leanexplore:379173
leanexplore_sqlite
leanexplore_declarations
theorem mat_posDef_to_pos [Nonempty n] (hA : A.mat.PosDef) : 0 < A := by exact posDef_to_pos hA
2,444
leanexplore_declaration
leanexplore:379174
leanexplore_sqlite
leanexplore_declarations
/-- Given an expression `e` (a `HermitianMat`) and a proof expression `p` whose type may be `Matrix.PosSemidef A.mat`, `Matrix.PosDef A.mat`, or `And P Q` (syntactically), attempt to find a proof of nonnegativity or positivity for `e`. Only syntactic matching on the head constant is used; `isDefEq` is used only to comp...
878
leanexplore_declaration
leanexplore:379175
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat`: looks for `A.mat.PosSemidef` or `A.mat.PosDef` in the local context (including syntactic `And` conjunctions) to prove `0 ≤ A` or `0 < A`. -/ @[positivity (_ : HermitianMat _ _)] meta def evalHermitianMatPSD : PositivityExt where eval {_u _α} _zα _pα e := do trace[Tactic.po...
710
leanexplore_declaration
leanexplore:379176
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.kronecker`: nonneg when both factors are. -/ @[positivity HermitianMat.kronecker _ _] meta def evalHermitianMatKronecker : PositivityExt where eval {_u _α} _zα _pα e := do let .app (.app _kron A) B ← whnfR e | throwError "not HermitianMat.kronecker" let (isStrictA, pfA) ← ...
224
leanexplore_declaration
leanexplore:379177
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.conj`: nonneg when the inner matrix is. -/ theorem conj_nonneg (hA : 0 ≤ A) : 0 ≤ A.conj M := by rw [zero_le_iff] at hA ⊢ exact Matrix.PosSemidef.mul_mul_conjTranspose_same hA M
235
leanexplore_declaration
leanexplore:379178
leanexplore_sqlite
leanexplore_declarations
theorem conj_pos [DecidableEq n] {A : HermitianMat n 𝕜} {M : Matrix m n 𝕜} (hA : 0 < A) (h : LinearMap.ker M.toEuclideanLin ≤ A.ker) : 0 < A.conj M := by classical exact (A.conj_nonneg M hA.le).lt_of_ne' (A.conj_ne_zero hA.ne' h)
484
leanexplore_declaration
leanexplore:379179
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.conj`: nonneg when the inner matrix is. -/ @[positivity HermitianMat.conj _ _] meta def evalHermitianMatConj : PositivityExt where eval {_u _α} _zα _pα e := do let .app (.app _coe conjM) (A : Expr) ← whnfR e | throwError "not conj application" let M := conjM.appArg! let ...
191
leanexplore_declaration
leanexplore:379180
leanexplore_sqlite
leanexplore_declarations
theorem convex_cone (hA : 0 ≤ A) (hB : 0 ≤ B) {c₁ c₂ : ℝ} (hc₁ : 0 ≤ c₁) (hc₂ : 0 ≤ c₂) : 0 ≤ (c₁ • A + c₂ • B) := by rw [zero_le_iff] at hA hB ⊢ exact (hA.smul hc₁).add (hB.smul hc₂)
181
leanexplore_declaration
leanexplore:379181
leanexplore_sqlite
leanexplore_declarations
theorem sq_nonneg [DecidableEq n] : 0 ≤ A ^ 2 := by simp [zero_le_iff, pow_two] nth_rewrite 1 [←Matrix.IsHermitian.eq A.H] exact Matrix.posSemidef_conjTranspose_mul_self A.mat
371
leanexplore_declaration
leanexplore:379182
leanexplore_sqlite
leanexplore_declarations
theorem ker_antitone [DecidableEq n] (hA : 0 ≤ A) : A ≤ B → B.ker ≤ A.ker := by intro h x hB replace h := (le_iff_mulVec_le.mp h) x rw [HermitianMat.mem_ker_iff_mulVec_zero] at hB ⊢ rw [hB, dotProduct_zero] at h rw [zero_le_iff] at hA rw [← hA.dotProduct_mulVec_zero_iff] rw [Matrix.posSemidef_iff_dotProdu...
298
leanexplore_declaration
leanexplore:379183
leanexplore_sqlite
leanexplore_declarations
theorem conj_mono (h : A ≤ B) : A.conj M ≤ B.conj M := by have h_conj_pos : (M * (B - A).mat * Mᴴ).PosSemidef := Matrix.PosSemidef.mul_mul_conjTranspose_same h M constructor; · simp [conj, Matrix.IsHermitian, Matrix.mul_assoc] · simpa [Matrix.mul_sub, Matrix.sub_mul] using h_conj_pos.2
591
leanexplore_declaration
leanexplore:379184
leanexplore_sqlite
leanexplore_declarations
lemma conj_posDef [DecidableEq n] (hA : A.mat.PosDef) (hN : IsUnit N) : (A.conj N).mat.PosDef := by rw [Matrix.posDef_iff_dotProduct_mulVec] at hA ⊢ use HermitianMat.H _ intro x hx_ne_zero open Matrix in have h_pos : 0 < star (Nᴴ *ᵥ x) ⬝ᵥ A *ᵥ (Nᴴ *ᵥ x) := by apply hA.2 intro h apply hx_ne_zer...
487
leanexplore_declaration
leanexplore:379185
leanexplore_sqlite
leanexplore_declarations
lemma inv_conj [DecidableEq n] {M : Matrix n n 𝕜} (hM : IsUnit M) : (A.conj M)⁻¹ = A⁻¹.conj (M⁻¹)ᴴ := by have h_inv : (M⁻¹)ᴴ * Mᴴ = 1 := by simp only [Matrix.isUnit_iff_isUnit_det, isUnit_iff_ne_zero, ne_eq] at hM simp [Matrix.conjTranspose_nonsing_inv, hM] ext1 simp only [conj, AddMonoidHom.coe_mk, ...
355
leanexplore_declaration
leanexplore:379186
leanexplore_sqlite
leanexplore_declarations
theorem le_iff_mulVec_le_mulVec (A B : HermitianMat n 𝕜) : A ≤ B ↔ ∀ v : n → 𝕜, star v ⬝ᵥ A.mat *ᵥ v ≤ star v ⬝ᵥ B.mat *ᵥ v := by rw [← sub_nonneg, HermitianMat.zero_le_iff] conv_rhs => enter [v]; rw [← sub_nonneg] have h := (B - A).H simp only [HermitianMat.mat_sub] at h simp [Matrix.posSemidef_iff_dot...
145
leanexplore_declaration
leanexplore:379187
leanexplore_sqlite
leanexplore_declarations
theorem inner_mulVec_nonneg (hA : 0 ≤ A) (v : n → 𝕜) : 0 ≤ star v ⬝ᵥ A.mat *ᵥ v := by rw [le_iff_mulVec_le_mulVec] at hA simpa using hA v
244
leanexplore_declaration
leanexplore:379188
leanexplore_sqlite
leanexplore_declarations
theorem mem_ker_of_inner_mulVec_zero [DecidableEq n] (hA : 0 ≤ A) (v : EuclideanSpace 𝕜 n) (h : star v ⬝ᵥ A.mat *ᵥ v = 0) : v ∈ A.ker := by have := ((zero_le_iff.mp hA).dotProduct_mulVec_zero_iff v).mp h exact congr(WithLp.toLp 2 $this)
751
leanexplore_declaration
leanexplore:379189
leanexplore_sqlite
leanexplore_declarations
theorem ker_add [DecidableEq n] (hA : 0 ≤ A) (hB : 0 ≤ B) : (A + B).ker = A.ker ⊓ B.ker := by have hA' := zero_le_iff.mp hA have hB' := zero_le_iff.mp hB ext v; simp only [Submodule.mem_inf, mem_ker_iff_mulVec_zero] constructor · intro hv have h3 : star v ⬝ᵥ A.mat *ᵥ v + star v ⬝ᵥ B.mat *ᵥ v = 0 := by...
781
leanexplore_declaration
leanexplore:379190
leanexplore_sqlite
leanexplore_declarations
theorem ker_sum [DecidableEq n] (f : ι → HermitianMat n 𝕜) (hf : ∀ i, 0 ≤ f i) : (∑ i, f i).ker = ⨅ i, (f i).ker := by ext v simp only [Submodule.mem_iInf, mem_ker_iff_mulVec_zero] constructor · intro hv i have hfi := zero_le_iff.mp (hf i) rw [← hfi.dotProduct_mulVec_zero_iff] have hge : ∀ j, 0...
973
leanexplore_declaration
leanexplore:379191
leanexplore_sqlite
leanexplore_declarations
theorem ker_conj [DecidableEq n] (hA : 0 ≤ A) (B : Matrix n n 𝕜) : (A.conj B).ker = Submodule.comap (Matrix.toEuclideanLin B.conjTranspose) A.ker := by ext v; simp [HermitianMat.conj]; constructor <;> intro h; · have := Matrix.PosSemidef.dotProduct_mulVec_zero_iff ( show Matrix.PosSemidef A.mat from zero_le...
170
leanexplore_declaration
leanexplore:379192
leanexplore_sqlite
leanexplore_declarations
theorem ker_le_of_le_smul {α : ℝ} [DecidableEq n] (hα : α ≠ 0) (hA : 0 ≤ A) (hAB : A ≤ α • B) : B.ker ≤ A.ker := by rw [← ker_pos_smul B hα] exact ker_antitone hA hAB
203
leanexplore_declaration
leanexplore:379193
leanexplore_sqlite
leanexplore_declarations
/-- If a HermitianMat is PSD, then its eigenvalues are nonneg. -/ theorem eigenvalues_nonneg [DecidableEq n] (hA : 0 ≤ A) (i : n) : 0 ≤ A.H.eigenvalues i := (zero_le_iff.mp hA).eigenvalues_nonneg i
188
leanexplore_declaration
leanexplore:379194
leanexplore_sqlite
leanexplore_declarations
/-- If a HermitianMat is PSD, its underlying matrix is nonneg in the Loewner order. -/ theorem mat_nonneg (hA : 0 ≤ A) : 0 ≤ A.mat := Matrix.nonneg_iff_posSemidef.mpr (zero_le_iff.mp hA)
142
leanexplore_declaration
leanexplore:379195
leanexplore_sqlite
leanexplore_declarations
/-- If a HermitianMat is positive, its underlying matrix is positive in the Loewner order. -/ theorem mat_pos (hA : 0 < A) : 0 < A.mat := hA
275
leanexplore_declaration
leanexplore:379196
leanexplore_sqlite
leanexplore_declarations
/-- `Mᴴ * M` is nonneg in the Loewner order, for any matrix `M`. -/ theorem _root_.Matrix.nonneg_conjTranspose_mul_self {m : Type*} [Fintype m] (M : Matrix m n 𝕜) : 0 ≤ M.conjTranspose * M := Matrix.nonneg_iff_posSemidef.mpr (Matrix.posSemidef_conjTranspose_mul_self M)
275
leanexplore_declaration
leanexplore:379197
leanexplore_sqlite
leanexplore_declarations
/-- `M * Mᴴ` is nonneg in the Loewner order, for any matrix `M`. -/ theorem _root_.Matrix.nonneg_self_mul_conjTranspose {m : Type*} [Fintype m] (M : Matrix n m 𝕜) : 0 ≤ M * M.conjTranspose := Matrix.nonneg_iff_posSemidef.mpr (Matrix.posSemidef_self_mul_conjTranspose M)
139
leanexplore_declaration
leanexplore:379198
leanexplore_sqlite
leanexplore_declarations
theorem subtype_mk_nonneg {M : Matrix m m 𝕜} (h : 0 ≤ M) : 0 ≤ (⟨M, (Matrix.LE.le.posSemidef h).isHermitian⟩ : HermitianMat m 𝕜) := h
139
leanexplore_declaration
leanexplore:379199
leanexplore_sqlite
leanexplore_declarations
theorem subtype_mk_pos {M : Matrix m m 𝕜} (h : 0 < M) : 0 < (⟨M, (Matrix.LE.le.posSemidef h.le).isHermitian⟩ : HermitianMat m 𝕜) := h
467
leanexplore_declaration
leanexplore:379200
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `A.mat` where `A : HermitianMat`: nonneg when `0 ≤ A`. -/ @[positivity HermitianMat.mat _] meta def evalHermitianMatMat : PositivityExt where eval {_u _α} _zα _pα e := do let .app _matFn (A : Expr) ← whnfR e | throwError "not HermitianMat.mat" match ← bestResult A with | (true, pa) =>...
588
leanexplore_declaration
leanexplore:379201
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `A.mat` where `A : HermitianMat`: nonneg when `0 ≤ A`. -/ @[positivity Subtype.val (_ : HermitianMat _ _)] meta def evalHermitianMatVal : PositivityExt where eval {_u _α} _zα _pα e := do /- Note: we must not call `whnf` on `e` because `Subtype.val` is a structure projection (reducible),...
447
leanexplore_declaration
leanexplore:379202
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `M * Mᴴ` as a Matrix: always nonneg. -/ @[positivity HMul.hMul _ (Matrix.conjTranspose _)] meta def evalMatrixSelfMulConjTranspose : PositivityExt where eval {_u _α} _zα _pα e := do let .app (.app _hmul _M) Mstar ← whnfR e | throwError "not HMul application" let .app _conjTranspose M' ←...
447
leanexplore_declaration
leanexplore:379203
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `Mᴴ * M` as a Matrix: always nonneg. -/ @[positivity HMul.hMul (Matrix.conjTranspose _) _] meta def evalMatrixConjTransposeMulSelf : PositivityExt where eval {_u _α} _zα _pα e := do let .app (.app _hmul Mstar) _M ← whnfR e | throwError "not HMul application" let .app _conjTranspose M' ←...
531
leanexplore_declaration
leanexplore:379204
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `⟨M, (pf : M.IsHermitian)⟩` as a HermitianMat: equivalent to `0 ≤ M` in `MatrixOrder`. -/ @[positivity (Subtype.mk _ _ : HermitianMat _ _)] meta def evalHermitianMatMk : PositivityExt where eval {_u _α} _zα _pα e := do let .app (.app _mkFn val) _proof ← whnfR e | throwError "not Subtype.m...
806
leanexplore_declaration
leanexplore:379205
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for eigenvalues of a Matrix: `0 ≤ (_ : M.IsHermitian).eigenvalues i`. Will try to prove `0 ≤ M` in the `MatrixOrder`. If the proof is `A.H`, i.e. M comes from a HermitianMat, this will give `0 ≤ A.mat` which becomes `0 ≤ A` later. -/ @[positivity Matrix.IsHermitian.eigenvalues _ _] meta def eva...
684
leanexplore_declaration
leanexplore:379206
leanexplore_sqlite
leanexplore_declarations
/-- Given a Submodule (EuclideanSpace ...) to HermitianMat, this gives the projector onto that subspace, i.e. a matrix that squares to itself, preserves vectors in the submodule, and zeroes out anything in the orthogonal complement of that submodule. -/ noncomputable def projector (S : Submodule 𝕜 (EuclideanSpace 𝕜 n...
184
leanexplore_declaration
leanexplore:379207
leanexplore_sqlite
leanexplore_declarations
theorem projector_add_orthogonal : projector S + projector Sᗮ = 1 := by unfold projector; erw [ Subtype.mk_eq_mk ]; ext i j; simp [ LinearMap.toMatrix_apply, Matrix.one_apply ] ;
745
leanexplore_declaration
leanexplore:379208
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_projector : (projector S).trace = (Module.finrank 𝕜 S : ℝ) := by suffices h_trace : ((S.subtype ∘ₗ S.orthogonalProjection).toMatrix (EuclideanSpace.basisFun n 𝕜).toBasis (EuclideanSpace.basisFun n 𝕜).toBasis).trace = Module.finrank 𝕜 S by simp [projector, trace_eq_re_trace, h_trace] su...