🏛️ Atlas✒️Formalizations.Combinatorics.Caballero.AngularStripCells view on GitHub ↗1 theorems
/-Copyright (c) 2026 Carles Marín. All rights reserved.Released under Apache 2.0 license as described in the file LICENSE.Authors: Carles Marín, Claude (AI assistant)-/module public import Formalizations.Combinatorics.Caballero.AngularGeneralA /-!# The cells of the first strip (Caballero, Part IV, Section 4) Opening paragraph of Section 4 of Part IV. Let a >= 1, 0 < theta <= 1/a and 0 < Lambda < b + a theta(a point of the vertical section), J = floor(Lambda), u = Lambda - J. Every coordinate c_h = clipfloor(Lambda + h theta) lies in {J-1, J, J+1}, so c has spread at most 2; and if J <= b-1, then c_h= J + floor(u + h theta). The hypothesis Lambda < b + a theta (the text says 'a point of thesection') gives J <= b and is needed for the first claim; off the lines is not needed. ## Main results * `CaballeroStripCells.strip_cell`: Section 4: c_h in [J-1, J+1], spread <= 2, and c_h = J + floor(u + h theta) when J <= b-1 ## References * C. Marín, How Many Dyck Words Do the Divisors of an Integer Make? IV. The Primary Phase of the Ambiguity Profile for General a, draft (2 December 2026), unpublished.* C. Marín, How Many Dyck Words Do the Divisors of an Integer Make? Exact Counts and Quasipolynomial Growth (Part I), Zenodo (2026), doi:10.5281/zenodo.24536372 (concept DOI).-/ @[expose] public section namespace CaballeroStripCells open CaballeroGeneralA /-- Section 4 of Part IV, opening paragraph. Let `0 < θ ≤ 1/a` and `0 < Λ < b + aθ` (a point of the section), `J = ⌊Λ⌋`, `u = Λ - J`. Then everycoordinate `c_h = clip ⌊Λ + hθ⌋` lies in `{J-1, J, J+1}`, so `c` has spread at most `2`; and if`J ≤ b - 1`, then `c_h = J + ⌊u + hθ⌋` (the clip does not act). The coordinate `c_h` is stored atindex `h + a`, so `h = k - a`. -/theorem strip_cell (a b : ℕ) (ha : 1 ≤ a) (Λ θ : ℝ) (hΛ : 0 < Λ) (hθ0 : 0 < θ)    (hθ : θ ≤ 1 / (a : ℝ)) (hΛb : Λ < (b : ℝ) + (a : ℝ) * θ) :    (∀ k : Fin (2 * a + 1), ⌊Λ⌋ - 1 ≤ cellVec a b Λ θ k ∧ cellVec a b Λ θ k ≤ ⌊Λ⌋ + 1) ∧      spread (cellVec a b Λ θ) ≤ 2 ∧      (⌊Λ⌋ ≤ (b : ℤ) - 1 → ∀ k : Fin (2 * a + 1),        cellVec a b Λ θ k = ⌊Λ⌋ + ⌊(Λ - ⌊Λ⌋) + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋) := by  have ha0 : (0 : ℝ) < a := by exact_mod_cast (by omega : 0 < a)  have haθ : (a : ℝ) * θ ≤ 1 := by    calc (a : ℝ) * θ ≤ a * (1 / a) := mul_le_mul_of_nonneg_left hθ ha0.le      _ = 1 := mul_one_div_cancel ha0.ne'  have hJ0 : 0 ≤ ⌊Λ⌋ := Int.floor_nonneg.mpr hΛ.le  have hJb : ⌊Λ⌋ ≤ (b : ℤ) := by    rw [Int.floor_le_iff]    push_cast    linarith  -- the unclipped floor lies in `[J-1, J+1]`  have hfl : ∀ k : Fin (2 * a + 1), ⌊Λ⌋ - 1 ≤ ⌊Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋ ∧      ⌊Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋ ≤ ⌊Λ⌋ + 1 := by    intro k    have hk := k.2    have h1 : -(a : ℝ) ≤ ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) := by push_cast; linarith [(Nat.cast_nonneg (k : ℕ) : (0 : ℝ) ≤ (k : ℕ))]    have h2 : ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) ≤ a := by      have : ((k : ℕ) : ℝ) ≤ 2 * a := by exact_mod_cast (by omega : (k : ℕ) ≤ 2 * a)      push_cast; linarith    have hlo : -1 ≤ ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ := by nlinarith    have hhi : ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ ≤ 1 := by nlinarith    constructor    · have : ⌊Λ + (-1 : ℝ)⌋ ≤ ⌊Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋ := Int.floor_mono (by linarith)      rw [show Λ + (-1 : ℝ) = Λ - ((1 : ℤ) : ℝ) by push_cast; ring, Int.floor_sub_intCast] at this      linarith    · have : ⌊Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋ ≤ ⌊Λ + ((1 : ℤ) : ℝ)⌋ := Int.floor_mono (by push_cast at hhi ⊢; linarith)      rw [Int.floor_add_intCast] at this      linarith  have hbound : ∀ k : Fin (2 * a + 1), ⌊Λ⌋ - 1 ≤ cellVec a b Λ θ k ∧ cellVec a b Λ θ k ≤ ⌊Λ⌋ + 1 := by    intro k    obtain ⟨l, u⟩ := hfl k    unfold cellVec CaballeroPeaks.clip    constructor    · apply le_min      · linarith      · exact le_trans l (le_max_right _ _)    · exact min_le_of_right_le (max_le (by omega) u)  refine ⟨hbound, ?_, ?_⟩  · have := hbound    unfold spread    have h1 : Finset.univ.sup' ⟨⟨0, by omega⟩, Finset.mem_univ _⟩ (cellVec a b Λ θ) ≤ ⌊Λ⌋ + 1 :=      Finset.sup'_le _ _ fun k _ => (hbound k).2    have h2 : ⌊Λ⌋ - 1 ≤ Finset.univ.inf' ⟨⟨0, by omega⟩, Finset.mem_univ _⟩ (cellVec a b Λ θ) :=      Finset.le_inf' _ _ fun k _ => (hbound k).1    linarith  · intro hJb k    obtain ⟨l, u⟩ := hfl k    have hc : cellVec a b Λ θ k = ⌊Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ⌋ := by      unfold cellVec CaballeroPeaks.clip      rw [max_eq_right (by omega), min_eq_right (by omega)]    rw [hc]    have e : Λ + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ =        ((Λ - ⌊Λ⌋) + ((((k : ℕ) : ℤ) - a : ℤ) : ℝ) * θ) + ((⌊Λ⌋ : ℤ) : ℝ) := by ring    rw [e, Int.floor_add_intCast]    ring end CaballeroStripCells