| @@ -186,21 +186,6 @@ theorem color_proper (D : ℝ) {L M : Label} (h : Adj D L M) : color L ≠ color |
| 186 | 186 | intro hc |
| 187 | 187 | exact colorData_proper D h ((Fintype.equivFin Palette).injective hc) |
| 188 | 188 | |
| 189 | | -/-- A reusable one-dimensional bound: overlapping intervals force the finer |
| 190 | | -grid index to lie within a fixed distance of the rescaled reference index. -/ |
| 191 | | -theorem normalized_index_gap (h h' B : ℝ) (i j : ℤ) (hh' : 0 < h') |
| 192 | | - (hratio : h / h' ≤ B) |
| 193 | | - (hgap : |h * (i : ℝ) - h' * (j : ℝ)| ≤ 2 * (h + h')) : |
| 194 | | - |h / h' * (i : ℝ) - (j : ℝ)| ≤ 2 * (B + 1) := by |
| 195 | | - calc |
| 196 | | - |h / h' * (i : ℝ) - (j : ℝ)| = |(h * (i : ℝ) - h' * (j : ℝ)) / h'| := by |
| 197 | | - congr 1 |
| 198 | | - field_simp |
| 199 | | - _ = |h * (i : ℝ) - h' * (j : ℝ)| / h' := by rw [abs_div, abs_of_pos hh'] |
| 200 | | - _ ≤ (2 * (h + h')) / h' := div_le_div_of_nonneg_right hgap hh'.le |
| 201 | | - _ = 2 * (h / h' + 1) := by field_simp |
| 202 | | - _ ≤ 2 * (B + 1) := by linarith |
| 203 | | - |
| 204 | 189 | theorem index_near_floor (c A : ℝ) (j : ℤ) (K : ℕ) |
| 205 | 190 | (hgap : |c - (j : ℝ)| ≤ A) (hK : A + 1 ≤ (K : ℝ)) : |
| 206 | 191 | |j - ⌊c⌋| ≤ (K : ℤ) := by |
| @@ -212,101 +197,11 @@ theorem index_near_floor (c A : ℝ) (j : ℤ) (K : ℕ) |
| 212 | 197 | have hreal : |(j : ℝ) - (⌊c⌋ : ℝ)| ≤ (K : ℝ) := by linarith |
| 213 | 198 | exact_mod_cast hreal |
| 214 | 199 | |
| 215 | | -def indexRadius (D : ℝ) : ℕ := ⌈2 * (ratioBound D + 1) + 1⌉₊ |
| 216 | | - |
| 217 | | -def indexCenter (D : ℝ) (L : Label) (m : ℕ) (j : Fin 3) : ℤ := |
| 218 | | - ⌊width D j L.1 / width D j m * (L.2.1 j : ℝ)⌋ |
| 219 | | - |
| 220 | | -def candidateGrids (D : ℝ) (L : Label) (m : ℕ) : Finset Grid := |
| 221 | | - Fintype.piFinset (fun j => Finset.Icc (indexCenter D L m j - (indexRadius D : ℤ)) |
| 222 | | - (indexCenter D L m j + (indexRadius D : ℤ))) |
| 223 | | - |
| 224 | | -def candidatesAtLevel (D : ℝ) (L : Label) (m : ℕ) : Finset Label := |
| 225 | | - ((candidateGrids D L m).product (Finset.univ : Finset Bool)).image (fun gs => (m, gs)) |
| 226 | | - |
| 227 | | -def candidates (D : ℝ) (L : Label) : Finset Label := |
| 228 | | - (Finset.Icc (L.1 - 4) (L.1 + 4)).biUnion (candidatesAtLevel D L) |
| 229 | | - |
| 230 | | -theorem adj_index_bound (D : ℝ) {L M : Label} (h : Adj D L M) (j : Fin 3) : |
| 231 | | - |M.2.1 j - indexCenter D L M.1 j| ≤ (indexRadius D : ℤ) := by |
| 232 | | - apply index_near_floor |
| 233 | | - · exact normalized_index_gap _ _ _ _ _ (width_pos D j h.right_positive) |
| 234 | | - (width_ratio_le D j h.left_positive h.right_positive h.left_level_le h.right_level_le) |
| 235 | | - (overlapping_centers D L M h.overlap j) |
| 236 | | - · exact Nat.le_ceil _ |
| 237 | | - |
| 238 | | -theorem adj_mem_candidates (D : ℝ) {L M : Label} (h : Adj D L M) : M ∈ candidates D L := by |
| 239 | | - apply Finset.mem_biUnion.mpr |
| 240 | | - refine ⟨M.1, ?_, ?_⟩ |
| 241 | | - · simp only [Finset.mem_Icc] |
| 242 | | - have h1 := h.left_level_le |
| 243 | | - have h2 := h.right_level_le |
| 244 | | - omega |
| 245 | | - · apply Finset.mem_image.mpr |
| 246 | | - refine ⟨M.2, ?_, rfl⟩ |
| 247 | | - apply Finset.mem_product.mpr |
| 248 | | - refine ⟨?_, Finset.mem_univ _⟩ |
| 249 | | - apply Fintype.mem_piFinset.mpr |
| 250 | | - intro j |
| 251 | | - have hj := abs_le.mp (adj_index_bound D h j) |
| 252 | | - simp only [Finset.mem_Icc] |
| 253 | | - omega |
| 254 | | - |
| 255 | 200 | theorem integer_interval_card (c : ℤ) (K : ℕ) : |
| 256 | 201 | (Finset.Icc (c - (K : ℤ)) (c + (K : ℤ))).card = 2 * K + 1 := by |
| 257 | 202 | rw [Int.card_Icc] |
| 258 | 203 | omega |
| 259 | 204 | |
| 260 | | -theorem candidateGrids_card (D : ℝ) (L : Label) (m : ℕ) : |
| 261 | | - (candidateGrids D L m).card = (2 * indexRadius D + 1) ^ 3 := by |
| 262 | | - unfold candidateGrids |
| 263 | | - rw [Fintype.card_piFinset] |
| 264 | | - simp only [integer_interval_card, Finset.prod_const, Finset.card_univ, Fintype.card_fin] |
| 265 | | - |
| 266 | | -theorem candidatesAtLevel_card_le (D : ℝ) (L : Label) (m : ℕ) : |
| 267 | | - (candidatesAtLevel D L m).card ≤ (2 * indexRadius D + 1) ^ 3 * 2 := by |
| 268 | | - calc |
| 269 | | - (candidatesAtLevel D L m).card ≤ |
| 270 | | - ((candidateGrids D L m).product (Finset.univ : Finset Bool)).card := Finset.card_image_le |
| 271 | | - _ = (2 * indexRadius D + 1) ^ 3 * 2 := by |
| 272 | | - change ((candidateGrids D L m) ×ˢ (Finset.univ : Finset Bool)).card = _ |
| 273 | | - simpa only [candidateGrids_card, Finset.card_univ, Fintype.card_bool] using |
| 274 | | - Finset.card_product (candidateGrids D L m) (Finset.univ : Finset Bool) |
| 275 | | - |
| 276 | | -def degreeBound (D : ℝ) : ℕ := 18 * (2 * indexRadius D + 1) ^ 3 |
| 277 | | - |
| 278 | | -theorem candidates_card_le (D : ℝ) (L : Label) : |
| 279 | | - (candidates D L).card ≤ degreeBound D := by |
| 280 | | - have hlevels : (Finset.Icc (L.1 - 4) (L.1 + 4)).card ≤ 9 := by |
| 281 | | - rw [Nat.card_Icc] |
| 282 | | - omega |
| 283 | | - calc |
| 284 | | - (candidates D L).card ≤ |
| 285 | | - ∑ m ∈ Finset.Icc (L.1 - 4) (L.1 + 4), (candidatesAtLevel D L m).card := |
| 286 | | - Finset.card_biUnion_le |
| 287 | | - _ ≤ ∑ _m ∈ Finset.Icc (L.1 - 4) (L.1 + 4), (2 * indexRadius D + 1) ^ 3 * 2 := |
| 288 | | - Finset.sum_le_sum (fun m _ => candidatesAtLevel_card_le D L m) |
| 289 | | - _ = (Finset.Icc (L.1 - 4) (L.1 + 4)).card * ((2 * indexRadius D + 1) ^ 3 * 2) := by simp |
| 290 | | - _ ≤ 9 * ((2 * indexRadius D + 1) ^ 3 * 2) := Nat.mul_le_mul_right _ hlevels |
| 291 | | - _ = degreeBound D := by unfold degreeBound; ring |
| 292 | | - |
| 293 | | -/-- The actual finite neighbor set, obtained by filtering an explicit finite box. -/ |
| 294 | | -def neighbors (D : ℝ) (L : Label) : Finset Label := by |
| 295 | | - classical |
| 296 | | - exact (candidates D L).filter (Adj D L) |
| 297 | | - |
| 298 | | -theorem mem_neighbors_iff (D : ℝ) (L M : Label) : M ∈ neighbors D L ↔ Adj D L M := by |
| 299 | | - classical |
| 300 | | - simp only [neighbors, Finset.mem_filter] |
| 301 | | - exact ⟨And.right, fun h => ⟨adj_mem_candidates D h, h⟩⟩ |
| 302 | | - |
| 303 | | -/-- Uniform degree control for every dyadic level, grid point, and sign. -/ |
| 304 | | -theorem neighbors_card_le (D : ℝ) (L : Label) : (neighbors D L).card ≤ degreeBound D := by |
| 305 | | - classical |
| 306 | | - exact (Finset.card_filter_le _ _).trans (candidates_card_le D L) |
| 307 | | - |
| 308 | | -theorem label_type_countable : Countable Label := by infer_instance |
| 309 | | - |
| 310 | 205 | /-- The expanding eigenvalue of the actual covering matrix. -/ |
| 311 | 206 | def coverGrowth : ℝ := 4 + Real.sqrt 2 |
| 312 | 207 | |
| @@ -435,30 +330,4 @@ theorem nativeArgument_nonneg (h : ℝ) (hh : 0 ≤ h) {n : ℕ} (hn : 4 ≤ n) |
| 435 | 330 | simpa using hq |
| 436 | 331 | exact div_nonneg (Real.log_nonneg hratio) log_coverGrowth_pos.le |
| 437 | 332 | |
| 438 | | -theorem nativeIndex_eq_integer_floor (h : ℝ) (hh : 0 ≤ h) {n : ℕ} (hn : 4 ≤ n) : |
| 439 | | - (nativeIndex h n : ℤ) = ⌊nativeArgument h n⌋ := by |
| 440 | | - unfold nativeIndex |
| 441 | | - rw [← Int.floor_toNat, Int.toNat_of_nonneg (Int.floor_nonneg.mpr (nativeArgument_nonneg h hh hn))] |
| 442 | | - |
| 443 | | -/-- The constructed finite coloring feeds the proved rational-slot geometry |
| 444 | | -using the manuscript's actual native covering index, with no coloring or |
| 445 | | -native-index-gap assumption. -/ |
| 446 | | -theorem physical_labels_have_auxiliary_slots (D h : ℝ) (hh : 0 ≤ h) |
| 447 | | - (a b : SlotGeometry.Plane) : |
| 448 | | - ∃ r : ℝ, 0 < r ∧ ∀ L M : Label, Adj D L M → |
| 449 | | - Disjoint |
| 450 | | - (SlotGeometry.liftedSupport (nativeIndex h L.1) |
| 451 | | - (SlotGeometry.orientedRectangle |
| 452 | | - (SlotGeometry.center (Fintype.card Palette) (nativeGap h) (color L)) a b (2 * r))) |
| 453 | | - (SlotGeometry.liftedSupport (nativeIndex h M.1) |
| 454 | | - (SlotGeometry.orientedRectangle |
| 455 | | - (SlotGeometry.center (Fintype.card Palette) (nativeGap h) (color M)) a b (2 * r))) := by |
| 456 | | - apply SlotGeometry.colored_labels_have_slots |
| 457 | | - (Fintype.card Palette) (nativeGap h) a b (Adj D) color (fun L => nativeIndex h L.1) |
| 458 | | - · intro L M hLM |
| 459 | | - exact color_proper D hLM |
| 460 | | - · intro L M hLM |
| 461 | | - exact nativeIndex_gap h hh hLM.left_positive hLM.right_positive |
| 462 | | - hLM.left_level_le hLM.right_level_le |
| 463 | | - |
| 464 | 333 | end NavierStokes.SlotColoring |