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
81
leanexplore_declaration
leanexplore:379009
leanexplore_sqlite
leanexplore_declarations
@[simp] protected theorem inner_zero_left : ⟪0, A⟫_R = 0 := by simp [inner_def]
89
leanexplore_declaration
leanexplore:379010
leanexplore_sqlite
leanexplore_declarations
@[simp] protected theorem inner_neg_left : ⟪-A, B⟫_R = -⟪A, B⟫_R := by simp [inner_def]
90
leanexplore_declaration
leanexplore:379011
leanexplore_sqlite
leanexplore_declarations
@[simp] protected theorem inner_neg_right : ⟪A, -B⟫_R = -⟪A, B⟫_R := by simp [inner_def]
103
leanexplore_declaration
leanexplore:379012
leanexplore_sqlite
leanexplore_declarations
protected theorem inner_sub_left : ⟪A, B - C⟫_R = ⟪A, B⟫_R - ⟪A, C⟫_R := by simp [inner_def, mul_sub]
104
leanexplore_declaration
leanexplore:379013
leanexplore_sqlite
leanexplore_declarations
protected theorem inner_sub_right : ⟪A - B, C⟫_R = ⟪A, C⟫_R - ⟪B, C⟫_R := by simp [inner_def, sub_mul]
118
leanexplore_declaration
leanexplore:379014
leanexplore_sqlite
leanexplore_declarations
@[simp] protected theorem inner_smul_left (r : R) : ⟪r • A, B⟫_R = r * ⟪A, B⟫_R := by simp [inner_def, selfadj_smul]
119
leanexplore_declaration
leanexplore:379015
leanexplore_sqlite
leanexplore_declarations
@[simp] protected theorem inner_smul_right (r : R) : ⟪A, r • B⟫_R = r * ⟪A, B⟫_R := by simp [inner_def, selfadj_smul]
407
leanexplore_declaration
leanexplore:379016
leanexplore_sqlite
leanexplore_declarations
/-- The Hermitian inner product as bilinear form. Compare with `innerₗ` (in the root namespace) which requires an `InnerProductSpace` instance. -/ protected def innerₗ : LinearMap.BilinForm R (HermitianMat n α) where toFun A := { toFun := (⟪A, ·⟫_R) map_add' := A.inner_add_right map_smul' r B := by simp ...
102
leanexplore_declaration
leanexplore:379017
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem inner_one : ⟪A, 1⟫_R = A.trace := by simp only [inner_def, mat_one, mul_one, trace]
101
leanexplore_declaration
leanexplore:379018
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem one_inner : ⟪1, A⟫_R = A.trace := by simp only [inner_def, one_mul, mat_one, trace]
393
leanexplore_declaration
leanexplore:379019
leanexplore_sqlite
leanexplore_declarations
/-- The inner product for Hermtian matrices is equal to the trace of the product. -/ theorem inner_eq_trace_mul : algebraMap R α ⟪A, B⟫_R = (A.mat * B.mat).trace := by apply IsMaximalSelfAdjoint.selfadj_algebra rw [IsSelfAdjoint, Matrix.trace] simp_rw [star_sum, Matrix.diag_apply, Matrix.mul_apply, star_sum, star...
97
leanexplore_declaration
leanexplore:379020
leanexplore_sqlite
leanexplore_declarations
theorem inner_comm : ⟪A, B⟫_R = ⟪B, A⟫_R := by rw [inner_def, inner_def, Matrix.trace_mul_comm]
206
leanexplore_declaration
leanexplore:379021
leanexplore_sqlite
leanexplore_declarations
/-- `HermitianMat.inner` reduces to `Matrix.trace (A * B)` when the elements are a `TrivialStar`. -/ theorem inner_eq_trace_trivial : ⟪A, B⟫_α = (A.mat * B.mat).trace := by rw [← inner_eq_trace_mul] rfl
80
leanexplore_declaration
leanexplore:379022
leanexplore_sqlite
leanexplore_declarations
theorem inner_eq_re_trace : ⟪A, B⟫ = RCLike.re (A.mat * B.mat).trace := by rfl
247
leanexplore_declaration
leanexplore:379023
leanexplore_sqlite
leanexplore_declarations
theorem inner_eq_trace_rc : ⟪A, B⟫ = (A.mat * B.mat).trace := by rw [inner_eq_re_trace, ← RCLike.conj_eq_iff_re] convert (Matrix.trace_conjTranspose (A.mat * B.mat)).symm using 1 rw [Matrix.conjTranspose_mul, A.H, B.H, Matrix.trace_mul_comm]
355
leanexplore_declaration
leanexplore:379024
leanexplore_sqlite
leanexplore_declarations
theorem inner_self_nonneg: 0 ≤ ⟪A, A⟫ := by simp_rw [inner_eq_re_trace, Matrix.trace, Matrix.diag, Matrix.mul_apply, map_sum] refine Finset.sum_nonneg fun i _ ↦ Finset.sum_nonneg fun j _ ↦ ?_ rw [← congrFun₂ A.H, Matrix.conjTranspose_apply] refine And.left <| RCLike.nonneg_iff.mp ?_ open ComplexOrder in exa...
159
leanexplore_declaration
leanexplore:379025
leanexplore_sqlite
leanexplore_declarations
theorem inner_mul_nonneg (h : 0 ≤ A.mat * B.mat) : 0 ≤ ⟪A, B⟫ := by rw [Matrix.nonneg_iff_posSemidef] at h exact (RCLike.nonneg_iff.mp h.trace_nonneg).left
465
leanexplore_declaration
leanexplore:379026
leanexplore_sqlite
leanexplore_declarations
/-- The inner product for PSD matrices is nonnegative. -/ theorem inner_ge_zero (hA : 0 ≤ A) (hB : 0 ≤ B) : 0 ≤ ⟪A, B⟫ := by rw [zero_le_iff] at hB open MatrixOrder in open Classical in rw [inner_eq_re_trace, ← CFC.sqrt_mul_sqrt_self A.mat hA, Matrix.trace_mul_cycle, Matrix.trace_mul_cycle] nth_rewrite 1 [← (...
194
leanexplore_declaration
leanexplore:379027
leanexplore_sqlite
leanexplore_declarations
theorem inner_mono (hA : 0 ≤ A) : B ≤ C → ⟪A, B⟫ ≤ ⟪A, C⟫ := by intro hBC classical have hTr : 0 ≤ ⟪A, C - B⟫ := inner_ge_zero hA (zero_le_iff.mpr hBC) simpa [inner_def, mul_sub] using hTr
140
leanexplore_declaration
leanexplore:379028
leanexplore_sqlite
leanexplore_declarations
theorem inner_mono' (hA : 0 ≤ A) : B ≤ C → ⟪B, A⟫ ≤ ⟪C, A⟫ := by intro hBC rw [inner_comm B A, inner_comm C A] exact inner_mono hA hBC
244
leanexplore_declaration
leanexplore:379029
leanexplore_sqlite
leanexplore_declarations
/-- The inner product for PSD matrices is at most the product of their traces. -/ theorem inner_le_mul_trace (hA : 0 ≤ A) (hB : 0 ≤ B) : ⟪A, B⟫ ≤ A.trace * B.trace := by classical convert inner_mono hA (le_trace_smul_one hB) simp [mul_comm]
339
leanexplore_declaration
leanexplore:379030
leanexplore_sqlite
leanexplore_declarations
/-- The inner product of two PSD matrices is zero iff they have disjoint support, i.e., each lives entirely in the other's kernel. -/ theorem inner_zero_iff [DecidableEq n] (hA₁ : 0 ≤ A) (hB₁ : 0 ≤ B) : ⟪A, B⟫ = 0 ↔ A.support ≤ B.ker := by rw [zero_le_iff] at hA₁ hB₁ rw [inner_eq_re_trace] exact inner_zero_if...
399
leanexplore_declaration
leanexplore:379031
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem reindex_inner (e : d ≃ d₂) (B : HermitianMat d₂ 𝕜) : ⟪A.reindex e, B⟫ = ⟪A, B.reindex e.symm⟫ := by simp only [inner_def, mat_reindex, Matrix.reindex_apply, Equiv.symm_symm] congr rw (occs := [3,4]) [← e.symm_symm] rw [← Matrix.submatrix_id_mul_right] rw (occs := [2]) [Matrix.trace_mul_co...
139
leanexplore_declaration
leanexplore:379032
leanexplore_sqlite
leanexplore_declarations
@[fun_prop] theorem inner_continuous : Continuous (Inner.inner ℝ (E := HermitianMat d 𝕜)) := by rw [funext₂ inner_eq_re_trace] fun_prop
223
leanexplore_declaration
leanexplore:379033
leanexplore_sqlite
leanexplore_declarations
@[fun_prop] --fun_prop can actually prove this, should I leave this on or not? theorem inner_bilinForm_Continuous (A : HermitianMat d 𝕜) : Continuous ⇑(HermitianMat.innerₗ A) := LinearMap.continuous_of_finiteDimensional _
1,476
leanexplore_declaration
leanexplore:379034
leanexplore_sqlite
leanexplore_declarations
/-- We define the Hermitian inner product as our "canonical" inner product, which does induce a norm. This disagrees slightly with Mathlib convention on the `Matrix` type, which avoids asserting one norm as there are several reasonable ones; for Hermitian matrices, though, this seem to be the right choice. -/ @[reducib...
319
leanexplore_declaration
leanexplore:379035
leanexplore_sqlite
leanexplore_declarations
/-- The `HermitianMat` type inherits the Frobenius necessarily, since it's going to need the Hermitian inner product, and in Mathlib an `InnerProductSpace` always carries the corresponding norm. -/ noncomputable instance instNormedGroup : NormedAddCommGroup (HermitianMat d 𝕜) := AddSubgroupClass.normedAddCommGroup _
184
leanexplore_declaration
leanexplore:379036
leanexplore_sqlite
leanexplore_declarations
theorem norm_eq_frobenius (A : HermitianMat d 𝕜) : ‖A‖ = (∑ i : d, ∑ j : d, ‖A i j‖ ^ 2) ^ (1 / 2 : ℝ) := by convert ← Matrix.frobenius_norm_def A.mat exact Real.rpow_ofNat _ 2
375
leanexplore_declaration
leanexplore:379037
leanexplore_sqlite
leanexplore_declarations
theorem norm_eq_sqrt_inner_self (A : HermitianMat d 𝕜) : ‖A‖ = √(⟪A, A⟫) := by rw [norm_eq_frobenius, ← Real.sqrt_eq_rpow] congr simp_rw [inner_eq_re_trace, Matrix.trace, Matrix.diag, Matrix.mul_apply] simp only [map_sum] congr! with i _ j _ simp only [RCLike.norm_sq_eq_def, RCLike.mul_re, sub_eq_add_neg, ...
220
leanexplore_declaration
leanexplore:379038
leanexplore_sqlite
leanexplore_declarations
noncomputable instance instNormedSpace : NormedSpace ℝ (HermitianMat d 𝕜) where norm_smul_le r x := by simp [norm_eq_sqrt_inner_self, ← mul_assoc, Real.sqrt_mul', inner_self_nonneg, Real.sqrt_mul_self_eq_abs]
376
leanexplore_declaration
leanexplore:379039
leanexplore_sqlite
leanexplore_declarations
noncomputable instance instInnerProductSpace : InnerProductSpace ℝ (HermitianMat d 𝕜) := letI : Inner ℝ (HermitianMat d 𝕜) := InnerProductCore.toInner; letI : NormedSpace ℝ (HermitianMat d 𝕜) := instNormedSpace; { InnerProductCore with norm_sq_eq_re_inner := fun x => by rw [norm_eq_sqrt_inner_self,...
62
leanexplore_declaration
leanexplore:379040
leanexplore_sqlite
leanexplore_declarations
instance : CompleteSpace (HermitianMat d 𝕜) := inferInstance
81
leanexplore_declaration
leanexplore:379041
leanexplore_sqlite
leanexplore_declarations
noncomputable instance : NormedAddCommGroup (HermitianMat d ℝ) := inferInstance
81
leanexplore_declaration
leanexplore:379042
leanexplore_sqlite
leanexplore_declarations
noncomputable instance : NormedAddCommGroup (HermitianMat d ℂ) := inferInstance
260
leanexplore_declaration
leanexplore:379043
leanexplore_sqlite
leanexplore_declarations
@[reducible] def _root_.RCLike.instOrderClosed : OrderClosedTopology 𝕜 where isClosed_le' := by conv => enter [1, 1, p]; rw [RCLike.le_iff_re_im] simp_rw [Set.setOf_and] refine IsClosed.inter (isClosed_le ?_ ?_) (isClosed_eq ?_ ?_) <;> continuity
365
leanexplore_declaration
leanexplore:379044
leanexplore_sqlite
leanexplore_declarations
theorem dist_le_of_mem_Icc (x : HermitianMat d 𝕜) (hA : A ≤ x) (hB : x ≤ B) : ‖x - A‖ ≤ ‖B - A‖ := by classical conv => enter [2, 1]; equals (B - x) + (x - A) => abel rw [← sq_le_sq₀ (norm_nonneg _) (norm_nonneg _)] rw [norm_add_pow_two_real, le_add_iff_nonneg_left] suffices 0 ≤ ⟪B - x, x - A⟫ by positiv...
280
leanexplore_declaration
leanexplore:379045
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.IsHermitian_isClosed : IsClosed { A : Matrix n n 𝕜 | A.IsHermitian } := by conv => enter [1, 1, A] rw [Matrix.IsHermitian, ← sub_eq_zero] convert isClosed_singleton.preimage (f := fun (x : Matrix n n 𝕜) ↦ (x.conjTranspose - x)) (by fun_prop) using 1
514
leanexplore_declaration
leanexplore:379046
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.PosSemiDef_isClosed : IsClosed { A : Matrix n n 𝕜 | A.PosSemidef } := by rw [show { A : Matrix n n 𝕜 | A.PosSemidef } = { A | A.IsHermitian } ∩ { A | ∀ x : n → 𝕜, 0 ≤ star x ⬝ᵥ A.mulVec x } from by ext A; simp [Matrix.posSemidef_iff_dotProduct_mulVec]] refine IsHermitian_isClosed.inter ?_ su...
145
leanexplore_declaration
leanexplore:379047
leanexplore_sqlite
leanexplore_declarations
theorem isClosed_nonneg : IsClosed { A : HermitianMat n 𝕜 | 0 ≤ A } := by simp_rw [zero_le_iff] exact Matrix.PosSemiDef_isClosed.preimage_val
320
leanexplore_declaration
leanexplore:379048
leanexplore_sqlite
leanexplore_declarations
instance : OrderClosedTopology (HermitianMat d 𝕜) where isClosed_le' := by classical convert IsClosed.preimage (X := (HermitianMat d 𝕜 × HermitianMat d 𝕜)) (f := fun xy ↦ (xy.2 - xy.1)) (by fun_prop) isClosed_nonneg ext ⟨x, y⟩ simp only [Set.mem_setOf_eq, Set.mem_preimage, ← sub_nonneg (b := ...
493
leanexplore_declaration
leanexplore:379049
leanexplore_sqlite
leanexplore_declarations
/-- Equivalently: the matrices `X` such that `X - A` is PSD and `B - X` is PSD, form a compact set. -/ instance : CompactIccSpace (HermitianMat d 𝕜) where isCompact_Icc := by intros A B apply Metric.isCompact_of_isClosed_isBounded isClosed_Icc rw [Metric.isBounded_iff] use 2 * ‖B - A‖ rintro x ⟨h...
510
leanexplore_declaration
leanexplore:379050
leanexplore_sqlite
leanexplore_declarations
/-- The PSD matrices that are `≤ 1` are a compact set. More generally, this is true of any closed interval, but stating that is a bit different because of how numerals are treated. The `0` and `1` here are already directly matrices, putting in an `(a : ℝ) • 1 ≤ m ∧ m ≤ (b : ℝ) • 1` involves casts. But that theorem shou...
194
leanexplore_declaration
leanexplore:379051
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem norm_one : ‖(1 : HermitianMat d 𝕜)‖ = √(Fintype.card d : ℝ) := by rw [norm_eq_sqrt_real_inner (F := HermitianMat d 𝕜)] congr 1 simp [-inner_self_eq_norm_sq_to_K, inner_def]
522
leanexplore_declaration
leanexplore:379052
leanexplore_sqlite
leanexplore_declarations
theorem norm_eq_trace_sq : ‖A‖ ^ 2 = (A.mat ^ 2).trace := by rw [norm_eq_frobenius, ← RCLike.ofReal_pow, ← Real.rpow_two, ← Real.rpow_mul (by positivity)] simp only [one_div, ne_eq, OfNat.ofNat_ne_zero, not_false_eq_true, inv_mul_cancel₀, Real.rpow_one] simp only [sq A.mat, map_sum, map_pow, Matrix.trace, Matrix....
4,314
leanexplore_declaration
leanexplore:379053
leanexplore_sqlite
leanexplore_declarations
/-- The inner product ⟪A, B⟫ equals ∑_{ij} a_i b_j w_{ij} where a_i, b_j are eigenvalues and w_{ij} = ‖C_{ij}‖² for C = U_A^* U_B unitary. -/ lemma inner_eq_doubly_stochastic_sum {d : Type*} [Fintype d] [DecidableEq d] (A B : HermitianMat d ℂ) : let C := A.H.eigenvectorUnitary.val.conjTranspose * B.H.eigenvecto...
163
leanexplore_declaration
leanexplore:379054
leanexplore_sqlite
leanexplore_declarations
def symmMul : HermitianMat d 𝕜 := ⟨(2 : 𝕜)⁻¹ • (A.mat * B.mat + B.mat * A.mat), by simp [selfAdjoint, IsSelfAdjoint, add_comm, Matrix.star_eq_conjTranspose]⟩
106
leanexplore_declaration
leanexplore:379055
leanexplore_sqlite
leanexplore_declarations
theorem symmMul_comm : A.symmMul B = B.symmMul A := by rw [symmMul, symmMul, Subtype.mk.injEq, add_comm]
68
leanexplore_declaration
leanexplore:379056
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem symmMul_zero : A.symmMul 0 = 0:= by simp [symmMul]
69
leanexplore_declaration
leanexplore:379057
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem zero_symmMul : symmMul 0 A = 0 := by simp [symmMul]
103
leanexplore_declaration
leanexplore:379058
leanexplore_sqlite
leanexplore_declarations
theorem symmMul_toMat : (A.symmMul B).mat = (2 : 𝕜)⁻¹ • (A.mat * B.mat + B.mat * A.mat) := by rfl
223
leanexplore_declaration
leanexplore:379059
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem symmMul_of_commute (hAB : Commute A.mat B.mat) : (A.symmMul B).mat = A.mat * B.mat := by rw [symmMul_toMat, hAB] rw [smul_add, ← add_smul, inv_eq_one_div, ← add_div] rw [add_self_div_two, one_smul]
69
leanexplore_declaration
leanexplore:379060
leanexplore_sqlite
leanexplore_declarations
theorem symmMul_self : (symmMul A A).mat = A.mat * A.mat := by simp
64
leanexplore_declaration
leanexplore:379061
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem symmMul_one : A.symmMul 1 = A := by ext1; simp
64
leanexplore_declaration
leanexplore:379062
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem one_symmMul : symmMul 1 A = A := by ext1; simp
72
leanexplore_declaration
leanexplore:379063
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem symmMul_neg_one : A.symmMul (-1) = -A := by ext1; simp
72
leanexplore_declaration
leanexplore:379064
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem neg_one_symmMul : symmMul (-1) A = -A := by ext1; simp
122
leanexplore_declaration
leanexplore:379065
leanexplore_sqlite
leanexplore_declarations
scoped instance : CommMagma (HermitianMat d 𝕜) where mul := HermitianMat.symmMul mul_comm := HermitianMat.symmMul_comm
56
leanexplore_declaration
leanexplore:379066
leanexplore_sqlite
leanexplore_declarations
theorem mul_eq_symmMul : A * B = A.symmMul B := by rfl
250
leanexplore_declaration
leanexplore:379067
leanexplore_sqlite
leanexplore_declarations
scoped instance : IsCommJordan (HermitianMat d 𝕜) where lmul_comm_rmul_rmul a b := by ext1 simp only [mul_eq_symmMul, HermitianMat.symmMul_toMat, smul_add, mul_add, add_mul, Matrix.mul_smul, Matrix.smul_mul, Matrix.mul_assoc] abel
133
leanexplore_declaration
leanexplore:379068
leanexplore_sqlite
leanexplore_declarations
scoped instance : MulZeroClass (HermitianMat d 𝕜) where zero_mul := by simp [mul_eq_symmMul] mul_zero := by simp [mul_eq_symmMul]
134
leanexplore_declaration
leanexplore:379069
leanexplore_sqlite
leanexplore_declarations
scoped instance : MulZeroOneClass (HermitianMat d 𝕜) where one_mul := by simp [mul_eq_symmMul] mul_one := by simp [mul_eq_symmMul]
299
leanexplore_declaration
leanexplore:379070
leanexplore_sqlite
leanexplore_declarations
scoped instance : NonUnitalNonAssocRing (HermitianMat d 𝕜) where left_distrib a b c := by ext1 simp [mul_eq_symmMul, HermitianMat.symmMul_toMat, mul_add, add_mul] abel right_distrib a b c := by ext1 simp [mul_eq_symmMul, HermitianMat.symmMul_toMat, mul_add, add_mul] abel
55
leanexplore_declaration
leanexplore:379071
leanexplore_sqlite
leanexplore_declarations
scoped instance : NonAssocRing (HermitianMat d 𝕜) where
234
leanexplore_declaration
leanexplore:379072
leanexplore_sqlite
leanexplore_declarations
scoped instance : IsScalarTower ℝ (HermitianMat d 𝕜) (HermitianMat d 𝕜) where smul_assoc r x y := by ext : 2 simp only [smul_eq_mul, mul_eq_symmMul, HermitianMat.symmMul_toMat, HermitianMat.mat_smul, smul_add] simp
456
leanexplore_declaration
leanexplore:379073
leanexplore_sqlite
leanexplore_declarations
theorem Matrix.IsHermitian.log_smul_of_ne_zero {A : Matrix d d 𝕜} (hA : A.IsHermitian) (hx : x ≠ 0) : cfc Real.log (x • A) = (Real.log x) • cfc (if · = 0 then (0 : ℝ) else 1) A + cfc Real.log A := by have hCFC : cfc (Real.log ∘ (x * ·)) A = cfc Real.log (x • A) := by exact cfc_comp_smul x Real.log _ (by fun_...
181
leanexplore_declaration
leanexplore:379074
leanexplore_sqlite
leanexplore_declarations
/-- Matrix exponential of a Hermitian matrix, as given by the continuous functional calculus with `Real.exp` -/ def exp (A : HermitianMat d 𝕜) : HermitianMat d 𝕜 := A.cfc Real.exp
271
leanexplore_declaration
leanexplore:379075
leanexplore_sqlite
leanexplore_declarations
/-- Primed because `Commute.exp_left` refers to `NormedSpace.exp` instead of `HermitianMat.exp`. -/ @[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem _root_.Commute.exp_left' (hAB : Commute A.mat B.mat) : Commute (A.exp).mat B.mat := by rw [exp]; commutes
273
leanexplore_declaration
leanexplore:379076
leanexplore_sqlite
leanexplore_declarations
/-- Primed because `Commute.exp_right` refers to `NormedSpace.exp` instead of `HermitianMat.exp`. -/ @[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem _root_.Commute.exp_right' (hAB : Commute A.mat B.mat) : Commute A.mat (B.exp).mat := by rw [exp]; commutes
108
leanexplore_declaration
leanexplore:379077
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem reindex_exp (e : d ≃ d₂) : (A.reindex e).exp = A.exp.reindex e := cfc_reindex A Real.exp e
109
leanexplore_declaration
leanexplore:379078
leanexplore_sqlite
leanexplore_declarations
instance nonSingular_exp : NonSingular A.exp := by exact cfc_nonSingular A Real.exp (fun i ↦ by positivity)
209
leanexplore_declaration
leanexplore:379079
leanexplore_sqlite
leanexplore_declarations
/-- The matrix exponential of a Hermitian matrix is nonnegative. -/ theorem exp_nonneg (A : HermitianMat d 𝕜) : 0 ≤ A.exp := by rw [exp, HermitianMat.cfc_nonneg_iff] exact fun i ↦ le_of_lt (Real.exp_pos _)
345
leanexplore_declaration
leanexplore:379080
leanexplore_sqlite
leanexplore_declarations
/-- The matrix exponential of a Hermitian matrix is strictly positive (Loewner order). Requires `Nonempty` since over an empty index type every matrix equals zero and `0 < 0` is false. -/ theorem exp_pos [i : Nonempty d] (A : HermitianMat d 𝕜) : 0 < A.exp := by apply A.exp_nonneg.lt_of_ne' intro h simpa [h] usin...
535
leanexplore_declaration
leanexplore:379081
leanexplore_sqlite
leanexplore_declarations
/-- Positivity extension for `HermitianMat.exp`: always strictly positive if `Nonempty d`. TODO: We could add a fallback to give `nonnegative` if `Nonempty d` is not available, possibly also print a warning. (Users might often not have `Nonempty d` in context, and they probably want to.) -/ @[positivity HermitianMat.ex...
646
leanexplore_declaration
leanexplore:379082
leanexplore_sqlite
leanexplore_declarations
/-- Matrix logarithm (base e) of a Hermitian matrix, as given by the elementwise real logarithm of the diagonal in a diagonalized form, using `Real.log` Note that this means that the nullspace of the image includes all of the nullspace of the original matrix. This contrasts to the standard definition, which is t...
170
leanexplore_declaration
leanexplore:379083
leanexplore_sqlite
leanexplore_declarations
@[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem _root_.Commute.log_left (hAB : Commute A.mat B.mat) : Commute (A.log).mat B.mat := by rw [log]; commutes
171
leanexplore_declaration
leanexplore:379084
leanexplore_sqlite
leanexplore_declarations
@[aesop unsafe apply 50% (rule_sets := [Commutes])] theorem _root_.Commute.log_right (hAB : Commute A.mat B.mat) : Commute A.mat (B.log).mat := by rw [log]; commutes
108
leanexplore_declaration
leanexplore:379085
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem reindex_log (e : d ≃ d₂) : (A.reindex e).log = A.log.reindex e := cfc_reindex A Real.log e
76
leanexplore_declaration
leanexplore:379086
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem log_zero : (0 : HermitianMat d 𝕜).log = 0 := by simp [log]
75
leanexplore_declaration
leanexplore:379087
leanexplore_sqlite
leanexplore_declarations
@[simp] theorem log_one : (1 : HermitianMat d 𝕜).log = 0 := by simp [log]
202
leanexplore_declaration
leanexplore:379088
leanexplore_sqlite
leanexplore_declarations
theorem log_smul_of_pos (A : HermitianMat d 𝕜) (hx : x ≠ 0) : (x • A).log = Real.log x • A.supportProj + A.log := by ext1 convert A.H.log_smul_of_ne_zero hx simp [cfc, log, supportProj_eq_cfc]
155
leanexplore_declaration
leanexplore:379089
leanexplore_sqlite
leanexplore_declarations
theorem log_smul {A : HermitianMat d 𝕜} {x : ℝ} (hx : x ≠ 0) [NonSingular A] : (x • A).log = Real.log x • 1 + A.log := by simp [log_smul_of_pos A hx]
2,484
leanexplore_declaration
leanexplore:379090
leanexplore_sqlite
leanexplore_declarations
theorem inv_antitone (hA : A.mat.PosDef) (h : A ≤ B) : B⁻¹ ≤ A⁻¹ := by -- Since $B - A$ is positive semidefinite, we can write it as $C^*C$ for some matrix $C$. obtain ⟨C, hC⟩ : ∃ C : Matrix d d 𝕜, B.mat - A.mat = C.conjTranspose * C := by classical apply CStarAlgebra.nonneg_iff_eq_star_mul_self.mp sim...
1,625
leanexplore_declaration
leanexplore:379091
leanexplore_sqlite
leanexplore_declarations
lemma Real.integral_inv_sub_inv_finite (x T : ℝ) (hx : 0 < x) (hT : 0 < T) : ∫ t in (0)..T, (1 / (1 + t) - 1 / (x + t)) = Real.log x + Real.log ((1 + T) / (x + T)) := by rw [ intervalIntegral.integral_sub, intervalIntegral.integral_comp_add_left, intervalIntegral.integral_comp_add_left ]; · rw [ ← Real.log_mul,...
966
leanexplore_declaration
leanexplore:379092
leanexplore_sqlite
leanexplore_declarations
/-- The limit of $\log((1+T)/(x+T))$ as $T \to \infty$ is 0, for $x > 0$. -/ lemma Real.tendsto_log_div_add_atTop (x : ℝ) : Filter.Tendsto (fun T => Real.log ((1 + T) / (x + T))) .atTop (nhds 0) := by -- We can divide the numerator and the denominator by $b$ and then take the limit as $b$ approaches infinity. s...
5,892
leanexplore_declaration
leanexplore:379093
leanexplore_sqlite
leanexplore_declarations
/-- Monotonicity of the finite integral approximation of the logarithm. -/ theorem logApprox_mono {x y : HermitianMat d 𝕜} (hx : x.mat.PosDef) (hy : y.mat.PosDef) (hxy : x ≤ y) (T : ℝ) (hT : 0 < T) : ∫ t in (0)..T, ((1 + t)⁻¹ • (1 : HermitianMat d 𝕜) - (x + t • 1)⁻¹) ≤ ∫ t in (0)..T, ((1 + t)⁻¹ • (1 : Her...
207
leanexplore_declaration
leanexplore:379094
leanexplore_sqlite
leanexplore_declarations
noncomputable def logApprox {n 𝕜 : Type*} [Fintype n] [DecidableEq n] [RCLike 𝕜] (x : HermitianMat n 𝕜) (T : ℝ) : HermitianMat n 𝕜 := ∫ t in (0)..T, ((1 + t)⁻¹ • (1 : HermitianMat n 𝕜) - (x + t • 1)⁻¹)
97
leanexplore_declaration
leanexplore:379095
leanexplore_sqlite
leanexplore_declarations
noncomputable def scalarLogApprox (T : ℝ) (u : ℝ) : ℝ := ∫ t in (0)..T, ((1 + t)⁻¹ - (u + t)⁻¹)
235
leanexplore_declaration
leanexplore:379096
leanexplore_sqlite
leanexplore_declarations
theorem scalarLogApprox_eq (x T : ℝ) (hx : 0 < x) (hT : 0 < T) : scalarLogApprox T x = Real.log x + Real.log ((1 + T) / (x + T)) := by convert Real.integral_inv_sub_inv_finite x T hx hT using 1; unfold scalarLogApprox; norm_num
918
leanexplore_declaration
leanexplore:379097
leanexplore_sqlite
leanexplore_declarations
/-- The matrix log approximation is the CFC of the scalar log approximation. -/ theorem logApprox_eq_cfc_scalar (x : HermitianMat d 𝕜) (hx : x.mat.PosDef) (T : ℝ) (hT : 0 < T) : logApprox x T = x.cfc (scalarLogApprox T) := by unfold scalarLogApprox logApprox; rw [ intervalIntegral.integral_congr fun t ht =...
761
leanexplore_declaration
leanexplore:379098
leanexplore_sqlite
leanexplore_declarations
/-- The log approximation is the log plus an error term. -/ theorem logApprox_eq_log_add_error (x : HermitianMat d 𝕜) (hx : x.mat.PosDef) (T : ℝ) (hT : 0 < T) : logApprox x T = x.log + x.cfc (fun u => Real.log ((1 + T) / (u + T))) := by have h_logApprox : ∫ t in (0)..T, ((1 + t)⁻¹ • (1 : HermitianMat d 𝕜) -...
1,311
leanexplore_declaration
leanexplore:379099
leanexplore_sqlite
leanexplore_declarations
/-- The error term in the log approximation tends to 0 as T goes to infinity. -/ lemma tendsto_cfc_log_div_add_atTop (x : HermitianMat d 𝕜) : Tendsto (fun T => x.cfc (fun u => Real.log ((1 + T) / (u + T)))) atTop (nhds 0) := by -- Expand `(cfc x ...).mat` using `cfc_toMat_eq_sum_smul_proj`. have h_expand : ∀ T...
550
leanexplore_declaration
leanexplore:379100
leanexplore_sqlite
leanexplore_declarations
/-- The log approximation converges to the matrix logarithm. -/ lemma tendsto_logApprox {x : HermitianMat d 𝕜} (hx : x.mat.PosDef) : Tendsto (fun T => logApprox x T) atTop (nhds x.log) := by have h_log_approx_eq : ∀ᶠ T in Filter.atTop, x.logApprox T = x.log + x.cfc (fun u => Real.log ((1 + T) / (u + T))) := by ...
142
leanexplore_declaration
leanexplore:379101
leanexplore_sqlite
leanexplore_declarations
theorem posDef_of_posDef_le (hA : A.mat.PosDef) (hAB : A ≤ B) : B.mat.PosDef := by rw [le_iff] at hAB convert hA.add_posSemidef hAB simp
403
leanexplore_declaration
leanexplore:379102
leanexplore_sqlite
leanexplore_declarations
/-- The matrix logarithm is operator monotone. -/ theorem log_mono (hA : A.mat.PosDef) (hAB : A ≤ B) : A.log ≤ B.log := by have hB : B.mat.PosDef := posDef_of_posDef_le hA hAB apply le_of_tendsto_of_tendsto (tendsto_logApprox hA) (tendsto_logApprox hB) rw [Filter.EventuallyLE, Filter.eventually_atTop] exact ⟨1,...
389
leanexplore_declaration
leanexplore:379103
leanexplore_sqlite
leanexplore_declarations
/-- Monotonicity of exp on commuting operators. -/ theorem le_of_exp_commute (hAB₂ : A.exp ≤ B.exp) : A ≤ B := by have hA : A = (A.exp).log := by simp [exp, log, ← HermitianMat.cfc_comp] have hB : B = (B.exp).log := by simp [exp, log, ← HermitianMat.cfc_comp] rw [hA, hB] apply HermitianMat.log_mono · rw [...
6,039
leanexplore_declaration
leanexplore:379104
leanexplore_sqlite
leanexplore_declarations
/-- The inverse function is operator convex on positive definite matrices. -/ lemma inv_convex {x y : HermitianMat d 𝕜} (hx : x.mat.PosDef) (hy : y.mat.PosDef) ⦃a b : ℝ⦄ (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : (a • x + b • y)⁻¹ ≤ a • x⁻¹ + b • y⁻¹ := by -- Using the fact that the set of positive semide...
580
leanexplore_declaration
leanexplore:379105
leanexplore_sqlite
leanexplore_declarations
/-- The shifted inverse function is operator convex on positive definite matrices. -/ lemma inv_shift_convex {x y : HermitianMat d 𝕜} (hx : x.mat.PosDef) (hy : y.mat.PosDef) ⦃a b : ℝ⦄ (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) (t : ℝ) (ht : 0 ≤ t) : (a • x + b • y + t • 1)⁻¹ ≤ a • (x + t • 1)⁻¹ + b • (y + t •...
1,728
leanexplore_declaration
leanexplore:379106
leanexplore_sqlite
leanexplore_declarations
/-- Definition of the approximation of the matrix logarithm. -/ lemma integrable_inv_shift {A : HermitianMat d 𝕜} (hA : A.mat.PosDef) (b : ℝ) (hb : 0 ≤ b) : IntervalIntegrable (fun t => (A + t • 1)⁻¹) volume 0 b := by -- Since A is positive definite, for any t ≥ 0, A + t • 1 is also positive definite, hence inve...
2,994
leanexplore_declaration
leanexplore:379107
leanexplore_sqlite
leanexplore_declarations
/-- The finite integral approximation of the matrix logarithm is operator concave. -/ theorem logApprox_concave {n 𝕜 : Type*} [Fintype n] [DecidableEq n] [RCLike 𝕜] {x y : HermitianMat n 𝕜} (hx : x.mat.PosDef) (hy : y.mat.PosDef) ⦃a b : ℝ⦄ (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) (T : ℝ) (hT : 0 ≤ T) : ...
675
leanexplore_declaration
leanexplore:379108
leanexplore_sqlite
leanexplore_declarations
/-- The matrix logarithm is operator concave. -/ theorem log_concave {x y : HermitianMat d 𝕜} (hx : x.mat.PosDef) (hy : y.mat.PosDef) ⦃a b : ℝ⦄ (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : a • x.log + b • y.log ≤ (a • x + b • y).log := by apply le_of_tendsto_of_tendsto (b := .atTop) (f := fun T => a • x.log...