Download data/lean/OAI/Analysis/HyperbolicCones/Model.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.65 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HyperbolicCones/Model.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/HyperbolicCones/Model.lean
-
curl -L -o Model.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/HyperbolicCones/Model.lean
5.65 kB
| import Mathlib | |
| namespace OAI | |
| /-! The ChoiβLam form, determinant polynomial, root-defined cone, and quadratic deformation. -/ | |
| noncomputable section | |
| open scoped Matrix.Norms.L2Operator | |
| universe u | |
| namespace Paper256 | |
| abbrev Mat (n : β) (R : Type u) := Matrix (Fin n) (Fin n) R | |
| abbrev Sym (n : β) := selfAdjoint (Mat n β) | |
| instance instFiniteDimensionalSym (n : β) : FiniteDimensional β (Sym n) := | |
| FiniteDimensional.finiteDimensional_submodule (selfAdjoint.submodule β (Mat n β)) | |
| abbrev Ambient := (Sym 4 Γ Sym 4) Γ (Fin 3 β β) | |
| abbrev SymIndex := {ij : Fin 4 Γ Fin 4 // ij.1 β€ ij.2} | |
| abbrev Coord := (SymIndex β SymIndex) β Fin 3 | |
| def qMatrix {R : Type u} [CommRing R] (y : Fin 3 β R) : Mat 3 R := | |
| fun i j => if i = j then y i ^ 2 + y (i + 1) ^ 2 else -(y i * y j) | |
| def phi {R : Type u} [CommRing R] (y : Fin 3 β R) (X : Mat 4 R) : Mat 4 R := | |
| fun i j => Fin.cases | |
| (Fin.cases | |
| (Matrix.trace (qMatrix y * X.submatrix Fin.succ Fin.succ)) | |
| (fun j => -(β k, X 0 k.succ * qMatrix y k j)) j) | |
| (fun i => Fin.cases | |
| (-(β k, qMatrix y i k * X k.succ 0)) | |
| (fun j => X 0 0 * qMatrix y i j) j) i | |
| def matrixValue {R : Type u} [CommRing R] | |
| (X Z : Mat 4 R) (y : Fin 3 β R) : R := | |
| Matrix.det ((Matrix.det X) β’ Z - phi y (Matrix.adjugate X)) | |
| def symmetricCoordinates {R : Type u} (v : SymIndex β R) : Mat 4 R := | |
| fun i j => if h : i β€ j then v β¨(i, j), hβ© | |
| else v β¨(j, i), le_of_lt (lt_of_not_ge h)β© | |
| def polynomial : MvPolynomial Coord β := | |
| matrixValue | |
| (symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inl ij))) | |
| (symmetricCoordinates fun ij => MvPolynomial.X (Sum.inl (Sum.inr ij))) | |
| (fun i => MvPolynomial.X (Sum.inr i)) | |
| def coordinates (x : Ambient) : Coord β β := | |
| Sum.elim (Sum.elim | |
| (fun ij => (x.1.1 : Mat 4 β) ij.val.1 ij.val.2) | |
| (fun ij => (x.1.2 : Mat 4 β) ij.val.1 ij.val.2)) x.2 | |
| def basePoint : Ambient := ((1, 1), 0) | |
| def linePolynomial (x : Ambient) : Polynomial β := | |
| MvPolynomial.evalβ Polynomial.C | |
| (fun i => Polynomial.C (coordinates basePoint i) * Polynomial.X - | |
| Polynomial.C (coordinates x i)) polynomial | |
| def cone : Set Ambient := | |
| {x | β t : β, (linePolynomial x).aeval t = 0 β t.im = 0 β§ 0 β€ t.re} | |
| def choiLam {R : Type u} [CommRing R] (z y : Fin 3 β R) : R := | |
| (β i, z i ^ 2 * y i ^ 2) - | |
| 2 * (z 0 * y 0 * z 1 * y 1 + z 0 * y 0 * z 2 * y 2 + | |
| z 1 * y 1 * z 2 * y 2) + | |
| (β i, z i ^ 2 * y (i + 1) ^ 2) | |
| def zMatrix {R : Type u} [CommRing R] (z : Fin 3 β R) : Mat 3 R := | |
| fun i j => if i = j then z i ^ 2 + z (i + 2) ^ 2 else -(z i * z j) | |
| def intervalPolynomial (a b : β) : Polynomial β := | |
| (1 - Polynomial.C aβ»ΒΉ * Polynomial.X) * (1 + Polynomial.C bβ»ΒΉ * Polynomial.X) | |
| def timeScale (Ξ· t : β) : β := 1 + Ξ· * Real.sin (Real.pi * t) ^ 2 | |
| def deformedPolynomial (a b Ξ· t : β) : Polynomial β := | |
| (intervalPolynomial a b).comp (Polynomial.C (timeScale Ξ· t) * Polynomial.X) | |
| def rigidlyConvexSet (p : Polynomial β) : Set β := | |
| closure (connectedComponentIn {x : β | p.eval x β 0} 0) | |
| open scoped BigOperators RealInnerProductSpace | |
| open Set Filter Matrix | |
| abbrev Vec (n : β) := EuclideanSpace β (Fin n) | |
| def outer {n : β} (v : Vec n) : Mat n β := fun i j => v i * v j | |
| def outerSym {n : β} (v : Vec n) : Sym n := | |
| β¨outer v, by | |
| change (outer v)α΄΄ = outer v | |
| ext i j | |
| simp [outer, Matrix.conjTranspose_apply, mul_comm]β© | |
| def operatorNorm {m n : β} (A : Matrix (Fin m) (Fin n) β) : β := | |
| βA.toEuclideanLin.toContinuousLinearMapβ | |
| def kernelProjection {n : β} (A : Mat n β) : Mat n β := | |
| Matrix.toEuclideanLin.symm (A.toEuclideanLin.ker.starProjection.toLinearMap) | |
| def inverseSquareRoot {n : β} (A : Sym n) : Mat n β := | |
| let hA : (A : Mat n β).IsHermitian := A.property | |
| let U : Mat n β := hA.eigenvectorUnitary | |
| U * Matrix.diagonal (fun i => (Real.sqrt (hA.eigenvalues i))β»ΒΉ) * Uα΄΄ | |
| /-- The vector vβuβ²βuβvβ² in the rank-one and operator-norm identities. -/ | |
| def wedgeCoordinates (v u : Vec 4) : Fin 3 β β := | |
| fun i => v 0 * u i.succ - u 0 * v i.succ | |
| def tangentCurve (v h : Vec 4) (s : β) : Vec 4 := | |
| (Real.sqrt (1 + s ^ 2 * βhβ ^ 2))β»ΒΉ β’ (v + s β’ h) | |
| def tangentSpace (v : Vec 4) : Submodule β (Vec 4) := (innerSL β v).ker | |
| /-- Positive unital diagonal blocks with an exact Schur-complement equivalence. -/ | |
| structure NormalizedPencil where | |
| a : β | |
| c : β | |
| a_pos : 0 < a | |
| c_pos : 0 < c | |
| D : Sym 4 ββ[β] Sym a | |
| E : Sym 4 ββ[β] Sym c | |
| B : (Fin 3 β β) ββ[β] Matrix (Fin a) (Fin c) β | |
| D_positive : β X : Sym 4, (X : Mat 4 β).PosSemidef β (D X : Mat a β).PosSemidef | |
| E_positive : β X : Sym 4, (X : Mat 4 β).PosSemidef β (E X : Mat c β).PosSemidef | |
| D_unital : D 1 = 1 | |
| E_unital : E 1 = 1 | |
| schur_equivalence : β (X Z : Sym 4) (y : Fin 3 β β) (_hX : (X : Mat 4 β).PosDef), | |
| ((Z : Mat 4 β) - phi y (X : Mat 4 β)β»ΒΉ).PosSemidef β | |
| ((E Z : Mat c β) - (B y)α΅ * (D X : Mat a β)β»ΒΉ * B y).PosSemidef | |
| def NormalizedPencil.leftProjection (P : NormalizedPencil) (v : Vec 4) : Mat P.a β := | |
| kernelProjection (P.D (1 - outerSym v) : Mat P.a β) | |
| def NormalizedPencil.rightProjection (P : NormalizedPencil) (v : Vec 4) : Mat P.c β := | |
| kernelProjection (P.E (1 - outerSym v) : Mat P.c β) | |
| def deformedPencil (a b Ξ· t x : β) : Mat 2 β := | |
| Matrix.diagonal ![1 - timeScale Ξ· t * x / a, 1 + timeScale Ξ· t * x / b] | |
| def deformedCoefficients (a b Ξ· t : β) : Fin 3 β β := | |
| fun i => (deformedPolynomial a b Ξ· t).coeff i.val | |
| end Paper256 | |
| end | |
| end OAI | |