Index of theproofnetwork/open-problems@860a535/Prove2Me/Definitions/Def_SantosHirsch_Counter_Setting.lean
qedmarket’s copy of theproofnetwork/open-problems@860a535, 3 Dec 2026original source ↗
/-From Prove2Me, definition `SantosHirsch_Counter_Setting` (https://prove2.me/definitions/0ebb9b4e-5708-4cec-9dfa-5193a0beace5). Apache-2.0 per Prove2Me's terms.-/import Mathlibimport Prove2Me.Definitions.Def_Hirsch_modelimport Prove2Me.Definitions.Def_Hirsch_walk open scoped RealInnerProductSpace namespace SantosHirsch.Counter noncomputable section /-- `IsFacetPresentation a b`: the H-polytope `{x | ∀ i, ⟪a i, x⟫ ≤ b i}` in `ℝ^d` isfull-dimensional (nonempty interior) and every one of its `n` inequalities is irredundant(dropping row `i` admits a point violating it). Together with boundedness this says thepolytope is a `d`-polytope whose `n` rows are in bijection with its facets. -/def IsFacetPresentation {d n : ℕ} (a : Fin n → EuclideanSpace ℝ (Fin d)) (b : Fin n → ℝ) : Prop := (interior (Hirsch.Hpoly a b)).Nonempty ∧ ∀ i, ∃ x, (∀ j, j ≠ i → ⟪a j, x⟫ ≤ b j) ∧ b i < ⟪a i, x⟫ /-- `IsNonHirsch a b`: the polytope `Hpoly a b` (a `d`-polytope with `n` facets when `a, b`is a bounded facet presentation) has combinatorial diameter greater than `n - d`. -/def IsNonHirsch {d n : ℕ} (a : Fin n → EuclideanSpace ℝ (Fin d)) (b : Fin n → ℝ) : Prop := ¬ Hirsch.DiamLE (Hirsch.Hpoly a b) (n - d) /-- `IsSpindle a b u v` (Definition 1.4): `u` and `v` are distinct vertices of`Hpoly a b` and every row (facet) is tight at exactly one of them. -/def IsSpindle {d n : ℕ} (a : Fin n → EuclideanSpace ℝ (Fin d)) (b : Fin n → ℝ) (u v : EuclideanSpace ℝ (Fin d)) : Prop := u ≠ v ∧ u ∈ Set.extremePoints ℝ (Hirsch.Hpoly a b) ∧ v ∈ Set.extremePoints ℝ (Hirsch.Hpoly a b) ∧ ∀ i, (⟪a i, u⟫ = b i ↔ ⟪a i, v⟫ ≠ b i) /-- Table 1 of Santos (p. 11), row by row: entries `0 … 23` are the vertices `1⁺ … 24⁺`,entries `24 … 47` are the vertices `1⁻ … 24⁻`, each as `(x₁, x₂, x₃, x₄, x₅)`. -/def santosMatrix : Fin 48 → Fin 5 → ℝ := ![![18, 0, 0, 0, 1], -- 1⁺ ![-18, 0, 0, 0, 1], -- 2⁺ ![0, 18, 0, 0, 1], -- 3⁺ ![0, -18, 0, 0, 1], -- 4⁺ ![0, 0, 45, 0, 1], -- 5⁺ ![0, 0, -45, 0, 1], -- 6⁺ ![0, 0, 0, 45, 1], -- 7⁺ ![0, 0, 0, -45, 1], -- 8⁺ ![15, 15, 0, 0, 1], -- 9⁺ ![-15, 15, 0, 0, 1], -- 10⁺ ![15, -15, 0, 0, 1], -- 11⁺ ![-15, -15, 0, 0, 1], -- 12⁺ ![0, 0, 30, 30, 1], -- 13⁺ ![0, 0, -30, 30, 1], -- 14⁺ ![0, 0, 30, -30, 1], -- 15⁺ ![0, 0, -30, -30, 1], -- 16⁺ ![0, 10, 40, 0, 1], -- 17⁺ ![0, -10, 40, 0, 1], -- 18⁺ ![0, 10, -40, 0, 1], -- 19⁺ ![0, -10, -40, 0, 1], -- 20⁺ ![10, 0, 0, 40, 1], -- 21⁺ ![-10, 0, 0, 40, 1], -- 22⁺ ![10, 0, 0, -40, 1], -- 23⁺ ![-10, 0, 0, -40, 1], -- 24⁺ ![0, 0, 0, 18, -1], -- 1⁻ ![0, 0, 0, -18, -1], -- 2⁻ ![0, 0, 18, 0, -1], -- 3⁻ ![0, 0, -18, 0, -1], -- 4⁻ ![45, 0, 0, 0, -1], -- 5⁻ ![-45, 0, 0, 0, -1], -- 6⁻ ![0, 45, 0, 0, -1], -- 7⁻ ![0, -45, 0, 0, -1], -- 8⁻ ![0, 0, 15, 15, -1], -- 9⁻ ![0, 0, 15, -15, -1], -- 10⁻ ![0, 0, -15, 15, -1], -- 11⁻ ![0, 0, -15, -15, -1], -- 12⁻ ![30, 30, 0, 0, -1], -- 13⁻ ![-30, 30, 0, 0, -1], -- 14⁻ ![30, -30, 0, 0, -1], -- 15⁻ ![-30, -30, 0, 0, -1], -- 16⁻ ![40, 0, 10, 0, -1], -- 17⁻ ![40, 0, -10, 0, -1], -- 18⁻ ![-40, 0, 10, 0, -1], -- 19⁻ ![-40, 0, -10, 0, -1], -- 20⁻ ![0, 40, 0, 10, -1], -- 21⁻ ![0, 40, 0, -10, -1], -- 22⁻ ![0, -40, 0, 10, -1], -- 23⁻ ![0, -40, 0, -10, -1]] -- 24⁻ /-- The 48 rows of Table 1 as vectors of `ℝ⁵`; they are the vertices of Santos'sprismatoid `Q` and, in the polar, the normals of the 48 facets of the spindle. -/def santosRows (i : Fin 48) : EuclideanSpace ℝ (Fin 5) := WithLp.toLp 2 (santosMatrix i) /-- The polar of Santos's prismatoid: `{x ∈ ℝ⁵ | ⟪r, x⟫ ≤ 1 for every row r of Table 1}`. -/def santosSpindle : Set (EuclideanSpace ℝ (Fin 5)) := Hirsch.Hpoly santosRows (fun _ => 1) /-- `e₅ = (0, 0, 0, 0, 1)`, the polar of the base facet `Q⁺ ⊂ {x₅ = 1}` (row A of Table 2). -/def apexPlus : EuclideanSpace ℝ (Fin 5) := EuclideanSpace.single (4 : Fin 5) 1 /-- `−e₅ = (0, 0, 0, 0, −1)`, the polar of the base facet `Q⁻ ⊂ {x₅ = −1}` (row L of Table 2). -/def apexMinus : EuclideanSpace ℝ (Fin 5) := EuclideanSpace.single (4 : Fin 5) (-1) /-- The ten letters `B, …, K` of Table 2 (the rows A and L are the two apices). -/inductive Letter | B | C | D | E | F | G | H | I | J | K deriving DecidableEq /-- Table 2 (p. 12): for a letter and `primed = false` (the type `X`) or `primed = true`(the type `X′`), the coefficients `(c₁, c₂, c₃, c₄)` of the coordinates `x₁, x₂, x₃, x₄`in the facet inequality `c₀ − c₅ x₅ ≥ ±c₁ x₁ ± c₂ x₂ ± c₃ x₃ ± c₄ x₄`. -/def typeCoeffs : Letter → Bool → Fin 4 → ℝ | .B, false => ![5, 1, 2, 1] | .B, true => ![1, 5, 1, 2] | .C, false => ![4, 2, 7 / 4, 5 / 4] | .C, true => ![2, 4, 5 / 4, 7 / 4] | .D, false => ![4, 1, 2, 1] | .D, true => ![1, 4, 1, 2] | .E, false => ![3, 3 / 2, 3 / 2, 1] | .E, true => ![3 / 2, 3, 1, 3 / 2] | .F, false => ![2, 1, 1, 1] | .F, true => ![1, 2, 1, 1] | .G, false => ![1, 1, 1, 2] | .G, true => ![1, 1, 2, 1] | .H, false => ![3 / 2, 1, 3 / 2, 3] | .H, true => ![1, 3 / 2, 3, 3 / 2] | .I, false => ![2, 1, 1, 4] | .I, true => ![1, 2, 4, 1] | .J, false => ![7 / 4, 5 / 4, 2, 4] | .J, true => ![5 / 4, 7 / 4, 4, 2] | .K, false => ![2, 1, 1, 5] | .K, true => ![1, 2, 5, 1] /-- Table 2: the coefficient `c₅` of `x₅` once the inequality is written as`±c₁x₁ ± c₂x₂ ± c₃x₃ ± c₄x₄ + c₅x₅ ≤ c₀` (so `c₅ = 135/2` for B, `−15` for G). It is thesame for `X` and `X′`. -/def typeC5 : Letter → ℝ | .B => 135 / 2 | .C => 45 | .D => 45 | .E => 30 | .F => 15 | .G => -15 | .H => -30 | .I => -45 | .J => -45 | .K => -135 / 2 /-- Table 2: the constant term `c₀` (the right-hand side). -/def typeRhs : Letter → ℝ | .B => 315 / 2 | .C => 135 | .D => 135 | .E => 105 | .F => 75 | .G => 75 | .H => 105 | .I => 135 | .J => 135 | .K => 315 / 2 /-- The sign `+1` (`true`) or `−1` (`false`). -/def sgn (s : Bool) : ℝ := if s then 1 else -1 /-- The polar point of the facet of type `(ℓ, primed)` with sign pattern `σ`:`(1 / c₀) • (σ₁c₁, σ₂c₂, σ₃c₃, σ₄c₄, c₅)`, so that the facet inequality reads`⟪facetPoint ℓ primed σ, x⟫ ≤ 1`. -/def facetPoint (ℓ : Letter) (primed : Bool) (σ : Fin 4 → Bool) : EuclideanSpace ℝ (Fin 5) := (1 / typeRhs ℓ) • WithLp.toLp 2 ![sgn (σ 0) * typeCoeffs ℓ primed 0, sgn (σ 1) * typeCoeffs ℓ primed 1, sgn (σ 2) * typeCoeffs ℓ primed 2, sgn (σ 3) * typeCoeffs ℓ primed 3, typeC5 ℓ] /-- The 32 polar points carrying the letter `ℓ` (types `ℓ` and `ℓ′`, 16 sign patterns each). -/def letterPoints (ℓ : Letter) : Set (EuclideanSpace ℝ (Fin 5)) := Set.range (fun p : Bool × (Fin 4 → Bool) => facetPoint ℓ p.1 p.2) /-- The 322 polar points of Table 2: `e₅` (row A), `−e₅` (row L) and the `20 × 16` pointsof the types `B, B′, …, K, K′`. -/def santosVertices : Set (EuclideanSpace ℝ (Fin 5)) := {apexPlus, apexMinus} ∪ ⋃ ℓ : Letter, letterPoints ℓ /-- The 32 orthogonal maps of p. 11 generating `Σ⁺`: sign changes of `x₁, …, x₄`(`swap = false`, the diagonal matrices), optionally composed with the simultaneoustranspositions `x₁ ↔ x₂`, `x₃ ↔ x₄` (`swap = true`, the second matrix). -/def sigmaPlusMap (s : Fin 4 → Bool) (swap : Bool) (x : EuclideanSpace ℝ (Fin 5)) : EuclideanSpace ℝ (Fin 5) := if swap then WithLp.toLp 2 ![sgn (s 0) * x 1, sgn (s 1) * x 0, sgn (s 2) * x 3, sgn (s 3) * x 2, x 4] else WithLp.toLp 2 ![sgn (s 0) * x 0, sgn (s 1) * x 1, sgn (s 2) * x 2, sgn (s 3) * x 3, x 4] /-- The orthogonal map `(x₁, x₂, x₃, x₄, x₅) ↦ (x₄, x₃, x₁, x₂, −x₅)` of p. 11, whichexchanges `Q⁺` and `Q⁻`. -/def sigmaSwap (x : EuclideanSpace ℝ (Fin 5)) : EuclideanSpace ℝ (Fin 5) := WithLp.toLp 2 ![x 3, x 2, x 0, x 1, -x 4] /-- The `Σ⁺`-orbit of `p`: its images under the 32 maps `sigmaPlusMap`. -/def sigmaPlusOrbit (p : EuclideanSpace ℝ (Fin 5)) : Set (EuclideanSpace ℝ (Fin 5)) := Set.range (fun g : (Fin 4 → Bool) × Bool => sigmaPlusMap g.1 g.2 p) /-- The `Σ`-orbit of `p`, for `Σ = Σ⁺ ∪ sigmaSwap ∘ Σ⁺` (64 maps). -/def sigmaOrbit (p : EuclideanSpace ℝ (Fin 5)) : Set (EuclideanSpace ℝ (Fin 5)) := sigmaPlusOrbit p ∪ sigmaSwap '' sigmaPlusOrbit p /-- The pairing of letters into `Σ`-orbits stated in Theorem 4.1: `B ∪ K`, `C ∪ J`,`D ∪ I`, `E ∪ H`, `F ∪ G`. -/def pairedLetter : Letter → Letter | .B => .K | .C => .J | .D => .I | .E => .H | .F => .G | .G => .F | .H => .E | .I => .D | .J => .C | .K => .B end end SantosHirsch.Counter