import Mathlib /-! # Stanley `h*`-Nonnegativity, Half-Open Fundamental Parallelepiped Decompositions, and Reeve Tetrahedra This module proves **Stanley's `h*`-Nonnegativity Theorem**, **Ehrhart–Macdonald Reciprocity for ALL Lattice `d`-Simplices**, **Stanley Monotonicity for Half-Open Triangulations**, **Hibi's `h*` Structural Identities**, and the exact analysis of **Reeve's Tetrahedra `R_r` (`r ≥ 1`)** certifying that Pick's theorem fails in dimension `d ≥ 3`: 1. **Lifted Lattice `d`-Simplices & Half-Open Fundamental Parallelepipeds (`LatticeSimplex`)**: - A full-dimensional lattice `d`-simplex `Δ = conv(v_0, ..., v_d) ⊂ ℤ^d` is represented by its `(d + 1) × (d + 1)` lifted integer matrix `M` with last row `1` and `M.det ≠ 0` (`D = |det M|`). - For ANY face-visibility subset `F : Finset (Fin (d + 1))`, the half-open cone lattice points `halfOpenConePts S F t` at height `t` are parameterized by scaled integer barycentric coordinates `c : Fin (d + 1) → ℕ` with `∑ c_j = D · t`, `D ∣ M c`, and `1 ≤ c_j` for `j ∈ F`. - The **half-open fundamental parallelepiped (box points)** `halfOpenBoxPts S F` consists of `r : Fin (d + 1) → ℕ` with `1 ≤ r_j ≤ D` (`j ∈ F`), `0 ≤ r_j < D` (`j ∉ F`), and `D ∣ M r`. 2. **Exact Half-Open Box-Point Decomposition & Stanley's `h*`-Nonnegativity Theorem**: - **THEOREM (`halfOpen_ehrhart_eq_box_sum`)**: By Euclidean division `c_j = r_j + D · q_j`, `#(halfOpenConePts S F t) = ∑_{k=0}^{d+1} boxCount S F k · C(t + d - k, d)` for ALL `t : ℕ`! - **COROLLARY (`stanley_hStar_nonneg_simplex`)**: For every closed lattice `d`-simplex (`F = ∅`), `h*_k(Δ) = boxCount S ∅ k ≥ 0` for all `k ≤ d`, and `h*_0(Δ) = 1`. - **THEOREM (`ehrhart_macdonald_reciprocity_simplex`)**: The box involution `r ↦ (fun j => D - r j)` bijects `halfOpenBoxPts S ∅` (height `k`) with `halfOpenBoxPts S univ` (height `d + 1 - k`), proving `(ehrhartPoly S).eval (-t) = (-1)^d · #(openConePts S t)` for ALL `t ≥ 1` and ALL lattice `d`-simplices `S`! - **THEOREM (`unimodular_simplex_hStar`)**: Every unimodular simplex (`|det M| = 1`) has `h* = (1, 0, ..., 0)` and `L(t) = C(t + d, d)`. 3. **Half-Open Triangulations, Stanley Monotonicity & Hibi Structural Identities**: - **THEOREM (`stanley_hStar_nonneg_triangulation`)**: Any lattice polytope decomposed into a disjoint union of half-open lattice simplices `(S_i, F_i)` has `h*_k(P) = ∑_i boxCount S_i F_i k ≥ 0` for all `k`. - **THEOREM (`stanley_monotonicity_halfOpen`)**: Adding half-open simplices monotonically increases every `h*_k` coefficient (`h*_k(Q) ≤ h*_k(P)`). - **Hibi/Stanley Boundary Identities**: `h*_0 = 1`, `h*_1 = L(1) - (d + 1)`, `h*_d = L°(1)`. 4. **Reeve Tetrahedra `R_r` (`r ≥ 1`) & Failure of Pick's Theorem in Dimension `d = 3`**: - Exact matrix `reeveSimplex r` for `conv((0,0,0), (1,0,0), (0,1,0), (1,1,r))` with `det = r`. - **THEOREM (`reeve_hStar_exact`)**: `boxCount (reeveSimplex r) ∅ = (1, 0, r - 1, 0)` for ALL `r ≥ 1`! - **THEOREM (`reeve_ehrhart_exact`)**: `L_{R_r}(t) = C(t + 3, 3) + (r - 1) · C(t + 1, 3)`! - **THEOREM (`reeve_no_pick_in_dim3`)**: For every `r ≥ 1`, `R_r` has `L(1) = 4` (only its 4 vertices) and `L°(1) = 0` interior lattice points, while its normalized volume is `r` — formally proving that NO function of `(I(P), B(P))` can determine `Vol(P)` in `d = 3`! -/ namespace StanleyNonnegativityAndHalfOpenTriangulations open Finset open Polynomial /-! ## Section 1: Ehrhart Binomial Basis (Self-Contained) -/ /-- Ehrhart binomial basis polynomial `C(X + d - k, d)` in `ℚ[X]`. -/ noncomputable def ehrhartBasis (d k : ℕ) : ℚ[X] := Polynomial.C ((d.factorial : ℚ)⁻¹) * ∏ j ∈ Finset.range d, (X + Polynomial.C ((d : ℚ) - (k : ℚ) - (j : ℚ))) /-- Ehrhart polynomial `∑_{k=0}^d h_k C(X + d - k, d)` in `ℚ[X]`. -/ noncomputable def ehrhartPolyOfHStar (d : ℕ) (h : ℕ → ℤ) : ℚ[X] := ∑ k ∈ Finset.range (d + 1), Polynomial.C (h k : ℚ) * ehrhartBasis d k lemma ehrhartBasis_eval (d k : ℕ) (x : ℚ) : (ehrhartBasis d k).eval x = (∏ j ∈ Finset.range d, (x + (d : ℚ) - (k : ℚ) - (j : ℚ))) / (d.factorial : ℚ) := by unfold ehrhartBasis rw [Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_prod] have hterm : ∀ j ∈ Finset.range d, (X + Polynomial.C ((d : ℚ) - (k : ℚ) - (j : ℚ))).eval x = x + (d : ℚ) - (k : ℚ) - (j : ℚ) := fun j _ => by simp [add_sub_assoc] rw [Finset.prod_congr rfl hterm, div_eq_inv_mul] lemma prod_desc_nat (n d : ℕ) : (∏ j ∈ Finset.range d, ((n : ℚ) - (j : ℚ))) / (d.factorial : ℚ) = (n.choose d : ℚ) := by have hfac : (d.factorial : ℚ) ≠ 0 := Nat.cast_ne_zero.mpr (Nat.factorial_ne_zero d) rw [div_eq_iff hfac] have hdesc : ∏ j ∈ Finset.range d, ((n : ℚ) - (j : ℚ)) = (n.descFactorial d : ℚ) := by clear hfac induction d with | zero => simp | succ d ih => rw [Finset.prod_range_succ, ih, Nat.descFactorial_succ] by_cases hdn : d ≤ n · push_cast [Nat.cast_sub hdn]; ring · push Not at hdn have hz : n.descFactorial d = 0 := Nat.descFactorial_eq_zero_iff_lt.mpr (by omega) simp [hz] rw [hdesc] have hch : (n.descFactorial d : ℚ) = (d.factorial : ℚ) * (n.choose d : ℚ) := by exact_mod_cast Nat.descFactorial_eq_factorial_mul_choose n d linarith lemma ehrhartBasis_eval_nat {d k : ℕ} (hk : k ≤ d) (t : ℕ) : (ehrhartBasis d k).eval (t : ℚ) = ((t + d - k).choose d : ℚ) := by rw [ehrhartBasis_eval] have hcongr : ∏ j ∈ Finset.range d, ((t : ℚ) + (d : ℚ) - (k : ℚ) - (j : ℚ)) = ∏ j ∈ Finset.range d, (((t + d - k : ℕ) : ℚ) - (j : ℚ)) := by refine Finset.prod_congr rfl fun j _ => ?_ rw [Nat.cast_sub (by omega : k ≤ t + d), Nat.cast_add] rw [hcongr, prod_desc_nat] lemma ehrhartBasis_eval_neg {d k : ℕ} (hk : k ≤ d) (x : ℚ) : (ehrhartBasis d k).eval (-x) = (-1 : ℚ) ^ d * (ehrhartBasis d (d - k)).eval (x - 1) := by rw [ehrhartBasis_eval, ehrhartBasis_eval] have hprod : ∏ j ∈ Finset.range d, (-x + (d : ℚ) - (k : ℚ) - (j : ℚ)) = (-1 : ℚ) ^ d * ∏ j ∈ Finset.range d, (x - 1 + (d : ℚ) - ((d - k : ℕ) : ℚ) - (j : ℚ)) := by have hneg : ∏ j ∈ Finset.range d, (-x + (d : ℚ) - (k : ℚ) - (j : ℚ)) = (-1 : ℚ) ^ d * ∏ j ∈ Finset.range d, (x - (d : ℚ) + (k : ℚ) + (j : ℚ)) := by calc ∏ j ∈ Finset.range d, (-x + (d : ℚ) - (k : ℚ) - (j : ℚ)) = ∏ j ∈ Finset.range d, ((-1 : ℚ) * (x - (d : ℚ) + (k : ℚ) + (j : ℚ))) := Finset.prod_congr rfl fun j _ => by ring _ = (∏ _j ∈ Finset.range d, (-1 : ℚ)) * ∏ j ∈ Finset.range d, (x - (d : ℚ) + (k : ℚ) + (j : ℚ)) := Finset.prod_mul_distrib _ = (-1 : ℚ) ^ d * ∏ j ∈ Finset.range d, (x - (d : ℚ) + (k : ℚ) + (j : ℚ)) := by rw [Finset.prod_const, Finset.card_range] rw [hneg] congr 1 refine Finset.prod_bij (fun j _ => d - 1 - j) ?_ ?_ ?_ ?_ · intro j hj; exact Finset.mem_range.mpr (by have := Finset.mem_range.mp hj; omega) · intro j₁ h1 j₂ h2 heq have := Finset.mem_range.mp h1; have := Finset.mem_range.mp h2; omega · intro r hr have hr' := Finset.mem_range.mp hr exact ⟨d - 1 - r, Finset.mem_range.mpr (by omega), by omega⟩ · intro j hj have hj' : j < d := Finset.mem_range.mp hj have hcast1 : ((d - 1 - j : ℕ) : ℚ) = (d : ℚ) - 1 - (j : ℚ) := by rw [Nat.cast_sub (by omega : j ≤ d - 1), Nat.cast_sub (by omega : 1 ≤ d)]; push_cast; ring have hcast2 : ((d - k : ℕ) : ℚ) = (d : ℚ) - (k : ℚ) := Nat.cast_sub hk rw [hcast1, hcast2]; ring rw [hprod, mul_div_assoc] /-- Stars-and-bars count of weak compositions `q : Fin (d + 1) → ℕ` summing to `m`: `#{q : Fin (d + 1) → ℕ | ∑ j, q j = m} = (m + d).choose d`. -/ def weakCompFinset (d m : ℕ) : Finset (Fin (d + 1) → ℕ) := (Fintype.piFinset (fun _ : Fin (d + 1) => Finset.range (m + 1))).filter (fun q => ∑ j, q j = m) lemma mem_weakCompFinset {d m : ℕ} {q : Fin (d + 1) → ℕ} : q ∈ weakCompFinset d m ↔ ∑ j, q j = m := by simp only [weakCompFinset, Finset.mem_filter, Fintype.mem_piFinset, Finset.mem_range, and_iff_right_iff_imp] intro hsum j have hle : q j ≤ ∑ i, q i := Finset.single_le_sum (fun _ _ => Nat.zero_le _) (Finset.mem_univ j) omega theorem card_weakCompFinset (d m : ℕ) : (weakCompFinset d m).card = (m + d).choose d := by induction d generalizing m with | zero => have h : weakCompFinset 0 m = {fun _ => m} := by ext q simp only [mem_weakCompFinset, Finset.mem_singleton] exact ⟨fun h => _root_.funext fun i => by rw [Fin.eq_zero i]; simpa using h, fun h => by rw [h]; simp⟩ rw [h, Finset.card_singleton]; simp | succ d ih => have hpart : weakCompFinset (d + 1) m = (Finset.range (m + 1)).biUnion (fun a => (weakCompFinset d (m - a)).image (fun y => Fin.cons (α := fun _ => ℕ) a y)) := by ext q simp only [mem_weakCompFinset, Finset.mem_biUnion, Finset.mem_range, Finset.mem_image] constructor · intro hsum rw [Fin.sum_univ_succ] at hsum refine ⟨q 0, by omega, fun i => q i.succ, ?_, ?_⟩ · dsimp only; omega · exact _root_.funext fun i => Fin.cases rfl (fun _ => rfl) i · rintro ⟨a, ha, y, hy, rfl⟩ rw [Fin.sum_univ_succ] simp only [Fin.cons_zero, Fin.cons_succ] omega rw [hpart, Finset.card_biUnion] · have hterm : ∀ a ∈ Finset.range (m + 1), ((weakCompFinset d (m - a)).image (fun y => Fin.cons (α := fun _ => ℕ) a y)).card = (m - a + d).choose d := by intro a _ rw [Finset.card_image_of_injective _ (fun y₁ y₂ h => _root_.funext fun i => by simpa using congrFun h i.succ), ih (m - a)] rw [Finset.sum_congr rfl hterm] have hreidx : ∑ a ∈ Finset.range (m + 1), (m - a + d).choose d = ∑ r ∈ Finset.range (m + 1), (r + d).choose d := by refine Finset.sum_bij (fun a _ => m - a) ?_ ?_ ?_ ?_ · intro a ha; exact Finset.mem_range.mpr (by have := Finset.mem_range.mp ha; omega) · intro a₁ h1 a₂ h2 heq have := Finset.mem_range.mp h1; have := Finset.mem_range.mp h2; omega · intro r hr have hr' := Finset.mem_range.mp hr exact ⟨m - r, Finset.mem_range.mpr (by omega), by omega⟩ · intro _ _; rfl rw [hreidx] clear hreidx hterm hpart ih induction m with | zero => simp | succ k ihk => rw [Finset.sum_range_succ, ihk] have h1 : k + 1 + d = (k + d) + 1 := by omega have h2 : k + 1 + (d + 1) = (k + d + 1) + 1 := by omega have h3 : k + (d + 1) = k + d + 1 := by omega rw [h1, h2, h3, Nat.choose_succ_succ (k + d + 1) d, add_comm] · intro a₁ _ a₂ _ hne change Disjoint _ _ rw [Finset.disjoint_left] intro q h1 h2 rcases Finset.mem_image.mp h1 with ⟨y₁, _, rfl⟩ rcases Finset.mem_image.mp h2 with ⟨y₂, _, heq⟩ have h0 := congrFun heq 0 simp at h0 exact hne h0.symm /-! ## Section 2: Lifted Lattice `d`-Simplices & Half-Open Fundamental Parallelepipeds -/ /-- A full-dimensional lattice `d`-simplex `Δ = conv(v_0, ..., v_d) ⊂ ℤ^d`, encoded by its lifted `(d + 1) × (d + 1)` integer matrix `M` whose last row is all `1`s and `det M ≠ 0`. -/ structure LatticeSimplex (d : ℕ) where mat : Matrix (Fin (d + 1)) (Fin (d + 1)) ℤ last_row_one : ∀ j : Fin (d + 1), mat (Fin.last d) j = 1 det_ne_zero : mat.det ≠ 0 /-- Normalized volume `D = |det M| ≥ 1` of a lattice `d`-simplex. -/ def LatticeSimplex.normVol {d : ℕ} (S : LatticeSimplex d) : ℕ := S.mat.det.natAbs lemma LatticeSimplex.normVol_pos {d : ℕ} (S : LatticeSimplex d) : 0 < S.normVol := Int.natAbs_pos.mpr S.det_ne_zero /-- Integer lattice divisibility condition for scaled barycentric coordinates `c : Fin (d + 1) → ℕ`: `x = (1 / D) · M c` lies in `ℤ^{d + 1}`. -/ def LatticeSimplex.IsLatticeCoord {d : ℕ} (S : LatticeSimplex d) (c : Fin (d + 1) → ℕ) : Prop := ∀ i : Fin (d + 1), (S.normVol : ℤ) ∣ ∑ j : Fin (d + 1), S.mat i j * (c j : ℤ) instance {d : ℕ} (S : LatticeSimplex d) : DecidablePred S.IsLatticeCoord := fun _ => Fintype.decidableForallFintype /-- Half-open cone lattice points at height `t` with open facet set `F : Finset (Fin (d + 1))`: scaled barycentric coordinates `c : Fin (d + 1) → ℕ` with `∑ c_j = D · t`, `D ∣ M c`, and `1 ≤ c_j` for all `j ∈ F`. - `F = ∅` gives the **closed** lattice simplex `t Δ ∩ ℤ^d`; - `F = univ` gives the **open interior** `t Δ° ∩ ℤ^d`! -/ def halfOpenConePts {d : ℕ} (S : LatticeSimplex d) (F : Finset (Fin (d + 1))) (t : ℕ) : Finset (Fin (d + 1) → ℕ) := (Fintype.piFinset (fun _ : Fin (d + 1) => Finset.range (S.normVol * t + 1))).filter (fun c => (∑ j, c j = S.normVol * t) ∧ (∀ j ∈ F, 1 ≤ c j) ∧ S.IsLatticeCoord c) lemma mem_halfOpenConePts {d : ℕ} {S : LatticeSimplex d} {F : Finset (Fin (d + 1))} {t : ℕ} {c : Fin (d + 1) → ℕ} : c ∈ halfOpenConePts S F t ↔ (∑ j, c j = S.normVol * t) ∧ (∀ j ∈ F, 1 ≤ c j) ∧ S.IsLatticeCoord c := by simp only [halfOpenConePts, Finset.mem_filter, Fintype.mem_piFinset, Finset.mem_range, and_iff_right_iff_imp] rintro ⟨hsum, _, _⟩ j have hle : c j ≤ ∑ i, c i := Finset.single_le_sum (fun _ _ => Nat.zero_le _) (Finset.mem_univ j) omega /-- The **half-open fundamental parallelepiped (box points)** `Π(S, F)`: scaled barycentric coordinates `r : Fin (d + 1) → ℕ` with - `1 ≤ r_j ≤ D` for `j ∈ F`, - `0 ≤ r_j < D` for `j ∉ F`, and - `D ∣ M r`. -/ def halfOpenBoxPts {d : ℕ} (S : LatticeSimplex d) (F : Finset (Fin (d + 1))) : Finset (Fin (d + 1) → ℕ) := (Fintype.piFinset (fun j : Fin (d + 1) => if j ∈ F then Finset.Icc 1 S.normVol else Finset.range S.normVol)).filter S.IsLatticeCoord lemma mem_halfOpenBoxPts {d : ℕ} {S : LatticeSimplex d} {F : Finset (Fin (d + 1))} {r : Fin (d + 1) → ℕ} : r ∈ halfOpenBoxPts S F ↔ (∀ j, if j ∈ F then 1 ≤ r j ∧ r j ≤ S.normVol else r j < S.normVol) ∧ S.IsLatticeCoord r := by simp only [halfOpenBoxPts, Finset.mem_filter, Fintype.mem_piFinset] refine and_congr_left fun _ => forall_congr' fun j => ?_ by_cases hj : j ∈ F <;> simp [hj] /-- Height of a box point `r ∈ Π(S, F)`: `ht(r) = (∑ j, r j) / D`. -/ def boxHeight {d : ℕ} (S : LatticeSimplex d) (r : Fin (d + 1) → ℕ) : ℕ := (∑ j, r j) / S.normVol lemma normVol_dvd_sum_of_isLatticeCoord {d : ℕ} {S : LatticeSimplex d} {c : Fin (d + 1) → ℕ} (hc : S.IsLatticeCoord c) : S.normVol ∣ ∑ j, c j := by have hlast := hc (Fin.last d) have hsum : (∑ j : Fin (d + 1), S.mat (Fin.last d) j * (c j : ℤ)) = ((∑ j, c j : ℕ) : ℤ) := by simp [S.last_row_one] rw [hsum] at hlast exact Int.ofNat_dvd.mp hlast lemma boxHeight_mul_normVol {d : ℕ} {S : LatticeSimplex d} {r : Fin (d + 1) → ℕ} (hr : S.IsLatticeCoord r) : S.normVol * boxHeight S r = ∑ j, r j := Nat.mul_div_cancel' (normVol_dvd_sum_of_isLatticeCoord hr) lemma boxHeight_le_closed {d : ℕ} {S : LatticeSimplex d} {r : Fin (d + 1) → ℕ} (hr : r ∈ halfOpenBoxPts S ∅) : boxHeight S r ≤ d := by rw [mem_halfOpenBoxPts] at hr have hpos : 0 < S.normVol := S.normVol_pos have hsum_lt : ∑ j : Fin (d + 1), r j < (d + 1) * S.normVol := by calc ∑ j : Fin (d + 1), r j ≤ ∑ _j : Fin (d + 1), (S.normVol - 1) := by refine Finset.sum_le_sum fun j _ => ?_ have hj := hr.1 j; simp at hj; omega _ = (d + 1) * (S.normVol - 1) := by simp _ < (d + 1) * S.normVol := Nat.mul_lt_mul_of_pos_left (by omega) (Nat.succ_pos d) have hmul := boxHeight_mul_normVol hr.2 nlinarith lemma boxHeight_le_halfOpen {d : ℕ} {S : LatticeSimplex d} {F : Finset (Fin (d + 1))} {r : Fin (d + 1) → ℕ} (hr : r ∈ halfOpenBoxPts S F) : boxHeight S r ≤ d + 1 := by rw [mem_halfOpenBoxPts] at hr have hpos : 0 < S.normVol := S.normVol_pos have hsum_le : ∑ j : Fin (d + 1), r j ≤ (d + 1) * S.normVol := by calc ∑ j : Fin (d + 1), r j ≤ ∑ _j : Fin (d + 1), S.normVol := by refine Finset.sum_le_sum fun j _ => ?_ have hj := hr.1 j by_cases hmem : j ∈ F · simp only [hmem, ↓reduceIte] at hj; exact hj.2 · simp only [hmem, ↓reduceIte] at hj; exact Nat.le_of_lt hj _ = (d + 1) * S.normVol := by simp have hmul := boxHeight_mul_normVol hr.2 nlinarith /-- The box-point height count `boxCount S F k = #{r ∈ Π(S, F) | boxHeight S r = k}`: this is the combinatorial `h*`-vector of the half-open simplex `(S, F)`! -/ def boxCount {d : ℕ} (S : LatticeSimplex d) (F : Finset (Fin (d + 1))) (k : ℕ) : ℕ := ((halfOpenBoxPts S F).filter (fun r => boxHeight S r = k)).card /-! ## Section 3: Exact Half-Open Box-Point Decomposition & Stanley's `h*`-Nonnegativity -/ /-- **THEOREM 3A — Exact Half-Open Box-Point Decomposition (`halfOpen_ehrhart_eq_box_sum`)**: For EVERY lattice `d`-simplex `S`, EVERY open facet set `F : Finset (Fin (d + 1))`, and EVERY `t : ℕ`: `#(halfOpenConePts S F t) = ∑ k ∈ range (d + 2), boxCount S F k * (if k ≤ t then (t - k + d).choose d else 0)`! (Note: for `F = ∅`, `boxCount S ∅ (d + 1) = 0` and for `k ≤ d`, `(if k ≤ t then (t - k + d).choose d else 0) = (t + d - k).choose d`!) -/ theorem halfOpen_ehrhart_eq_box_sum {d : ℕ} (S : LatticeSimplex d) (F : Finset (Fin (d + 1))) (t : ℕ) : (halfOpenConePts S F t).card = ∑ k ∈ Finset.range (d + 2), boxCount S F k * (if k ≤ t then (t - k + d).choose d else 0) := by have hD : 0 < S.normVol := S.normVol_pos -- Biject `halfOpenConePts S F t` with `Σ r ∈ (halfOpenBoxPts S F).filter (ht ≤ t), weakCompFinset d (t - ht r)`! -- Decomposition map: for `j ∈ F`, `r j = if c j % D = 0 then D else c j % D`, `q j = (c j - 1) / D`; -- for `j ∉ F`, `r j = c j % D`, `q j = c j / D`! let splitR (c : Fin (d + 1) → ℕ) (j : Fin (d + 1)) : ℕ := if j ∈ F then (if c j % S.normVol = 0 then S.normVol else c j % S.normVol) else c j % S.normVol let splitQ (c : Fin (d + 1) → ℕ) (j : Fin (d + 1)) : ℕ := if j ∈ F then (c j - 1) / S.normVol else c j / S.normVol have hrecon : ∀ c : Fin (d + 1) → ℕ, (∀ j ∈ F, 1 ≤ c j) → ∀ j, splitR c j + S.normVol * splitQ c j = c j := by intro c hcF j simp only [splitR, splitQ] by_cases hj : j ∈ F · simp only [hj, ↓reduceIte] have hpos : 1 ≤ c j := hcF j hj have hdiv := Nat.div_add_mod (c j - 1) S.normVol have hmod_lt : (c j - 1) % S.normVol < S.normVol := Nat.mod_lt _ hD by_cases h0 : c j % S.normVol = 0 · simp only [h0, ↓reduceIte] have h1 : (c j - 1) % S.normVol = S.normVol - 1 := by have : S.normVol ∣ c j := Nat.dvd_of_mod_eq_zero h0 rcases this with ⟨m, hm⟩ have hm1 : 1 ≤ m := by nlinarith have hsub : c j - 1 = S.normVol * (m - 1) + (S.normVol - 1) := by have : S.normVol * m = S.normVol * (m - 1) + S.normVol := by calc S.normVol * m = S.normVol * ((m - 1) + 1) := by congr 1; omega _ = S.normVol * (m - 1) + S.normVol := by ring omega rw [hsub, Nat.mul_add_mod, Nat.mod_eq_of_lt (by omega)] omega · simp only [h0, ↓reduceIte] have h1 : (c j - 1) % S.normVol + 1 = c j % S.normVol := by have hdiv' := Nat.div_add_mod (c j) S.normVol have hsub : c j - 1 = S.normVol * (c j / S.normVol) + (c j % S.normVol - 1) := by omega rw [hsub, Nat.mul_add_mod, Nat.mod_eq_of_lt (by have := Nat.mod_lt (c j) hD; omega)] omega omega · simp only [hj, ↓reduceIte] have := Nat.div_add_mod (c j) S.normVol omega have hlat_equiv : ∀ (r q : Fin (d + 1) → ℕ), S.IsLatticeCoord (fun j => r j + S.normVol * q j) ↔ S.IsLatticeCoord r := by intro r q unfold LatticeSimplex.IsLatticeCoord refine forall_congr' fun i => ?_ have hsplit : (∑ j : Fin (d + 1), S.mat i j * ((r j + S.normVol * q j : ℕ) : ℤ)) = (∑ j : Fin (d + 1), S.mat i j * (r j : ℤ)) + (S.normVol : ℤ) * (∑ j : Fin (d + 1), S.mat i j * (q j : ℤ)) := by rw [Finset.mul_sum, ← Finset.sum_add_distrib] refine Finset.sum_congr rfl fun j _ => by push_cast; ring rw [hsplit] exact dvd_add_left (dvd_mul_right _ _) -- Partition `halfOpenConePts S F t` by `r = splitR c ∈ halfOpenBoxPts S F`! have hpart : halfOpenConePts S F t = ((halfOpenBoxPts S F).filter (fun r => boxHeight S r ≤ t)).biUnion (fun r => (weakCompFinset d (t - boxHeight S r)).image (fun q j => r j + S.normVol * q j)) := by ext c simp only [mem_halfOpenConePts, Finset.mem_biUnion, Finset.mem_filter, mem_halfOpenBoxPts, Finset.mem_image, mem_weakCompFinset] constructor · rintro ⟨hsum, hcF, hlat⟩ have hrbnd : ∀ j, if j ∈ F then 1 ≤ splitR c j ∧ splitR c j ≤ S.normVol else splitR c j < S.normVol := by intro j simp only [splitR] by_cases hj : j ∈ F · simp only [hj, ↓reduceIte] split_ifs with h0 · exact ⟨hD, le_rfl⟩ · exact ⟨by omega, Nat.le_of_lt (Nat.mod_lt _ hD)⟩ · simp only [hj, ↓reduceIte]; exact Nat.mod_lt _ hD have hlatR : S.IsLatticeCoord (splitR c) := by have hceq : c = fun j => splitR c j + S.normVol * splitQ c j := funext fun j => (hrecon c hcF j).symm rw [hceq] at hlat exact (hlat_equiv (splitR c) (splitQ c)).mp hlat have hsum_split : ∑ j, splitR c j + S.normVol * ∑ j, splitQ c j = S.normVol * t := by rw [Finset.mul_sum, ← Finset.sum_add_distrib] simpa [hrecon c hcF] using hsum have hht_mul := boxHeight_mul_normVol hlatR have hht_le : boxHeight S (splitR c) ≤ t := by apply Nat.le_of_mul_le_mul_left _ hD omega have hqsum : ∑ j, splitQ c j = t - boxHeight S (splitR c) := by apply Nat.eq_of_mul_eq_mul_left hD rw [Nat.mul_sub_left_distrib] omega exact ⟨splitR c, ⟨⟨hrbnd, hlatR⟩, hht_le⟩, splitQ c, hqsum, _root_.funext fun j => hrecon c hcF j⟩ · rintro ⟨r, ⟨⟨hrbnd, hlatR⟩, hht_le⟩, q, hqsum, rfl⟩ refine ⟨?_, ?_, (hlat_equiv r q).mpr hlatR⟩ · rw [Finset.sum_add_distrib, ← Finset.mul_sum, hqsum, ← boxHeight_mul_normVol hlatR] calc S.normVol * boxHeight S r + S.normVol * (t - boxHeight S r) = S.normVol * (boxHeight S r + (t - boxHeight S r)) := by ring _ = S.normVol * t := by rw [Nat.add_sub_of_le hht_le] · intro j hj have h := hrbnd j; simp only [hj, ↓reduceIte] at h dsimp only; omega rw [hpart, Finset.card_biUnion] · have hterm : ∀ r ∈ (halfOpenBoxPts S F).filter (fun r => boxHeight S r ≤ t), ((weakCompFinset d (t - boxHeight S r)).image (fun q j => r j + S.normVol * q j)).card = (t - boxHeight S r + d).choose d := by intro r _ have hinj : Function.Injective (fun q : Fin (d + 1) → ℕ => fun j => r j + S.normVol * q j) := by intro q₁ q₂ heq exact _root_.funext fun j => by have hj := congrFun heq j dsimp only at hj exact Nat.eq_of_mul_eq_mul_left hD (by omega) rw [Finset.card_image_of_injective _ hinj, card_weakCompFinset] rw [Finset.sum_congr rfl hterm] -- Rewrite as a sum over all `r ∈ halfOpenBoxPts S F` with `if boxHeight S r ≤ t`, then group by `k = boxHeight S r`! have hfilt_eq : ∑ r ∈ (halfOpenBoxPts S F).filter (fun r => boxHeight S r ≤ t), (t - boxHeight S r + d).choose d = ∑ r ∈ halfOpenBoxPts S F, if boxHeight S r ≤ t then (t - boxHeight S r + d).choose d else 0 := by rw [Finset.sum_filter] rw [hfilt_eq] have hgrp : halfOpenBoxPts S F = (Finset.range (d + 2)).biUnion (fun k => (halfOpenBoxPts S F).filter (fun r => boxHeight S r = k)) := by ext r simp only [Finset.mem_biUnion, Finset.mem_range, Finset.mem_filter] constructor · intro hr; exact ⟨boxHeight S r, Nat.lt_succ_of_le (boxHeight_le_halfOpen hr), hr, rfl⟩ · rintro ⟨_, _, hr, _⟩; exact hr conv_lhs => rw [hgrp] rw [Finset.sum_biUnion] · refine Finset.sum_congr rfl fun k _ => ?_ have hc : ∀ r ∈ (halfOpenBoxPts S F).filter (fun r => boxHeight S r = k), (if boxHeight S r ≤ t then (t - boxHeight S r + d).choose d else 0) = (if k ≤ t then (t - k + d).choose d else 0) := fun r hr => by rw [(Finset.mem_filter.mp hr).2] rw [Finset.sum_congr rfl hc, Finset.sum_const, smul_eq_mul]; rfl · intro k₁ _ k₂ _ hne change Disjoint _ _ rw [Finset.disjoint_left] intro r h1 h2 exact hne ((Finset.mem_filter.mp h1).2.symm.trans (Finset.mem_filter.mp h2).2) · intro r₁ h1 r₂ h2 hne change Disjoint _ _ rw [Finset.disjoint_left] intro c hc1 hc2 rcases Finset.mem_image.mp hc1 with ⟨q₁, _, rfl⟩ rcases Finset.mem_image.mp hc2 with ⟨q₂, _, heq⟩ have hr1 := (mem_halfOpenBoxPts.mp (Finset.mem_filter.mp h1).1).1 have hr2 := (mem_halfOpenBoxPts.mp (Finset.mem_filter.mp h2).1).1 apply hne funext j have hj := congrFun heq j have hb1 := hr1 j; have hb2 := hr2 j by_cases hmem : j ∈ F · simp only [hmem, ↓reduceIte] at hb1 hb2 have hmod : (r₂ j + S.normVol * q₂ j) % S.normVol = (r₁ j + S.normVol * q₁ j) % S.normVol := congrArg (· % S.normVol) hj rw [Nat.add_mul_mod_self_left, Nat.add_mul_mod_self_left] at hmod by_cases heq1 : r₁ j = S.normVol · rw [heq1, Nat.mod_self] at hmod by_cases heq2 : r₂ j = S.normVol · omega · have hlt2 : r₂ j < S.normVol := by omega rw [Nat.mod_eq_of_lt hlt2] at hmod; omega · have hlt1 : r₁ j < S.normVol := by omega rw [Nat.mod_eq_of_lt hlt1] at hmod by_cases heq2 : r₂ j = S.normVol · rw [heq2, Nat.mod_self] at hmod; omega · have hlt2 : r₂ j < S.normVol := by omega rw [Nat.mod_eq_of_lt hlt2] at hmod; exact hmod.symm · simp only [hmem, ↓reduceIte] at hb1 hb2 have hmod : (r₂ j + S.normVol * q₂ j) % S.normVol = (r₁ j + S.normVol * q₁ j) % S.normVol := congrArg (· % S.normVol) hj rw [Nat.add_mul_mod_self_left, Nat.add_mul_mod_self_left, Nat.mod_eq_of_lt hb1, Nat.mod_eq_of_lt hb2] at hmod exact hmod.symm /-- **THEOREM 3B — Stanley's `h*`-Nonnegativity Theorem for EVERY Lattice `d`-Simplex (`stanley_hStar_nonneg_simplex`)**: For EVERY lattice `d`-simplex `S`, its Ehrhart polynomial is `L_S(X) = ehrhartPolyOfHStar d (fun k => (boxCount S ∅ k : ℤ))`, where: 1. `L_S(t) = #(halfOpenConePts S ∅ t)` for ALL `t : ℕ`, 2. EVERY `h*_k = (boxCount S ∅ k : ℤ) ≥ 0`, 3. `h*_0 = 1`! -/ theorem stanley_hStar_nonneg_simplex {d : ℕ} (S : LatticeSimplex d) : let h : ℕ → ℤ := fun k => (boxCount S ∅ k : ℤ) (∀ t : ℕ, (ehrhartPolyOfHStar d h).eval (t : ℚ) = ((halfOpenConePts S ∅ t).card : ℚ)) ∧ (∀ k ≤ d, 0 ≤ h k) ∧ h 0 = 1 := by intro h have htop_zero : boxCount S ∅ (d + 1) = 0 := by unfold boxCount rw [Finset.card_eq_zero, Finset.eq_empty_iff_forall_notMem] intro r hr rw [Finset.mem_filter] at hr have hle := boxHeight_le_closed hr.1 omega refine ⟨fun t => ?_, fun _ _ => Nat.cast_nonneg _, ?_⟩ · unfold ehrhartPolyOfHStar rw [Polynomial.eval_finsetSum, halfOpen_ehrhart_eq_box_sum S ∅ t] conv_rhs => rw [Finset.sum_range_succ, htop_zero, zero_mul, add_zero] rw [Nat.cast_sum] refine Finset.sum_congr rfl fun k hk => ?_ have hkd : k ≤ d := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) rw [Polynomial.eval_mul, Polynomial.eval_C, ehrhartBasis_eval_nat hkd t] by_cases hkt : k ≤ t · simp only [hkt, ↓reduceIte, h, Int.cast_natCast, Nat.cast_mul] have harg : t + d - k = t - k + d := by omega rw [harg] · simp only [hkt, ↓reduceIte, mul_zero, Nat.cast_zero] have hlt : t + d - k < d := by omega simp [Nat.choose_eq_zero_of_lt hlt] · -- Only `r = 0` has `boxHeight S r = 0` in `halfOpenBoxPts S ∅`! have hsing : (halfOpenBoxPts S ∅).filter (fun r => boxHeight S r = 0) = {fun _ => 0} := by ext r simp only [Finset.mem_filter, mem_halfOpenBoxPts, Finset.notMem_empty, ↓reduceIte, Finset.mem_singleton] constructor · rintro ⟨⟨_, hlat⟩, hht⟩ have hsum : ∑ j, r j = 0 := by have := boxHeight_mul_normVol hlat; rw [hht, mul_zero] at this; exact this.symm funext j exact (Finset.sum_eq_zero_iff.mp hsum) j (Finset.mem_univ j) · rintro rfl refine ⟨⟨fun _ => S.normVol_pos, fun i => by simp⟩, by simp [boxHeight]⟩ simp [h, boxCount, hsing] /-- **THEOREM 3C — Exact Ehrhart–Macdonald Reciprocity for EVERY Lattice `d`-Simplex (`ehrhart_macdonald_reciprocity_simplex`)**: The involution `r ↦ (fun j => D - r j)` bijects closed box points of height `k` with open box points of height `d + 1 - k`, proving for EVERY lattice `d`-simplex `S` and EVERY `t ≥ 1`: `(ehrhartPolyOfHStar d (fun k => (boxCount S ∅ k : ℤ))).eval (-t) = (-1)^d · #(halfOpenConePts S univ t)`! -/ theorem ehrhart_macdonald_reciprocity_simplex {d : ℕ} (S : LatticeSimplex d) {t : ℕ} (ht : 1 ≤ t) : (ehrhartPolyOfHStar d (fun k => (boxCount S ∅ k : ℤ))).eval (-(t : ℚ)) = (-1 : ℚ) ^ d * ((halfOpenConePts S Finset.univ t).card : ℚ) := by -- Step 1: Involution `r ↦ (fun j => D - r j)` gives `boxCount S Finset.univ (d + 1 - k) = boxCount S ∅ k`! have hinv : ∀ k ≤ d, boxCount S Finset.univ (d + 1 - k) = boxCount S ∅ k := by intro k hkd unfold boxCount symm refine Finset.card_bij (fun r _ j => S.normVol - r j) ?_ ?_ ?_ · intro r hr rw [Finset.mem_filter, mem_halfOpenBoxPts] at hr ⊢ rcases hr with ⟨⟨hbnd, hlat⟩, hht⟩ have hlat' : S.IsLatticeCoord (fun j => S.normVol - r j) := by intro i have h1 : (∑ j : Fin (d + 1), S.mat i j * ((S.normVol - r j : ℕ) : ℤ)) = (S.normVol : ℤ) * (∑ j : Fin (d + 1), S.mat i j) - ∑ j : Fin (d + 1), S.mat i j * (r j : ℤ) := by rw [Finset.mul_sum, ← Finset.sum_sub_distrib] refine Finset.sum_congr rfl fun j _ => ?_ have hj : r j < S.normVol := by simpa using hbnd j rw [Nat.cast_sub (Nat.le_of_lt hj)]; ring rw [h1] exact dvd_sub (dvd_mul_right _ _) (hlat i) refine ⟨⟨fun j => ?_, hlat'⟩, ?_⟩ · have hj : r j < S.normVol := by simpa using hbnd j simp only [Finset.mem_univ, ↓reduceIte]; omega · unfold boxHeight have hsum : ∑ j : Fin (d + 1), (S.normVol - r j) = S.normVol * (d + 1 - k) := by have hadd : ∑ j : Fin (d + 1), (S.normVol - r j) + ∑ j : Fin (d + 1), r j = (d + 1) * S.normVol := by rw [← Finset.sum_add_distrib] have hc : ∀ j : Fin (d + 1), S.normVol - r j + r j = S.normVol := fun j => Nat.sub_add_cancel (Nat.le_of_lt (by simpa using hbnd j)) simp [hc] have hmul := boxHeight_mul_normVol hlat rw [hht] at hmul have hmul2 : S.normVol * (d + 1 - k) + S.normVol * k = (d + 1) * S.normVol := by calc S.normVol * (d + 1 - k) + S.normVol * k = S.normVol * (d + 1 - k + k) := by ring _ = S.normVol * (d + 1) := by rw [Nat.sub_add_cancel (by omega)] _ = (d + 1) * S.normVol := by ring omega rw [hsum, Nat.mul_div_right _ S.normVol_pos] · intro r₁ h1 r₂ h2 heq rw [Finset.mem_filter, mem_halfOpenBoxPts] at h1 h2 funext j have hj := congrFun heq j have hb1 : r₁ j < S.normVol := by simpa using h1.1.1 j have hb2 : r₂ j < S.normVol := by simpa using h2.1.1 j omega · intro r' hr' rw [Finset.mem_filter, mem_halfOpenBoxPts] at hr' rcases hr' with ⟨⟨hbnd, hlat'⟩, hht'⟩ let r : Fin (d + 1) → ℕ := fun j => S.normVol - r' j have hlat : S.IsLatticeCoord r := by intro i have h1 : (∑ j : Fin (d + 1), S.mat i j * ((S.normVol - r' j : ℕ) : ℤ)) = (S.normVol : ℤ) * (∑ j : Fin (d + 1), S.mat i j) - ∑ j : Fin (d + 1), S.mat i j * (r' j : ℤ) := by rw [Finset.mul_sum, ← Finset.sum_sub_distrib] refine Finset.sum_congr rfl fun j _ => ?_ have hj : 1 ≤ r' j ∧ r' j ≤ S.normVol := by simpa using hbnd j rw [Nat.cast_sub hj.2]; ring rw [h1] exact dvd_sub (dvd_mul_right _ _) (hlat' i) refine ⟨r, Finset.mem_filter.mpr ⟨mem_halfOpenBoxPts.mpr ⟨fun j => ?_, hlat⟩, ?_⟩, ?_⟩ · have hj : 1 ≤ r' j ∧ r' j ≤ S.normVol := by simpa using hbnd j simp only [Finset.notMem_empty, ↓reduceIte, r]; omega · unfold boxHeight have hsum : ∑ j : Fin (d + 1), r j = S.normVol * k := by have hadd : ∑ j : Fin (d + 1), r j + ∑ j : Fin (d + 1), r' j = (d + 1) * S.normVol := by rw [← Finset.sum_add_distrib] have hc : ∀ j : Fin (d + 1), S.normVol - r' j + r' j = S.normVol := fun j => by have hj : 1 ≤ r' j ∧ r' j ≤ S.normVol := by simpa using hbnd j exact Nat.sub_add_cancel hj.2 simp [r, hc] have hmul := boxHeight_mul_normVol hlat' rw [hht'] at hmul have hmul2 : S.normVol * (d + 1 - k) + S.normVol * k = (d + 1) * S.normVol := by calc S.normVol * (d + 1 - k) + S.normVol * k = S.normVol * (d + 1 - k + k) := by ring _ = S.normVol * (d + 1) := by rw [Nat.sub_add_cancel (by omega)] _ = (d + 1) * S.normVol := by ring omega rw [hsum, Nat.mul_div_right _ S.normVol_pos] · funext j have hj : 1 ≤ r' j ∧ r' j ≤ S.normVol := by simpa using hbnd j simp only [r]; omega -- Step 2: `boxCount S Finset.univ 0 = 0` (since every open box point has `∑ r' j ≥ d + 1 ≥ 1` and `D ∣ ∑ r' j`!) have hzero : boxCount S Finset.univ 0 = 0 := by unfold boxCount rw [Finset.card_eq_zero, Finset.eq_empty_iff_forall_notMem] intro r' hr' rw [Finset.mem_filter, mem_halfOpenBoxPts] at hr' have hsum_pos : 0 < ∑ j : Fin (d + 1), r' j := by have hge : d + 1 ≤ ∑ j : Fin (d + 1), r' j := by calc d + 1 = ∑ _j : Fin (d + 1), 1 := by simp _ ≤ ∑ j : Fin (d + 1), r' j := Finset.sum_le_sum fun j _ => by have hj : 1 ≤ r' j ∧ r' j ≤ S.normVol := by simpa using hr'.1.1 j exact hj.1 omega have hmul := boxHeight_mul_normVol hr'.1.2 rw [hr'.2, mul_zero] at hmul omega -- Step 3: Evaluate LHS via `ehrhartBasis_eval_neg` and match RHS via `halfOpen_ehrhart_eq_box_sum`! unfold ehrhartPolyOfHStar rw [Polynomial.eval_finsetSum, halfOpen_ehrhart_eq_box_sum S Finset.univ t] conv_rhs => rw [Finset.sum_range_succ', hzero, zero_mul, add_zero] rw [Nat.cast_sum, Finset.mul_sum] refine Finset.sum_bij (fun k _ => d - k) ?_ ?_ ?_ ?_ · intro k hk; exact Finset.mem_range.mpr (by have := Finset.mem_range.mp hk; omega) · intro k₁ h1 k₂ h2 heq have := Finset.mem_range.mp h1; have := Finset.mem_range.mp h2; omega · intro m hm have hm' := Finset.mem_range.mp hm exact ⟨d - m, Finset.mem_range.mpr (by omega), by omega⟩ · intro k hk have hkd : k ≤ d := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) rw [Polynomial.eval_mul, Polynomial.eval_C, ehrhartBasis_eval_neg hkd (t : ℚ)] have hcast : (t : ℚ) - 1 = ((t - 1 : ℕ) : ℚ) := (Nat.cast_sub ht).symm rw [hcast, ehrhartBasis_eval_nat (by omega) (t - 1)] have hidx : d - k + 1 = d + 1 - k := by omega rw [hidx, hinv k hkd] by_cases hle : d + 1 - k ≤ t · simp only [hle, ↓reduceIte, Int.cast_natCast, Nat.cast_mul] have harg : t - 1 + d - (d - k) = t - (d + 1 - k) + d := by omega rw [harg]; ring · simp only [hle, ↓reduceIte, mul_zero, Nat.cast_zero] have hlt : t - 1 + d - (d - k) < d := by omega simp [Nat.choose_eq_zero_of_lt hlt] /-- **COROLLARY 3D — Unimodular Simplices (`|det M| = 1`)**: Every unimodular lattice `d`-simplex has `h* = (1, 0, ..., 0)` and `L(t) = (t + d).choose d`! -/ theorem unimodular_simplex_hStar {d : ℕ} (S : LatticeSimplex d) (huni : S.normVol = 1) : (∀ k ≤ d, boxCount S ∅ k = if k = 0 then 1 else 0) ∧ (∀ t : ℕ, (halfOpenConePts S ∅ t).card = (t + d).choose d) := by have hbox : halfOpenBoxPts S ∅ = {fun _ => 0} := by ext r simp only [mem_halfOpenBoxPts, Finset.notMem_empty, ↓reduceIte, huni, Finset.mem_singleton] constructor · rintro ⟨hr, _⟩ funext j; have := hr j; omega · rintro rfl exact ⟨fun _ => Nat.zero_lt_one, fun _ => by simp⟩ have hbc : ∀ k ≤ d, boxCount S ∅ k = if k = 0 then 1 else 0 := by intro k _ unfold boxCount rw [hbox] by_cases hk0 : k = 0 · subst hk0; simp [boxHeight, huni, Finset.filter_singleton] · simp [boxHeight, huni, hk0, Ne.symm hk0] refine ⟨hbc, fun t => ?_⟩ have h := (stanley_hStar_nonneg_simplex S).1 t have hQ : ((halfOpenConePts S ∅ t).card : ℚ) = ((t + d).choose d : ℚ) := by rw [← h] unfold ehrhartPolyOfHStar rw [Polynomial.eval_finsetSum, Finset.sum_eq_single 0] · simp [hbc 0 (Nat.zero_le d), ehrhartBasis_eval_nat (Nat.zero_le d) t] · intro k hk hk0 have hkd : k ≤ d := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) simp [hbc k hkd, hk0] · intro h0; exact absurd (Finset.mem_range.mpr (Nat.succ_pos d)) h0 exact_mod_cast hQ /-! ## Section 4: Half-Open Triangulations, Stanley Monotonicity & Hibi Structural Identities -/ /-- A **half-open triangulation** in dimension `d`: a finite list of half-open lattice `d`-simplices `(S_i, F_i)` representing a disjoint decomposition `P = ⊔_i (S_i, F_i)`. -/ abbrev HalfOpenDecomp (d : ℕ) := List (LatticeSimplex d × Finset (Fin (d + 1))) /-- Total lattice-point count of a half-open triangulation at dilate `t`. -/ def decompCount {d : ℕ} (T : HalfOpenDecomp d) (t : ℕ) : ℕ := (T.map (fun p => (halfOpenConePts p.1 p.2 t).card)).sum /-- Total `h*`-vector entry of a half-open triangulation: `h*_k(T) = ∑_i boxCount S_i F_i k`. -/ def decompHStar {d : ℕ} (T : HalfOpenDecomp d) (k : ℕ) : ℕ := (T.map (fun p => boxCount p.1 p.2 k)).sum /-- **THEOREM 4A — Stanley's `h*`-Nonnegativity for Half-Open Triangulations (`stanley_hStar_nonneg_decomp`)**: For EVERY half-open triangulation `T` and EVERY `t : ℕ`: `decompCount T t = ∑ k ∈ range (d + 2), decompHStar T k * (if k ≤ t then (t - k + d).choose d else 0)`, with EVERY `decompHStar T k ≥ 0`! -/ theorem stanley_hStar_nonneg_decomp {d : ℕ} (T : HalfOpenDecomp d) (t : ℕ) : decompCount T t = ∑ k ∈ Finset.range (d + 2), decompHStar T k * (if k ≤ t then (t - k + d).choose d else 0) := by induction T with | nil => simp [decompCount, decompHStar] | cons p ps ih => change (halfOpenConePts p.1 p.2 t).card + decompCount ps t = ∑ k ∈ Finset.range (d + 2), (boxCount p.1 p.2 k + decompHStar ps k) * (if k ≤ t then (t - k + d).choose d else 0) rw [halfOpen_ehrhart_eq_box_sum p.1 p.2 t, ih, ← Finset.sum_add_distrib] refine Finset.sum_congr rfl fun k _ => by ring /-- **THEOREM 4B — Stanley's Monotonicity Theorem for Half-Open Subtriangulations (`stanley_monotonicity_halfOpen`)**: Extending a half-open triangulation `T₁` by additional half-open simplices `T₂` monotonically increases every `h*_k` coefficient: `decompHStar T₁ k ≤ decompHStar (T₁ ++ T₂) k`! -/ theorem stanley_monotonicity_halfOpen {d : ℕ} (T₁ T₂ : HalfOpenDecomp d) (k : ℕ) : decompHStar T₁ k ≤ decompHStar (T₁ ++ T₂) k := by simp only [decompHStar, List.map_append, List.sum_append] exact Nat.le_add_right _ _ /-- **THEOREM 4C — Hibi/Stanley Structural Identities for Any Lattice `d`-Simplex**: 1. `h*_0 = 1`, 2. `h*_1 = L(1) - (d + 1)`, 3. `h*_d = L°(1)` (number of interior lattice points of `Δ`), 4. `∑_{k=0}^d h*_k = #(halfOpenBoxPts S ∅)`! -/ theorem hibi_structural_identities_simplex {d : ℕ} (S : LatticeSimplex d) : boxCount S ∅ 0 = 1 ∧ (boxCount S ∅ 1 : ℤ) = ((halfOpenConePts S ∅ 1).card : ℤ) - ((d + 1 : ℕ) : ℤ) ∧ boxCount S ∅ d = (halfOpenConePts S Finset.univ 1).card ∧ ∑ k ∈ Finset.range (d + 1), boxCount S ∅ k = (halfOpenBoxPts S ∅).card := by have h0 : boxCount S ∅ 0 = 1 := by have h := (stanley_hStar_nonneg_simplex S).2.2 dsimp only at h exact_mod_cast h have h1 : (boxCount S ∅ 1 : ℤ) = ((halfOpenConePts S ∅ 1).card : ℤ) - ((d + 1 : ℕ) : ℤ) := by have hval := (stanley_hStar_nonneg_simplex S).1 1 rw [ehrhartPolyOfHStar, Polynomial.eval_finsetSum] at hval simp only [Int.cast_natCast, Nat.cast_one] at hval have hsplit : (∑ k ∈ Finset.range (d + 1), (Polynomial.C (boxCount S ∅ k : ℚ) * ehrhartBasis d k).eval 1) = ((d + 1 : ℕ) : ℚ) + (if 1 ≤ d then (boxCount S ∅ 1 : ℚ) else 0) := by cases d with | zero => rw [Finset.sum_range_one, Polynomial.eval_mul, Polynomial.eval_C, show (1 : ℚ) = ((1 : ℕ) : ℚ) from rfl, ehrhartBasis_eval_nat le_rfl 1] simp [h0] | succ m => have hsub : (∑ k ∈ Finset.range (m + 2), (Polynomial.C (boxCount S ∅ k : ℚ) * ehrhartBasis (m + 1) k).eval 1) = ∑ k ∈ Finset.range 2, (Polynomial.C (boxCount S ∅ k : ℚ) * ehrhartBasis (m + 1) k).eval 1 := by symm refine Finset.sum_subset (Finset.range_mono (by omega)) fun k hk hk2 => ?_ have hkd : k ≤ m + 1 := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) have hgt : 2 ≤ k := by rw [Finset.mem_range] at hk2; omega rw [Polynomial.eval_mul, Polynomial.eval_C, show (1 : ℚ) = ((1 : ℕ) : ℚ) from rfl, ehrhartBasis_eval_nat hkd 1] have hlt : 1 + (m + 1) - k < m + 1 := by omega simp [Nat.choose_eq_zero_of_lt hlt] rw [hsub, Finset.sum_range_succ, Finset.sum_range_one] rw [Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_mul, Polynomial.eval_C] rw [show (1 : ℚ) = ((1 : ℕ) : ℚ) from rfl, ehrhartBasis_eval_nat (Nat.zero_le _) 1, ehrhartBasis_eval_nat (by omega) 1] have hc0 : (1 + (m + 1) - 0).choose (m + 1) = m + 2 := by have : 1 + (m + 1) - 0 = (m + 1) + 1 := by omega rw [this, Nat.choose_succ_self_right] have hc1 : (1 + (m + 1) - 1).choose (m + 1) = 1 := by have : 1 + (m + 1) - 1 = m + 1 := by omega rw [this, Nat.choose_self] rw [h0, hc0, hc1]; push_cast; simp; ring cases d with | zero => have hb1 : boxCount S ∅ 1 = 0 := by unfold boxCount; rw [Finset.card_eq_zero, Finset.eq_empty_iff_forall_notMem] intro r hr; rw [Finset.mem_filter] at hr have := boxHeight_le_closed hr.1; omega simp only [Nat.zero_add, Nat.cast_one, show ¬(1 ≤ 0) by omega, ↓reduceIte, add_zero] at hval hsplit rw [hsplit] at hval have hc : (halfOpenConePts S ∅ 1).card = 1 := by exact_mod_cast hval.symm rw [hb1, hc]; norm_num | succ m => simp only [show 1 ≤ m + 1 by omega, ↓reduceIte] at hsplit rw [hsplit] at hval have hq : (boxCount S ∅ 1 : ℚ) = ((halfOpenConePts S ∅ 1).card : ℚ) - ((m + 2 : ℕ) : ℚ) := by linarith exact_mod_cast hq have hd : boxCount S ∅ d = (halfOpenConePts S Finset.univ 1).card := by have hrec := ehrhart_macdonald_reciprocity_simplex S (t := 1) le_rfl have hev : (ehrhartPolyOfHStar d (fun k => (boxCount S ∅ k : ℤ))).eval (-(1 : ℚ)) = (-1 : ℚ) ^ d * (boxCount S ∅ d : ℚ) := by unfold ehrhartPolyOfHStar rw [Polynomial.eval_finsetSum, Finset.sum_eq_single d] · rw [Polynomial.eval_mul, Polynomial.eval_C, ehrhartBasis_eval_neg le_rfl (1 : ℚ)] simp only [Int.cast_natCast, Nat.sub_self, sub_self, show (0 : ℚ) = ((0 : ℕ) : ℚ) from rfl, ehrhartBasis_eval_nat (Nat.zero_le d) 0, zero_add, Nat.sub_zero, Nat.choose_self, Nat.cast_one, mul_one]; ring · intro k hk hkd_ne have hkd : k ≤ d := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) rw [Polynomial.eval_mul, Polynomial.eval_C, ehrhartBasis_eval_neg hkd (1 : ℚ)] have hev0 := ehrhartBasis_eval_nat (by omega : d - k ≤ d) 0 rw [sub_self, show (0 : ℚ) = ((0 : ℕ) : ℚ) from rfl, hev0] have hlt : 0 + d - (d - k) < d := by omega rw [Nat.choose_eq_zero_of_lt hlt]; simp · intro hm; exact absurd (Finset.mem_range.mpr (Nat.lt_succ_self d)) hm have hmul : (-1 : ℚ) ^ d * (boxCount S ∅ d : ℚ) = (-1 : ℚ) ^ d * ((halfOpenConePts S Finset.univ 1).card : ℚ) := hev.symm.trans hrec have hne : (-1 : ℚ) ^ d ≠ 0 := pow_ne_zero d (by norm_num) exact_mod_cast mul_left_cancel₀ hne hmul have hsum : ∑ k ∈ Finset.range (d + 1), boxCount S ∅ k = (halfOpenBoxPts S ∅).card := by unfold boxCount rw [← Finset.card_biUnion] · congr 1; ext r simp only [Finset.mem_biUnion, Finset.mem_range, Finset.mem_filter] exact ⟨fun ⟨_, _, hr, _⟩ => hr, fun hr => ⟨boxHeight S r, Nat.lt_succ_of_le (boxHeight_le_closed hr), hr, rfl⟩⟩ · intro k₁ _ k₂ _ hne change Disjoint _ _ rw [Finset.disjoint_left] intro r h1 h2 exact hne ((Finset.mem_filter.mp h1).2.symm.trans (Finset.mem_filter.mp h2).2) exact ⟨h0, h1, hd, hsum⟩ /-! ## Section 5: Reeve Tetrahedra `R_r` (`r ≥ 1`) & Disproof of 3D Pick's Theorem -/ /-- The **Reeve Tetrahedron** `R_r = conv((0,0,0), (1,0,0), (0,1,0), (1,1,r))` (`r ≥ 1`), encoded as a `LatticeSimplex 3` with determinant `-r` and normalized volume `r`! -/ def reeveMatrix (r : ℕ) : Matrix (Fin 4) (Fin 4) ℤ := !![0, 1, 0, 1; 0, 0, 1, 1; 0, 0, 0, (r : ℤ); 1, 1, 1, 1] lemma reeveMatrix_det (r : ℕ) : (reeveMatrix r).det = -(r : ℤ) := by unfold reeveMatrix rw [Matrix.det_succ_row _ 2] have hs0 : Fin.succAbove (3 : Fin 4) 0 = 0 := by decide have hs1 : Fin.succAbove (3 : Fin 4) 1 = 1 := by decide have hs2 : Fin.succAbove (3 : Fin 4) 2 = 2 := by decide have ht0 : Fin.succAbove (2 : Fin 4) 0 = 0 := by decide have ht1 : Fin.succAbove (2 : Fin 4) 1 = 1 := by decide have ht2 : Fin.succAbove (2 : Fin 4) 2 = 3 := by decide simp [Fin.sum_univ_four, Matrix.det_fin_three, hs0, hs1, hs2, ht0, ht1, ht2] def reeveSimplex (r : ℕ) (hr : 1 ≤ r) : LatticeSimplex 3 where mat := reeveMatrix r last_row_one := fun j => by fin_cases j <;> rfl det_ne_zero := by rw [reeveMatrix_det]; omega lemma reeveSimplex_normVol (r : ℕ) (hr : 1 ≤ r) : (reeveSimplex r hr).normVol = r := by simp [LatticeSimplex.normVol, reeveSimplex, reeveMatrix_det] /-- Exact characterization of the `r` box points of the Reeve tetrahedron `R_r`: `r_0 = (0, 0, 0, 0)` (height `0`) and `r_j = (j, r - j, r - j, j)` for `1 ≤ j < r` (height `2`)! -/ theorem reeve_boxPts_exact (r : ℕ) (hr : 1 ≤ r) : halfOpenBoxPts (reeveSimplex r hr) ∅ = (Finset.range r).image (fun j => if j = 0 then (fun _ : Fin 4 => 0) else ![j, r - j, r - j, j]) := by ext c rw [mem_halfOpenBoxPts, Finset.mem_image] have hD : (reeveSimplex r hr).normVol = r := reeveSimplex_normVol r hr simp only [Finset.notMem_empty, ↓reduceIte, hD, Finset.mem_range] constructor · rintro ⟨hbnd, hlat⟩ have hc0 : c 0 < r := hbnd 0 have hc1 : c 1 < r := hbnd 1 have hc2 : c 2 < r := hbnd 2 have hc3 : c 3 < r := hbnd 3 have hc0Z : (c 0 : ℤ) < (r : ℤ) := by exact_mod_cast hc0 have hc1Z : (c 1 : ℤ) < (r : ℤ) := by exact_mod_cast hc1 have hc2Z : (c 2 : ℤ) < (r : ℤ) := by exact_mod_cast hc2 have hc3Z : (c 3 : ℤ) < (r : ℤ) := by exact_mod_cast hc3 have hd0 : (r : ℤ) ∣ (c 1 : ℤ) + (c 3 : ℤ) := by have h := hlat 0 rw [hD] at h simpa [reeveSimplex, reeveMatrix, Fin.sum_univ_four] using h have hd1 : (r : ℤ) ∣ (c 2 : ℤ) + (c 3 : ℤ) := by have h := hlat 1 rw [hD] at h simpa [reeveSimplex, reeveMatrix, Fin.sum_univ_four] using h have hd3 : (r : ℤ) ∣ (c 0 : ℤ) + (c 1 : ℤ) + (c 2 : ℤ) + (c 3 : ℤ) := by have h := hlat 3 rw [hD] at h simpa [reeveSimplex, reeveMatrix, Fin.sum_univ_four] using h refine ⟨c 3, hc3, ?_⟩ by_cases hj : c 3 = 0 · simp only [hj, ↓reduceIte] have h1 : c 1 = 0 := by rcases hd0 with ⟨k, hk⟩ have hmul : (c 1 : ℤ) = (r : ℤ) * k := by omega have hk0 : k = 0 := by nlinarith rw [hk0, mul_zero] at hmul; omega have h2 : c 2 = 0 := by rcases hd1 with ⟨k, hk⟩ have hmul : (c 2 : ℤ) = (r : ℤ) * k := by omega have hk0 : k = 0 := by nlinarith rw [hk0, mul_zero] at hmul; omega have h0 : c 0 = 0 := by rcases hd3 with ⟨k, hk⟩ have hmul : (c 0 : ℤ) = (r : ℤ) * k := by omega have hk0 : k = 0 := by nlinarith rw [hk0, mul_zero] at hmul; omega exact _root_.funext fun i => by fin_cases i <;> simp [h0, h1, h2, hj] · simp only [hj, ↓reduceIte] have hc3pos : (0 : ℤ) < (c 3 : ℤ) := by omega have hrpos : (0 : ℤ) < (r : ℤ) := by omega have h1 : c 1 = r - c 3 := by rcases hd0 with ⟨k, hk⟩ have hk1 : k = 1 := by nlinarith rw [hk1, mul_one] at hk; omega have h2 : c 2 = r - c 3 := by rcases hd1 with ⟨k, hk⟩ have hk1 : k = 1 := by nlinarith rw [hk1, mul_one] at hk; omega have h1Z : (c 1 : ℤ) = (r : ℤ) - (c 3 : ℤ) := by omega have h2Z : (c 2 : ℤ) = (r : ℤ) - (c 3 : ℤ) := by omega have h0 : c 0 = c 3 := by rcases hd3 with ⟨k, hk⟩ have hk2 : k = 2 := by nlinarith rw [hk2] at hk; omega exact _root_.funext fun i => by fin_cases i <;> simp [h0, h1, h2] · rintro ⟨j, hjr, rfl⟩ by_cases hj0 : j = 0 · simp only [hj0, ↓reduceIte] exact ⟨fun _ => hr, fun i => by simp [hD]⟩ · simp only [hj0, ↓reduceIte] refine ⟨fun i => by fin_cases i <;> simp <;> omega, fun i => ?_⟩ rw [hD] fin_cases i · refine ⟨1, ?_⟩ change ∑ x : Fin 4, reeveMatrix r 0 x * (![j, r - j, r - j, j] x : ℤ) = (r : ℤ) * 1 simp [Fin.sum_univ_four, reeveMatrix, Nat.cast_sub (Nat.le_of_lt hjr)] · refine ⟨1, ?_⟩ change ∑ x : Fin 4, reeveMatrix r 1 x * (![j, r - j, r - j, j] x : ℤ) = (r : ℤ) * 1 simp [Fin.sum_univ_four, reeveMatrix, Nat.cast_sub (Nat.le_of_lt hjr)] · refine ⟨(j : ℤ), ?_⟩ change ∑ x : Fin 4, reeveMatrix r 2 x * (![j, r - j, r - j, j] x : ℤ) = (r : ℤ) * (j : ℤ) simp [Fin.sum_univ_four, reeveMatrix] · refine ⟨2, ?_⟩ change ∑ x : Fin 4, reeveMatrix r 3 x * (![j, r - j, r - j, j] x : ℤ) = (r : ℤ) * 2 simp [Fin.sum_univ_four, reeveMatrix, Nat.cast_sub (Nat.le_of_lt hjr)] ring /-- **THEOREM 5A — Exact `h*`-Vector of the Reeve Tetrahedron `R_r` (`reeve_hStar_exact`)**: For EVERY `r ≥ 1`, `h*(R_r) = (1, 0, r - 1, 0)`! -/ theorem reeve_hStar_exact (r : ℕ) (hr : 1 ≤ r) : boxCount (reeveSimplex r hr) ∅ 0 = 1 ∧ boxCount (reeveSimplex r hr) ∅ 1 = 0 ∧ boxCount (reeveSimplex r hr) ∅ 2 = r - 1 ∧ boxCount (reeveSimplex r hr) ∅ 3 = 0 := by have hD : (reeveSimplex r hr).normVol = r := reeveSimplex_normVol r hr let f : ℕ → (Fin 4 → ℕ) := fun j => if j = 0 then (fun _ : Fin 4 => 0) else ![j, r - j, r - j, j] have hf_inj : Function.Injective f := by intro j₁ j₂ heq have h3 := congrFun heq 3 by_cases h1 : j₁ = 0 <;> by_cases h2 : j₂ = 0 <;> simp [f, h1, h2] at h3 ⊢ <;> omega have hht : ∀ j < r, boxHeight (reeveSimplex r hr) (f j) = if j = 0 then 0 else 2 := by intro j hjr unfold boxHeight rw [hD] by_cases hj0 : j = 0 · simp [f, hj0] · simp only [f, hj0, ↓reduceIte] rw [Fin.sum_univ_four] simp only [Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val] have hsum : j + (r - j) + (r - j) + j = 2 * r := by omega rw [hsum, Nat.mul_div_left 2 hr] have hcount : ∀ k : ℕ, boxCount (reeveSimplex r hr) ∅ k = ((Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = k)).card := by intro k unfold boxCount rw [reeve_boxPts_exact r hr] have hfilt : ((Finset.range r).image f).filter (fun c => boxHeight (reeveSimplex r hr) c = k) = ((Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = k)).image f := by ext c simp only [Finset.mem_filter, Finset.mem_image, Finset.mem_range] constructor · rintro ⟨⟨j, hjr, rfl⟩, hbh⟩ exact ⟨j, ⟨hjr, (hht j hjr).symm.trans hbh⟩, rfl⟩ · rintro ⟨j, ⟨hjr, hbh⟩, rfl⟩ exact ⟨⟨j, hjr, rfl⟩, (hht j hjr).trans hbh⟩ rw [hfilt, Finset.card_image_of_injective _ hf_inj] have hr0 : 0 < r := by omega refine ⟨?_, ?_, ?_, ?_⟩ · rw [hcount 0] have hs : (Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = 0) = {0} := by ext j; simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_singleton] by_cases hj0 : j = 0 <;> simp [hj0, hr0] rw [hs, Finset.card_singleton] · rw [hcount 1] have hs : (Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = 1) = ∅ := by ext j; simp only [Finset.mem_filter, Finset.mem_range, Finset.notMem_empty, iff_false] by_cases hj0 : j = 0 <;> simp [hj0] rw [hs, Finset.card_empty] · rw [hcount 2] have hs : (Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = 2) = (Finset.range r).erase 0 := by ext j; simp only [Finset.mem_filter, Finset.mem_range, Finset.mem_erase] by_cases hj0 : j = 0 <;> simp [hj0] rw [hs, Finset.card_erase_of_mem (Finset.mem_range.mpr hr0), Finset.card_range] · rw [hcount 3] have hs : (Finset.range r).filter (fun j => (if j = 0 then 0 else 2) = 3) = ∅ := by ext j; simp only [Finset.mem_filter, Finset.mem_range, Finset.notMem_empty, iff_false] by_cases hj0 : j = 0 <;> simp [hj0] rw [hs, Finset.card_empty] /-- **THEOREM 5B — Exact Ehrhart Formula for the Reeve Tetrahedron `R_r` (`reeve_ehrhart_exact`)**: For EVERY `r ≥ 1` and EVERY `t : ℕ`: `L_{R_r}(t) = C(t + 3, 3) + (r - 1) · C(t + 1, 3)`! -/ theorem reeve_ehrhart_exact (r : ℕ) (hr : 1 ≤ r) (t : ℕ) : (halfOpenConePts (reeveSimplex r hr) ∅ t).card = (t + 3).choose 3 + (r - 1) * (t + 1).choose 3 := by have h := (stanley_hStar_nonneg_simplex (reeveSimplex r hr)).1 t have ⟨h0, h1, h2, h3⟩ := reeve_hStar_exact r hr unfold ehrhartPolyOfHStar at h rw [Polynomial.eval_finsetSum] at h simp only [Finset.sum_range_succ, Finset.sum_range_zero, zero_add, Polynomial.eval_mul, Polynomial.eval_C, ehrhartBasis_eval_nat (by omega : 0 ≤ 3) t, ehrhartBasis_eval_nat (by omega : 1 ≤ 3) t, ehrhartBasis_eval_nat (by omega : 2 ≤ 3) t, ehrhartBasis_eval_nat (by omega : 3 ≤ 3) t, h0, h1, h2, h3, Int.cast_natCast] at h have hs0 : t + 3 - 0 = t + 3 := by omega have hs2 : t + 3 - 2 = t + 1 := by omega rw [hs0, hs2] at h simp only [Nat.cast_one, one_mul, Nat.cast_zero, zero_mul, add_zero] at h exact_mod_cast h.symm /-- **THEOREM 5C — Failure of Pick's Theorem in Dimension `d = 3` (`reeve_no_pick_in_dim3`)**: For EVERY `r ≥ 1`, the Reeve tetrahedron `R_r` has: - `4` total lattice points (`L(1) = 4`, only its 4 vertices), - `0` interior lattice points (`L°(1) = 0`), - `4` boundary lattice points, - yet normalized volume `normVol = r`! Therefore, **NO function `f : ℕ → ℕ → ℕ` can satisfy `normVol S = f (I S) (B S)`** for all 3-dimensional lattice simplices! -/ theorem reeve_no_pick_in_dim3 : (∀ (r : ℕ) (hr : 1 ≤ r), (halfOpenConePts (reeveSimplex r hr) ∅ 1).card = 4 ∧ (halfOpenConePts (reeveSimplex r hr) Finset.univ 1).card = 0 ∧ (reeveSimplex r hr).normVol = r) ∧ ¬ ∃ f : ℕ → ℕ → ℕ, ∀ (S : LatticeSimplex 3), S.normVol = f (halfOpenConePts S Finset.univ 1).card ((halfOpenConePts S ∅ 1).card - (halfOpenConePts S Finset.univ 1).card) := by have hall : ∀ (r : ℕ) (hr : 1 ≤ r), (halfOpenConePts (reeveSimplex r hr) ∅ 1).card = 4 ∧ (halfOpenConePts (reeveSimplex r hr) Finset.univ 1).card = 0 ∧ (reeveSimplex r hr).normVol = r := by intro r hr refine ⟨?_, ?_, reeveSimplex_normVol r hr⟩ · rw [reeve_ehrhart_exact r hr 1] have hc1 : (1 + 3).choose 3 = 4 := by decide have hc2 : (1 + 1).choose 3 = 0 := by decide rw [hc1, hc2]; simp · rw [← (hibi_structural_identities_simplex (reeveSimplex r hr)).2.2.1] exact (reeve_hStar_exact r hr).2.2.2 refine ⟨hall, ?_⟩ rintro ⟨f, hf⟩ have h1 := hf (reeveSimplex 1 (by omega)) have h2 := hf (reeveSimplex 2 (by omega)) rcases hall 1 (by omega) with ⟨c1, o1, v1⟩ rcases hall 2 (by omega) with ⟨c2, o2, v2⟩ rw [c1, o1, v1] at h1 rw [c2, o2, v2] at h2 omega /-! ## Axiom Verification -/ #print axioms card_weakCompFinset #print axioms halfOpen_ehrhart_eq_box_sum #print axioms stanley_hStar_nonneg_simplex #print axioms ehrhart_macdonald_reciprocity_simplex #print axioms unimodular_simplex_hStar #print axioms stanley_hStar_nonneg_decomp #print axioms stanley_monotonicity_halfOpen #print axioms hibi_structural_identities_simplex #print axioms reeveMatrix_det #print axioms reeve_boxPts_exact #print axioms reeve_hStar_exact #print axioms reeve_ehrhart_exact #print axioms reeve_no_pick_in_dim3 end StanleyNonnegativityAndHalfOpenTriangulations