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
152
leanexplore_declaration
leanexplore:379309
leanexplore_sqlite
leanexplore_declarations
lemma sandwich_le_one (hB : B.mat.PosDef) (h : A ≤ B) : (A.conj (B ^ (-1/2 : ℝ)).mat) ≤ 1 := by exact le_trans (conj_mono h) (sandwich_self hB).le
1,008
leanexplore_declaration
leanexplore:379310
leanexplore_sqlite
leanexplore_declarations
lemma rpow_neg_mul_rpow_self (hA : A.mat.PosDef) (p : ℝ) : (A ^ (-p)).mat * (A ^ p).mat = 1 := by have := rpow_inv_eq_neg_rpow hA p; rw [ ← this ]; -- Since $A$ is positive definite, $A^p$ is also positive definite. have h_pos_def : (A ^ p).mat.PosDef := by have h_pos_def : ∀ p : ℝ, A.mat.PosDef → (A ^ ...
554
leanexplore_declaration
leanexplore:379311
leanexplore_sqlite
leanexplore_declarations
lemma isUnit_rpow_toMat (hA : A.mat.PosDef) (p : ℝ) : IsUnit (A ^ p).mat := by have hA_inv : IsUnit (A ^ (-p)).mat := by have hA_inv : (A ^ (-p)).mat * (A ^ p).mat = 1 := by exact rpow_neg_mul_rpow_self hA p exact IsUnit.of_mul_eq_one _ hA_inv -- Since $(A^{-p}) (A^p) = 1$, we have that $(A^p)$ is the...
325
leanexplore_declaration
leanexplore:379312
leanexplore_sqlite
leanexplore_declarations
lemma sandwich_inv (hB : B.mat.PosDef) : (A.conj (B ^ (-1/2 : ℝ)).mat)⁻¹ = A⁻¹.conj (B ^ (1/2 : ℝ)).mat := by have h_inv : (B ^ (-1 / 2 : ℝ)).mat⁻¹ = (B ^ (1 / 2 : ℝ)).mat := by apply Matrix.inv_eq_right_inv rw [← rpow_neg_mul_rpow_self hB (1 / 2), neg_div 2 1] simp [inv_conj (isUnit_rpow_toMat hB _), h...
202
leanexplore_declaration
leanexplore:379313
leanexplore_sqlite
leanexplore_declarations
theorem ker_rpow_eq_of_nonneg {A : HermitianMat d ℂ} (hA : 0 ≤ A) (hp : r ≠ 0): (A ^ r).ker = A.ker := by apply ker_cfc_eq_ker_nonneg hA grind [Real.rpow_eq_zero_iff_of_nonneg, Real.rpow_eq_pow]
190
leanexplore_declaration
leanexplore:379314
leanexplore_sqlite
leanexplore_declarations
theorem ker_rpow_le_of_nonneg {A : HermitianMat d ℂ} (hA : 0 ≤ A) : (A ^ r).ker ≤ A.ker := by apply ker_cfc_le_ker_nonneg hA grind [Real.rpow_eq_zero_iff_of_nonneg, Real.rpow_eq_pow]
241
leanexplore_declaration
leanexplore:379315
leanexplore_sqlite
leanexplore_declarations
lemma conj_kron (A : Matrix d d 𝕜) (B : Matrix d₂ d₂ 𝕜) (C : HermitianMat d 𝕜) (D : HermitianMat d₂ 𝕜) : conj (A ⊗ₖ B) (C ⊗ₖ D) = conj A C ⊗ₖ conj B D := by ext1 simp [conj, Matrix.mul_kronecker_mul, Matrix.conjTranspose_kronecker]
1,013
leanexplore_declaration
leanexplore:379316
leanexplore_sqlite
leanexplore_declarations
lemma rpow_kron {A : HermitianMat d ℂ} {B : HermitianMat d₂ ℂ} (r : ℝ) (hA : 0 ≤ A) (hB : 0 ≤ B) : (A ⊗ₖ B) ^ r = (A ^ r) ⊗ₖ (B ^ r) := by obtain ⟨U, a, ha, hA⟩ : ∃ U : 𝐔[d], ∃ a : d → ℝ, (∀ i, 0 ≤ a i) ∧ A = conj U.val (diagonal ℂ a) := by rw [zero_le_iff] at hA exact ⟨_, _, hA.eigenvalues_nonneg, e...
676
leanexplore_declaration
leanexplore:379318
leanexplore_sqlite
leanexplore_declarations
/-- Joint continuity of matrix rpow for Hermitian matrices with positive exponent -/ @[fun_prop] theorem continuousOn_rpow_joint_nonneg_pos {X : Type*} [TopologicalSpace X] {A : X → HermitianMat d ℂ} {p : X → ℝ} {S : Set X} (hA : ContinuousOn A S) (hp : ContinuousOn p S) (hp_pos : ∀ x ∈ S, 0 < p x) : ...
818
leanexplore_declaration
leanexplore:379319
leanexplore_sqlite
leanexplore_declarations
theorem cfc_sq_rpow_eq_cfc_rpow (A : HermitianMat d ℂ) (hA : 0 ≤ A) (p : ℝ) (hp : 0 < p) : (A ^ 2).cfc (fun x => x ^ (p/2)) = A.cfc (fun x => x ^ p) := by have h_sqrt : (A ^ 2).cfc (fun x => x ^ (p / 2)) = (A.cfc (fun x => x ^ 2)).cfc (fun x => x ^ (p / 2)) := by convert rfl; exact cfc_pow A; rw [ h...
193
leanexplore_declaration
leanexplore:379320
leanexplore_sqlite
leanexplore_declarations
/-- Tr[A^p] = ∑ᵢ λᵢ^p for a Hermitian matrix A. -/ lemma trace_rpow_eq_sum (A : HermitianMat d ℂ) (p : ℝ) : (A ^ p).trace = ∑ i, (A.H.eigenvalues i) ^ p := by exact A.trace_cfc_eq (· ^ p)
290
leanexplore_declaration
leanexplore:379321
leanexplore_sqlite
leanexplore_declarations
/-- Finite integral approximation for the rpow monotonicity proof. Same integrand as `logApprox` but with weight `t ^ q`. -/ noncomputable def rpowApprox (A : HermitianMat d ℂ) (q T : ℝ) : HermitianMat d ℂ := ∫ t in (0)..T, t ^ q • ((1 + t)⁻¹ • (1 : HermitianMat d ℂ) - (A + t • 1)⁻¹)
3,805
leanexplore_declaration
leanexplore:379322
leanexplore_sqlite
leanexplore_declarations
theorem rpowApprox_mono {A B : HermitianMat d ℂ} (hA : A.mat.PosDef) (hB : B.mat.PosDef) (hAB : A ≤ B) (hq : 0 ≤ q) (T : ℝ) (hT : 0 < T) : rpowApprox A q T ≤ rpowApprox B q T := by unfold HermitianMat.rpowApprox have h_integral_mono : ∀ᵐ t ∂Measure.restrict volume (Set.Ioc 0 T), t ^ q • ((1 + t)⁻¹ • (1 : He...
168
leanexplore_declaration
leanexplore:379323
leanexplore_sqlite
leanexplore_declarations
/-- The scalar function underlying rpowApprox via the CFC. -/ noncomputable def scalarRpowApprox (q T x : ℝ) : ℝ := ∫ t in (0)..T, t ^ q * (1 / (1 + t) - 1 / (x + t))
2,987
leanexplore_declaration
leanexplore:379324
leanexplore_sqlite
leanexplore_declarations
theorem rpowApprox_eq_cfc_scalar (A : HermitianMat d ℂ) (hA : A.mat.PosDef) (q T : ℝ) (hq : 0 ≤ q) (hT : 0 < T) : rpowApprox A q T = A.cfc (scalarRpowApprox q T) := by have rpowApprox_eq_cfc_scalar : ∀ t ∈ Set.Ioc 0 T, t ^ q • ((1 + t)⁻¹ • (1 : HermitianMat d ℂ) - (A + t • 1)⁻¹) = A.cfc (fun u => t ^ q * (1 /...
268
leanexplore_declaration
leanexplore:379325
leanexplore_sqlite
leanexplore_declarations
/-- The positive constant arising from the resolvent integral. Equal to `∫ u in Set.Ioi 0, u ^ (q-1) / (1+u)` = `π / sin(π q)`, but we only need its positivity. -/ noncomputable def rpowConst (q : ℝ) : ℝ := ∫ u in Set.Ioi (0 : ℝ), (u ^ (q - 1) / (1 + u) : ℝ)
1,472
leanexplore_declaration
leanexplore:379326
leanexplore_sqlite
leanexplore_declarations
/-- The integrand `u ^ (q-1) / (1+u)` is integrable on `(0, ∞)` for `0 < q < 1`. -/ lemma rpowConst_integrableOn (hq : 0 < q) (hq1 : q < 1) : IntegrableOn (fun u : ℝ => u ^ (q - 1) / (1 + u)) (Set.Ioi 0) := by rw [← Set.Ioc_union_Ioi_eq_Ioi zero_le_one] apply IntegrableOn.union · have h_integrable_0_1 : Integ...
827
leanexplore_declaration
leanexplore:379327
leanexplore_sqlite
leanexplore_declarations
lemma rpowConst_pos (hq : 0 < q) (hq1 : q < 1) : 0 < rpowConst q := by unfold rpowConst; have h_nonzero : 0 < ∫ u in Set.Ioi (0 : ℝ), u ^ (q - 1) / (1 + u) := by have h_integrable : IntegrableOn (fun u : ℝ => u ^ (q - 1) / (1 + u)) (Set.Ioi (0 : ℝ)) := by exact rpowConst_integrableOn hq hq1 rw [ integ...
3,593
leanexplore_declaration
leanexplore:379328
leanexplore_sqlite
leanexplore_declarations
/-- The scalar rpow approximation converges pointwise. `scalarRpowApprox q T x → rpowConst q * (x^q - 1)` as `T → ∞`. -/ lemma scalarRpowApprox_tendsto {x : ℝ} (hx : 0 < x) (hq : 0 < q) (hq1 : q < 1) : Filter.Tendsto (fun T => scalarRpowApprox q T x) atTop (nhds (rpowConst q * (x ^ q - 1))) := by have h_def :...
2,373
leanexplore_declaration
leanexplore:379329
leanexplore_sqlite
leanexplore_declarations
/-- The matrix rpow approximation converges: `rpowApprox A q T → rpowConst q • (A^q - 1)`. -/ lemma tendsto_rpowApprox (hA : A.mat.PosDef) (hq : 0 < q) (hq1 : q < 1) : Tendsto (rpowApprox A q) atTop (nhds (rpowConst q • (A ^ q - 1))) := by have h_target : rpowConst q • (A ^ q - 1) = A.cfc (fun x => rpowConst q * ...
751
leanexplore_declaration
leanexplore:379330
leanexplore_sqlite
leanexplore_declarations
theorem rpow_le_rpow_of_posDef (hA : A.mat.PosDef) (hAB : A ≤ B) (hq : 0 < q) (hq1 : q ≤ 1) : A ^ q ≤ B ^ q := by by_cases hq_eq_one : q = 1; · aesop; · have h_rpow : rpowConst q • (A ^ q - 1) ≤ rpowConst q • (B ^ q - 1) := by convert le_of_tendsto_of_tendsto ( tendsto_rpowApprox hA hq ( lt_of_le_of_ne ...
3,066
leanexplore_declaration
leanexplore:379331
leanexplore_sqlite
leanexplore_declarations
/-- The **Löwner—Heinz theorem**: for matrices A and B, if `0 ≤ A ≤ B` and `0 < q ≤ 1`, then `A^q ≤ B^q`. That is, real roots are operator monotone. -/ theorem rpow_le_rpow_of_le (hA : 0 ≤ A) (hAB : A ≤ B) (hq : 0 < q) (hq1 : q ≤ 1) : A ^ q ≤ B ^ q := by -- For ε > 0, let Aε = A + ε • 1 and Bε = B + ε • 1. set ...
299
leanexplore_declaration
leanexplore:379332
leanexplore_sqlite
leanexplore_declarations
/-- An inequality of Lieb-Thirring type. For 0 < r ≤ 1: `Tr[B^r A^r B^r] ≤ Tr[(B A B)^r]`. -/ lemma lieb_thirring_le_one {A B : HermitianMat d ℂ} (hA : 0 ≤ A) (hB : 0 ≤ B) {r : ℝ} (hq0 : 0 < r) (hq1 : q ≤ r) : ((A ^ r).conj (B ^ r).mat).trace ≤ ((A.conj B.mat) ^ r).trace := by sorry
189
leanexplore_declaration
leanexplore:379333
leanexplore_sqlite
leanexplore_declarations
lemma trace_rpow_add_le {A B : HermitianMat d ℂ} (hA : 0 ≤ A) (hB : 0 ≤ B) (p : ℝ) (hp : 0 < p) (hp1 : p ≤ 1) : ((A + B) ^ p).trace ≤ (A ^ p).trace + (B ^ p).trace := by sorry
237
leanexplore_declaration
leanexplore:379334
leanexplore_sqlite
leanexplore_declarations
/-- The Schatten p-norm of a matrix A is (Tr[(A*A)^(p/2)])^(1/p). -/ noncomputable def schattenNorm (A : Matrix d d ℂ) (p : ℝ) : ℝ := RCLike.re ((Matrix.isHermitian_mul_conjTranspose_self A.conjTranspose).cfc (· ^ (p/2))).trace ^ (1/p)
483
leanexplore_declaration
leanexplore:379335
leanexplore_sqlite
leanexplore_declarations
theorem schattenNorm_hermitian_pow {A : HermitianMat d ℂ} (hA : 0 ≤ A) {p : ℝ} (hp : 0 < p) : schattenNorm A.mat p = (A ^ p).trace ^ (1/p) := by convert congr_arg (· ^ (1 / p)) _ using 1 convert congr_arg _ (A.cfc_sq_rpow_eq_cfc_rpow hA p hp) using 1 unfold HermitianMat.trace convert rfl convert (A ^ 2).m...
1,036
leanexplore_declaration
leanexplore:379336
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_nonneg (A : Matrix d d ℂ) (p : ℝ) : 0 ≤ schattenNorm A p := by by_cases hp : p = 0 <;> simp [ *, schattenNorm ]; by_cases h₁ : 0 ≤ RCLike.re ( Matrix.trace ( Matrix.IsHermitian.cfc ( Matrix.isHermitian_mul_conjTranspose_self A.conjTranspose ) fun x => x ^ ( p / 2 ) ) ) <;> simp_all [ Real.rpo...
672
leanexplore_declaration
leanexplore:379337
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_pow_eq (A : HermitianMat d ℂ) (hA : 0 ≤ A) (p k : ℝ) (hp : 0 < p) (hk : 0 < k) : schattenNorm (A ^ k).mat p = (schattenNorm A.mat (k * p)) ^ k := by rw [ schattenNorm_hermitian_pow, schattenNorm_hermitian_pow ] <;> try positivity; · rw [ ← Real.rpow_mul ] <;> ring_nf <;> norm_num [ hp.ne', ...
297
leanexplore_declaration
leanexplore:379338
leanexplore_sqlite
leanexplore_declarations
lemma trace_eq_schattenNorm_rpow (A : HermitianMat d ℂ) (hA : 0 ≤ A) (r : ℝ) (hr : 0 < r) : (A ^ r).trace = (schattenNorm A.mat r) ^ r := by rw [schattenNorm_hermitian_pow hA hr, ← Real.rpow_mul] <;> norm_num [hr.ne'] apply HermitianMat.trace_nonneg exact HermitianMat.rpow_nonneg hA
358
leanexplore_declaration
leanexplore:379339
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_trace_as_eigenvalue_sum (A : Matrix d d ℂ) (p : ℝ) : RCLike.re ((Matrix.isHermitian_mul_conjTranspose_self A.conjTranspose).cfc (· ^ (p/2))).trace = ∑ i : d, ((Matrix.isHermitian_mul_conjTranspose_self A.conjTranspose).eigenvalues i) ^ (p/2) := by rw [ Matrix.IsHermitian.cfc ]; simp [ Mat...
895
leanexplore_declaration
leanexplore:379340
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_rpow_eq_sum_singularValues (A : Matrix d d ℂ) {p : ℝ} (hp : 0 < p) : schattenNorm A p ^ p = ∑ i : d, singularValues A i ^ p := by unfold schattenNorm; rw [ ← Real.rpow_mul ( _ ), one_div_mul_cancel hp.ne', Real.rpow_one ]; · convert schattenNorm_trace_as_eigenvalue_sum A p using 1 refin...
682
leanexplore_declaration
leanexplore:379341
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_eq_sum_singularValues_rpow (A : Matrix d d ℂ) {p : ℝ} (hp : 0 < p) : schattenNorm A p = (∑ i : d, singularValues A i ^ p) ^ (1/p) := by rw [ ←schattenNorm_rpow_eq_sum_singularValues A hp ]; rw [ ← Real.rpow_mul ( by exact Real.rpow_nonneg ( by simp [ Matrix.trace ]; refine' Finset.sum...
341
leanexplore_declaration
leanexplore:379342
leanexplore_sqlite
leanexplore_declarations
/-- `‖A‖_p^p` equals the same sum over sorted singular values. -/ lemma schattenNorm_rpow_eq_sum_sorted (A : Matrix d d ℂ) {p : ℝ} (hp : 0 < p) : schattenNorm A p ^ p = ∑ i : Fin (Fintype.card d), singularValuesSorted A i ^ p := by rw [schattenNorm_rpow_eq_sum_singularValues A hp] exact sum_singularValues_r...
2,551
leanexplore_declaration
leanexplore:379343
leanexplore_sqlite
leanexplore_declarations
/-- Scalar trace Young inequality for PSD matrices: ⟪A, B⟫ ≤ Tr[A^p]/p + Tr[B^q]/q for PSD A, B and conjugate p, q > 1. -/ lemma HermitianMat.trace_young (A B : HermitianMat d ℂ) (hA : 0 ≤ A) (hB : 0 ≤ B) (p q : ℝ) (hp : 1 < p) (hpq : 1/p + 1/q = 1) : ⟪A, B⟫_ℝ ≤ (A ^ p).trace / p + (B ^ q).trace / q := by ...
408
leanexplore_declaration
leanexplore:379344
leanexplore_sqlite
leanexplore_declarations
/-- For PSD `A` and Hermitian `B`, the product `C = A^{1/2} * B` satisfies `C^* C = (A.conj B.mat).mat = B * A * B`. -/ lemma conjTranspose_half_mul_eq_conj {A B : HermitianMat d ℂ} (hA : 0 ≤ A) : ((A ^ (1/2 : ℝ)).mat * B.mat).conjTranspose * ((A ^ (1/2 : ℝ)).mat * B.mat) = (A.conj B.mat).mat := by have :...
1,249
leanexplore_declaration
leanexplore:379345
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_half_mul_rpow_eq_trace_conj {A B : HermitianMat d ℂ} (hA : 0 ≤ A) {α : ℝ} (hα : 0 < α) : (schattenNorm ((A ^ (1/2 : ℝ)).mat * B.mat) (2 * α)) ^ (2 * α) = ((A.conj B.mat) ^ α).trace := by have h_conj : ((A ^ (1 / 2 : ℝ)).mat * B.mat).conjTranspose * ((A ^ (1 / 2 : ℝ)).mat * B.mat) = ...
3,022
leanexplore_declaration
leanexplore:379346
leanexplore_sqlite
leanexplore_declarations
lemma schattenNorm_mul_le (A B : Matrix d d ℂ) {r p q : ℝ} (hr : 0 < r) (hp : 0 < p) (hq : 0 < q) (hpqr : 1 / r = 1 / p + 1 / q) : schattenNorm (A * B) r ≤ schattenNorm A p * schattenNorm B q := by -- It suffices to show the inequality for r-th powers, since x ↦ x^{1/r} is monotone. rw [schattenNorm_eq_sum_...
1,147
leanexplore_declaration
leanexplore:379347
leanexplore_sqlite
leanexplore_declarations
lemma HermitianMat.trace_rpow_conj_le {A B : HermitianMat d ℂ} (hA : 0 ≤ A) (hB : 0 ≤ B) {α p q : ℝ} (hα : 0 < α) (hp : 0 < p) (hq : 0 < q) (hpq : 1 / (2 * α) = 1 / p + 1 / q) : ((A.conj B.mat) ^ α).trace ≤ (((A ^ (p / 2)).trace) ^ (1 / p) * ((B ^ q).trace) ^ (1 / q)) ^ (2 * α) := by -- Raise both...
172
leanexplore_declaration
leanexplore:379348
leanexplore_sqlite
leanexplore_declarations
/-- The square root of a Hermitian matrix. Negative eigenvalues are mapped to zero. -/ noncomputable def sqrt (A : HermitianMat d 𝕜) : HermitianMat d 𝕜 := A.cfc Real.sqrt
239
leanexplore_declaration
leanexplore:379349
leanexplore_sqlite
leanexplore_declarations
theorem sqrt_sq_eq_proj (A : HermitianMat d 𝕜) : A.sqrt.mat * A.sqrt.mat = A⁺ := by rw [sqrt, ← mat_cfc_mul, ← HermitianMat.ext_iff, posPart_eq_cfc_ite] congr! 2 with x grind [Pi.mul_apply, Real.mul_self_sqrt, Real.sqrt_eq_zero']
111
leanexplore_declaration
leanexplore:379350
leanexplore_sqlite
leanexplore_declarations
theorem sqrt_sq (hA : 0 ≤ A) : A.sqrt.mat * A.sqrt.mat = A := by rw [sqrt_sq_eq_proj, posPart_eq_self hA]
165
leanexplore_declaration
leanexplore:379351
leanexplore_sqlite
leanexplore_declarations
@[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem commute_sqrt_left (hAB : Commute A.mat B.mat) : Commute A.sqrt.mat B.mat := by rw [sqrt] commutes
154
leanexplore_declaration
leanexplore:379352
leanexplore_sqlite
leanexplore_declarations
@[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem commute_sqrt_right (hAB : Commute A.mat B.mat) : Commute A.mat B.sqrt.mat := by commutes
530
leanexplore_declaration
leanexplore:379353
leanexplore_sqlite
leanexplore_declarations
/-- For a positive definite matrix A, A^{-1/2} * A * A^{-1/2} = I. -/ lemma sqrt_inv_mul_self_mul_sqrt_inv_eq_one {A : HermitianMat d 𝕜} (hA : A.mat.PosDef) : A⁻¹.sqrt.mat * A.mat * A⁻¹.sqrt.mat = 1 := by have h_inv_def : A⁻¹.sqrt.mat * A⁻¹.sqrt.mat = A⁻¹ := by apply HermitianMat.sqrt_sq rw [zero_le_iff]...
109
leanexplore_declaration
leanexplore:379354
leanexplore_sqlite
leanexplore_declarations
theorem sqrt_nonneg (A : HermitianMat d 𝕜) : 0 ≤ A.sqrt := by rw [sqrt, cfc_nonneg_iff] intro; positivity
118
leanexplore_declaration
leanexplore:379355
leanexplore_sqlite
leanexplore_declarations
theorem sqrt_pos (h : 0 < A) : 0 < A.sqrt := by rw [sqrt] apply cfc_pos_of_pos h (by intros; positivity) (by simp)
144
leanexplore_declaration
leanexplore:379356
leanexplore_sqlite
leanexplore_declarations
theorem sqrt_posDef {A : HermitianMat d 𝕜} (hA : A.mat.PosDef) : A.sqrt.mat.PosDef := by rw [sqrt, cfc_posDef] simp [hA.eigenvalues_pos]
534
leanexplore_declaration
leanexplore:379357
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.sqrt` -/ @[positivity HermitianMat.sqrt _] meta def evalHermitianMatSqrt : PositivityExt where eval {_u _α} _zα _pα e := do let .app _sqrt (A : Expr) ← whnfR e | throwError "not sqrt application" try let (isStrictA, pfA) ← bestResult A if isStrictA then pure ...
440
leanexplore_declaration
leanexplore:379358
leanexplore_sqlite
leanexplore_declarations
/-- The trace of the matrix. This requires a `IsMaximalSelfAdjoint R α` instance, and then maps from `HermitianMat n α` to `R`. This means that the trace of (say) a `HermitianMat n ℤ` gives values in ℤ, but that the trace of a `HermitianMat n ℂ` gives values in ℝ. The fact that traces are "automatically" real red...
302
leanexplore_declaration
leanexplore:379359
leanexplore_sqlite
leanexplore_declarations
/-- `HermitianMat.trace` reduces to `Matrix.trace` in the algebra.-/ theorem trace_eq_trace (A : HermitianMat n α) : algebraMap R α A.trace = Matrix.trace A.mat := by rw [trace, Matrix.trace, map_sum, map_sum] congr! 1 exact IsMaximalSelfAdjoint.selfadj_algebra (Matrix.IsHermitian.apply A.H _ _)
143
leanexplore_declaration
leanexplore:379360
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_smul (A : HermitianMat n α) (r : R) : (r • A).trace = r * A.trace := by simp [trace, IsMaximalSelfAdjoint.selfadj_smul]
82
leanexplore_declaration
leanexplore:379361
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_zero : (0 : HermitianMat n α).trace = 0 := by simp [trace]
107
leanexplore_declaration
leanexplore:379362
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_add (A B : HermitianMat n α) : (A + B).trace = A.trace + B.trace := by simp [trace]
93
leanexplore_declaration
leanexplore:379363
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_neg (A : HermitianMat n α) : (-A).trace = -A.trace := by simp [trace]
107
leanexplore_declaration
leanexplore:379364
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_sub (A B : HermitianMat n α) : (A - B).trace = A.trace - B.trace := by simp [trace]
210
leanexplore_declaration
leanexplore:379365
leanexplore_sqlite
leanexplore_declarations
theorem _root_.Matrix.IsHermitian.isSelfAdjoint_trace {A : Matrix n n α} (hA : A.IsHermitian) : IsSelfAdjoint A.trace := by simp [Matrix.trace, IsSelfAdjoint, ← Matrix.star_apply, show star A = A from hA]
418
leanexplore_declaration
leanexplore:379366
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_kronecker [FaithfulSMul R α] : (A ⊗ₖ B).trace = A.trace * B.trace := by apply FaithfulSMul.algebraMap_injective R α simp only [trace, kronecker_mat] rw [Matrix.trace_kronecker A.mat B.mat] simp only [map_mul] have hA := A.H.isSelfAdjoint_trace have hB := B.H.isSelfAdjoint_trace open ...
214
leanexplore_declaration
leanexplore:379367
leanexplore_sqlite
leanexplore_declarations
/-- `HermitianMat.trace` reduces to `Matrix.trace` when the elements are a `TrivialStar`. -/ @[simp] theorem trace_eq_trace_trivial (A : HermitianMat n ℝ) : A.trace = A.mat.trace := by rw [← trace_eq_trace] rfl
94
leanexplore_declaration
leanexplore:379368
leanexplore_sqlite
leanexplore_declarations
theorem trace_eq_re_trace (A : HermitianMat n 𝕜) : A.trace = RCLike.re A.mat.trace := by rfl
122
leanexplore_declaration
leanexplore:379369
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_one [DecidableEq n] : (1 : HermitianMat n 𝕜).trace = Fintype.card n := by simp [trace_eq_re_trace]
280
leanexplore_declaration
leanexplore:379370
leanexplore_sqlite
leanexplore_declarations
/-- `HermitianMat.trace` reduces to `Matrix.trace` when the elements are `RCLike`. -/ @[simp] theorem trace_eq_trace_rc (A : HermitianMat n 𝕜) : A.trace = A.mat.trace := by rw [trace, Matrix.trace, map_sum, RCLike.ofReal_sum] congr 1 exact Matrix.IsHermitian.coe_re_diag A.H
188
leanexplore_declaration
leanexplore:379371
leanexplore_sqlite
leanexplore_declarations
theorem trace_diagonal {T : Type*} [Fintype T] [DecidableEq T] (f : T → ℝ) : (diagonal 𝕜 f).trace = ∑ i, f i := by rw [trace_eq_re_trace] simp [HermitianMat.diagonal, Matrix.trace]
198
leanexplore_declaration
leanexplore:379372
leanexplore_sqlite
leanexplore_declarations
theorem sum_eigenvalues_eq_trace [DecidableEq n] (A : HermitianMat n 𝕜) : ∑ i, A.H.eigenvalues i = A.trace := by convert congrArg RCLike.re A.H.sum_eigenvalues_eq_trace rw [RCLike.ofReal_re]
148
leanexplore_declaration
leanexplore:379373
leanexplore_sqlite
leanexplore_declarations
theorem trace_eq_zero_iff (A : HermitianMat n 𝕜) : A.trace = 0 ↔ A.mat.trace = 0 := by rw [← trace_eq_trace_rc] exact ⟨mod_cast id, mod_cast id⟩
147
leanexplore_declaration
leanexplore:379374
leanexplore_sqlite
leanexplore_declarations
theorem trace_eq_one_iff (A : HermitianMat n 𝕜) : A.trace = 1 ↔ A.mat.trace = 1 := by rw [← trace_eq_trace_rc] exact ⟨mod_cast id, mod_cast id⟩
142
leanexplore_declaration
leanexplore:379375
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trace_reindex (A : HermitianMat n ℂ) (e : n ≃ m) : (A.reindex e).trace = A.trace := by simp [reindex, trace_eq_re_trace]
99
leanexplore_declaration
leanexplore:379376
leanexplore_sqlite
leanexplore_declarations
def traceLeft (A : HermitianMat (m × n) α) : HermitianMat n α := ⟨A.mat.traceLeft, A.H.traceLeft⟩
102
leanexplore_declaration
leanexplore:379377
leanexplore_sqlite
leanexplore_declarations
def traceRight (A : HermitianMat (m × n) α) : HermitianMat m α := ⟨A.mat.traceRight, A.H.traceRight⟩
77
leanexplore_declaration
leanexplore:379378
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_mat : A.traceLeft.mat = A.mat.traceLeft := by rfl
96
leanexplore_declaration
leanexplore:379379
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_add : (A + B).traceLeft = A.traceLeft + B.traceLeft := by ext1; simp
80
leanexplore_declaration
leanexplore:379380
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_neg : (-A).traceLeft = -A.traceLeft := by ext1; simp
96
leanexplore_declaration
leanexplore:379381
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_sub : (A - B).traceLeft = A.traceLeft - B.traceLeft := by ext1; simp
86
leanexplore_declaration
leanexplore:379382
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_mat : (traceRight A).mat = A.mat.traceRight := by rfl
100
leanexplore_declaration
leanexplore:379383
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_add : (A + B).traceRight = A.traceRight + B.traceRight := by ext1; simp
83
leanexplore_declaration
leanexplore:379384
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_neg : (-A).traceRight = -A.traceRight := by ext1; simp
100
leanexplore_declaration
leanexplore:379385
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_sub : (A - B).traceRight = A.traceRight - B.traceRight := by ext1; simp
95
leanexplore_declaration
leanexplore:379386
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_smul (r : ℝ) : (r • A).traceLeft = r • A.traceLeft := by ext1; simp
98
leanexplore_declaration
leanexplore:379387
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_smul (r : ℝ) : (r • A).traceRight = r • A.traceRight := by ext1; simp
94
leanexplore_declaration
leanexplore:379388
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_trace : A.traceLeft.trace = A.trace := by simp [trace_eq_re_trace]
96
leanexplore_declaration
leanexplore:379389
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_trace : A.traceRight.trace = A.trace := by simp [trace_eq_re_trace]
240
leanexplore_declaration
leanexplore:379390
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceLeft_kron [Fintype m] : (A ⊗ₖ B).traceLeft = A.trace • B := by ext : 2 simp only [HermitianMat.traceLeft, Matrix.traceLeft, kronecker_mat, mat_mk] simp [Matrix.trace, RCLike.real_smul_eq_coe_mul, ← Finset.sum_mul]
254
leanexplore_declaration
leanexplore:379391
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem traceRight_kron [Fintype n] : (A ⊗ₖ B).traceRight = B.trace • A := by ext : 2 simp only [HermitianMat.traceRight, Matrix.traceRight, kronecker_mat, mat_mk] simp [Matrix.trace, RCLike.real_smul_eq_coe_mul, ← Finset.mul_sum, mul_comm]
46
leanexplore_declaration
leanexplore:379392
leanexplore_sqlite
leanexplore_declarations
notation "𝐔[" n "]" => Matrix.unitaryGroup n ℂ
70
leanexplore_declaration
leanexplore:379393
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem neg_unitary_val (u : 𝐔[α]) : (-u).val = -u := by rfl
125
leanexplore_declaration
leanexplore:379394
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem star_kron (a : Matrix α α ℂ) (b : Matrix β β ℂ) : star (a ⊗ₖ b) = (star a) ⊗ₖ (star b) := by ext _ _ simp
141
leanexplore_declaration
leanexplore:379395
leanexplore_sqlite
leanexplore_declarations
theorem kron_unitary (a : 𝐔[α]) (b : 𝐔[β]) : a.val ⊗ₖ b.val ∈ 𝐔[α × β] := by simp [Matrix.mem_unitaryGroup_iff, ← Matrix.mul_kronecker_mul]
76
leanexplore_declaration
leanexplore:379396
leanexplore_sqlite
leanexplore_declarations
def unitary_kron (a : 𝐔[α]) (b : 𝐔[β]) : 𝐔[α × β] := ⟨_, kron_unitary a b⟩
149
leanexplore_declaration
leanexplore:379398
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem unitary_kron_apply (a : 𝐔[α]) (b : 𝐔[β]) (i₁ i₂ : α) (j₁ j₂ : β) : (a ⊗ᵤ b) (i₁, j₁) (i₂, j₂) = (a i₁ i₂) * (b j₁ j₂) := by rfl
115
leanexplore_declaration
leanexplore:379399
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem unitary_kron_one_one : (1 : 𝐔[α]) ⊗ᵤ (1 : 𝐔[β]) = (1 : 𝐔[α × β]) := by simp [Matrix.unitary_kron]
409
leanexplore_declaration
leanexplore:379400
leanexplore_sqlite
leanexplore_declarations
/-- For a unitary matrix C, the row sums of ‖C i j‖^2 equal 1. -/ lemma unitary_row_sum_norm_sq (C : Matrix d d ℂ) (hC : C * C.conjTranspose = 1) (i : d) : ∑ j, ‖C i j‖ ^ 2 = 1 := by replace hC := congr($hC i i) simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, RCLike.star_def, Complex.mul_conj, Comp...
439
leanexplore_declaration
leanexplore:379401
leanexplore_sqlite
leanexplore_declarations
/-- For a unitary matrix C, the column sums of ‖C i j‖^2 equal 1. -/ lemma unitary_col_sum_norm_sq (C : Matrix d d ℂ) (hC : C.conjTranspose * C = 1) (j : d) : ∑ i, ‖C i j‖ ^ 2 = 1 := by replace hC := congr($hC j j) simp_rw [Matrix.mul_apply, mul_comm] at hC simp only [Matrix.conjTranspose_apply, RCLike.star_d...
328
leanexplore_declaration
leanexplore:379402
leanexplore_sqlite
leanexplore_declarations
class IsMaximalSelfAdjoint (R : outParam Type*) (α : Type*) [Star α] [Star R] [CommSemiring R] [Semiring α] [TrivialStar R] [Algebra R α] where selfadjMap : α →+ R selfadj_smul : ∀ (r : R) (a : α), selfadjMap (r • a) = r * (selfadjMap a) selfadj_algebra : ∀ {a : α}, IsSelfAdjoint a → algebraMap _ _ (selfadjMa...
292
leanexplore_declaration
leanexplore:379403
leanexplore_sqlite
leanexplore_declarations
/-- Every `TrivialStar` `CommSemiring` is its own maximal self adjoints. -/ instance instTrivialStar_IsMaximalSelfAdjoint {R} [Star R] [TrivialStar R] [CommSemiring R] : IsMaximalSelfAdjoint R R where selfadjMap := AddMonoidHom.id R selfadj_smul _ __ := rfl selfadj_algebra {_} _ := rfl
251
leanexplore_declaration
leanexplore:379404
leanexplore_sqlite
leanexplore_declarations
/-- ℝ is the maximal self adjoint elements over RCLike -/ instance instRCLike_IsMaximalSelfAdjoint {α} [RCLike α] : IsMaximalSelfAdjoint ℝ α where selfadjMap := RCLike.re selfadj_smul := RCLike.smul_re selfadj_algebra := RCLike.conj_eq_iff_re.mp
124
leanexplore_declaration
leanexplore:379405
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem trivial_selfadjMap {R} [Star R] [TrivialStar R] [CommSemiring R] : (selfadjMap : R →+ R) = .id R := by rfl
96
leanexplore_declaration
leanexplore:379406
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem RCLike_selfadjMap {α} [RCLike α] : (selfadjMap : α →+ ℝ) = RCLike.re := by rfl
504
leanexplore_declaration
leanexplore:379407
leanexplore_sqlite
leanexplore_declarations
/-- An isometry is a matrix `A` such that `AAᴴ = 1`. Compare with a unitary, which requires `AAᴴ = AᴴA = 1`. It is common to claim that, in a finite-dimensional vector space, a two-sided isometry (`A.Isometry ∧ Aᴴ.Isometry`) must be square and therefore unitary; this is does not work out so well here, since a `Matrix m...
2,015
leanexplore_declaration
leanexplore:379408
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.submatrix_one_isometry {e : d₂ → d} {f : d₃ → d} (he : e.Bijective) (hf : f.Injective) : (submatrix (α := R) 1 e f).Isometry := by -- Since $e$ is injective and $f$ is bijective, the submatrix of the identity matrix formed by $e$ and $f$ is a permutation matrix. have h_perm : ∀ i j, (Matrix.subma...
181
leanexplore_declaration
leanexplore:379409
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.submatrix_one_id_left_isometry {e : d₂ → d} (he : e.Bijective) : (submatrix (1 : Matrix d d R) e id).Isometry := submatrix_one_isometry he Function.injective_id
182
leanexplore_declaration
leanexplore:379410
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.submatrix_one_id_right_isometry {e : d₂ → d} (he : e.Injective) : (submatrix (1 : Matrix d d R) id e).Isometry := submatrix_one_isometry Function.bijective_id he