Download data/lean/OAI/LinearAlgebra/Moore/Form.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.16 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/Moore/Form.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/Moore/Form.lean
-
curl -L -o Form.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/Moore/Form.lean
7.16 kB
| import OAI.LinearAlgebra.Moore.Elliptic | |
| import OAI.Analysis.PDE.Dirichlet.Quaternion | |
| /-! The faithful complex representation preserves the actual quaternionic quadratic form. -/ | |
| noncomputable section | |
| namespace OAI.LinearAlgebra.Moore | |
| open scoped MatrixOrder ComplexOrder | |
| open Matrix OAI.Analysis.PDE.Dirichlet OAI.Analysis.Calculus.Quaternion | |
| /-- The first column of the complex representation identifies a quaternion vector with | |
| the full complex vector space of twice the dimension. -/ | |
| def complexVector {n : β} (z : Fin n β Quaternion β) : Fin n Γ Fin 2 β β := | |
| fun i β¦ quaternionMatrix (z i.1) i.2 0 | |
| def quaternionVector {n : β} (v : Fin n Γ Fin 2 β β) : Fin n β Quaternion β := | |
| fun i β¦ β¨(v (i, 0)).re, (v (i, 0)).im, -(v (i, 1)).re, (v (i, 1)).imβ© | |
| @[simp] theorem complexVector_quaternionVector {n : β} (v : Fin n Γ Fin 2 β β) : | |
| complexVector (quaternionVector v) = v := by | |
| funext β¨i, aβ© | |
| fin_cases a <;> apply Complex.ext <;> simp [complexVector, quaternionVector, quaternionMatrix] | |
| @[simp] theorem quaternionVector_complexVector {n : β} (z : Fin n β Quaternion β) : | |
| quaternionVector (complexVector z) = z := by | |
| funext i | |
| ext <;> simp [complexVector, quaternionVector, quaternionMatrix] | |
| @[simp] theorem complexVector_zero (n : β) : complexVector (0 : Fin n β Quaternion β) = 0 := by | |
| funext β¨i, aβ© | |
| fin_cases a <;> apply Complex.ext <;> simp [complexVector, quaternionMatrix] | |
| @[simp] theorem quaternionVector_zero (n : β) : | |
| quaternionVector (0 : Fin n Γ Fin 2 β β) = 0 := by | |
| funext i | |
| ext <;> simp [quaternionVector] | |
| theorem complexVector_injective (n : β) : | |
| Function.Injective (complexVector (n := n)) := | |
| Function.LeftInverse.injective quaternionVector_complexVector | |
| theorem quaternionVector_injective (n : β) : | |
| Function.Injective (quaternionVector (n := n)) := | |
| Function.LeftInverse.injective complexVector_quaternionVector | |
| theorem quaternionMatrix_triple_entry (p q r : Quaternion β) : | |
| quaternionMatrix (star p * q * r) 0 0 = | |
| β a : Fin 2, β b : Fin 2, | |
| star (quaternionMatrix p a 0) * quaternionMatrix q a b * quaternionMatrix r b 0 := by | |
| rw [quaternionMatrix_mul, quaternionMatrix_mul, quaternionMatrix_star] | |
| simp only [Matrix.mul_apply, Matrix.conjTranspose_apply, Finset.sum_mul] | |
| rw [Finset.sum_comm] | |
| /-- Exact complex-valued quadratic-form identity, before taking real parts. -/ | |
| theorem complexVector_quadratic {n : β} (A : Matrix (Fin n) (Fin n) (Quaternion β)) | |
| (z : Fin n β Quaternion β) : | |
| star (complexVector z) β¬α΅₯ complexify A *α΅₯ complexVector z = | |
| quaternionMatrix (OAI.Analysis.PDE.Dirichlet.quaternionForm A z) 0 0 := by | |
| change _ = quaternionMatrixHom (β i, β j, star (z i) * A i j * z j) 0 0 | |
| simp only [map_sum, Matrix.sum_apply] | |
| change _ = β i, β j, quaternionMatrix (star (z i) * A i j * z j) 0 0 | |
| simp only [quaternionMatrix_triple_entry] | |
| simp only [dotProduct, Matrix.mulVec, Fintype.sum_prod_type, Finset.mul_sum, | |
| complexVector, complexify, Pi.star_apply, mul_assoc] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| rw [Finset.sum_comm] | |
| theorem complexVector_quadratic_re {n : β} (A : Matrix (Fin n) (Fin n) (Quaternion β)) | |
| (z : Fin n β Quaternion β) : | |
| (star (complexVector z) β¬α΅₯ complexify A *α΅₯ complexVector z).re = | |
| (OAI.Analysis.PDE.Dirichlet.quaternionForm A z).re := by | |
| rw [complexVector_quadratic] | |
| rfl | |
| theorem hermitian_quadratic_im {ΞΉ : Type*} [Fintype ΞΉ] | |
| {A : Matrix ΞΉ ΞΉ β} (hA : A.IsHermitian) (v : ΞΉ β β) : | |
| (star v β¬α΅₯ A *α΅₯ v).im = 0 := by | |
| have h := congrArg Complex.im (hA.star_dotProduct_mulVec_comm v v) | |
| simp only [Complex.star_def, Complex.conj_im] at h | |
| linarith | |
| /-- Positivity in the complex representation is precisely positivity of the original | |
| quaternionic form, not an additional analytic assumption. -/ | |
| theorem complexify_posSemidef_iff {n : β} | |
| {A : Matrix (Fin n) (Fin n) (Quaternion β)} (hA : A.IsHermitian) : | |
| (complexify A).PosSemidef β β z, 0 β€ (OAI.Analysis.PDE.Dirichlet.quaternionForm A z).re := by | |
| constructor | |
| Β· intro h z | |
| have hz := h.dotProduct_mulVec_nonneg (complexVector z) | |
| have hre := (Complex.nonneg_iff.mp hz).1 | |
| simpa only [complexVector_quadratic_re] using hre | |
| Β· intro h | |
| refine Matrix.PosSemidef.of_dotProduct_mulVec_nonneg (complexify_isHermitian hA) ?_ | |
| intro v | |
| apply Complex.nonneg_iff.mpr | |
| constructor | |
| Β· have hz := h (quaternionVector v) | |
| rwa [β complexVector_quadratic_re, complexVector_quaternionVector] at hz | |
| Β· exact (hermitian_quadratic_im (complexify_isHermitian hA) v).symm | |
| theorem complexify_posDef_iff {n : β} | |
| {A : Matrix (Fin n) (Fin n) (Quaternion β)} (hA : A.IsHermitian) : | |
| (complexify A).PosDef β β z β 0, 0 < (OAI.Analysis.PDE.Dirichlet.quaternionForm A z).re := by | |
| constructor | |
| Β· intro h z hz | |
| have hcz : complexVector z β 0 := by | |
| intro heq | |
| exact hz ((complexVector_injective n) (heq.trans (complexVector_zero n).symm)) | |
| have hq := h.dotProduct_mulVec_pos hcz | |
| have hre := (Complex.pos_iff.mp hq).1 | |
| simpa only [complexVector_quadratic_re] using hre | |
| Β· intro h | |
| refine Matrix.PosDef.of_dotProduct_mulVec_pos (complexify_isHermitian hA) ?_ | |
| intro v hv | |
| have hqv : quaternionVector v β 0 := by | |
| intro heq | |
| exact hv ((quaternionVector_injective n) (heq.trans (quaternionVector_zero n).symm)) | |
| apply Complex.pos_iff.mpr | |
| constructor | |
| Β· have hz := h (quaternionVector v) hqv | |
| rwa [β complexVector_quadratic_re, complexVector_quaternionVector] at hz | |
| Β· exact (hermitian_quadratic_im (complexify_isHermitian hA) v).symm | |
| /-- A nonnegative real coordinate Hessian produces a nonnegative quaternionic | |
| Hessian also in the faithful representation used to linearize the determinant. -/ | |
| theorem complexify_hessianMap_posSemidef {n s : β} (e : Fin s β Quaternion β) | |
| {H : Matrix (Fin n Γ Fin s) (Fin n Γ Fin s) β} (hH : H.PosSemidef) : | |
| (complexify (OAI.Analysis.Calculus.Quaternion.hessianMap e H)).PosSemidef := by | |
| apply (complexify_posSemidef_iff (OAI.Analysis.Calculus.Quaternion.hessianMap_isHermitian e H hH.isHermitian.isSymm)).mpr | |
| exact OAI.Analysis.PDE.Dirichlet.hessianMap_nonneg e hH | |
| /-- The determinant differential is nonnegative in an actual nonnegative real | |
| Hessian direction. The background positivity is expressed in quaternionic coordinates. -/ | |
| theorem mooreDifferential_hessianMap_nonneg {n s : β} | |
| (e : Fin s β Quaternion β) (A C : Matrix (Fin n) (Fin n) (Quaternion β)) | |
| (hA : A.IsHermitian) (hpos : β z β 0, 0 < (OAI.Analysis.PDE.Dirichlet.quaternionForm A z).re) | |
| (hAC : A * C = 1) (hCA : C * A = 1) (hdet : 0 β€ mooreDet n A) | |
| {H : Matrix (Fin n Γ Fin s) (Fin n Γ Fin s) β} (hH : H.PosSemidef) : | |
| 0 β€ mooreDifferential n A (OAI.Analysis.Calculus.Quaternion.hessianMap e H) := by | |
| exact mooreDifferential_nonneg n A (OAI.Analysis.Calculus.Quaternion.hessianMap e H) C | |
| ((complexify_posDef_iff hA).mpr hpos) (complexify_hessianMap_posSemidef e hH) | |
| hAC hCA hdet | |
| end OAI.LinearAlgebra.Moore | |