Download lean/ComparatorChallenges/HyperbolicCones.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 2.62 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/ComparatorChallenges/HyperbolicCones.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/ComparatorChallenges/HyperbolicCones.lean
-
curl -L -o HyperbolicCones.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/ComparatorChallenges/HyperbolicCones.lean
2.62 kB
| import Mathlib | |
| namespace OAI | |
| 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} | |
| theorem main_result : | |
| Module.finrank ℝ Ambient = 23 ∧ | |
| polynomial.IsHomogeneous 20 ∧ | |
| polynomial.totalDegree = 20 ∧ | |
| MvPolynomial.eval (coordinates basePoint) polynomial = 1 ∧ | |
| (∀ (x : Ambient) (z : ℂ), (linePolynomial x).aeval z = 0 → z.im = 0) ∧ | |
| ∀ (N : ℕ) (_hN : 0 < N) (L : Ambient →ₗ[ℝ] Sym N), | |
| cone ≠ {x | (L x : Mat N ℝ).PosSemidef} := by | |
| sorry | |
| end Paper256 | |
| end | |
| end OAI | |