Mathlib.Topology.SpaceFillingCurve
Reflected-Gray dyadic traversals construct a continuous cube-filling curve with a quantitative Hölder modulus and derive a finite squared-distance matching bound.
GrayGates 2 core · 0 supporting Coordinate permutations and bit reflections transport the standard reflected Gray path to any adjacent pair of binary cube vertices. ★ exists_grayPath_between_adjacent_vertices
Gray paths with prescribed adjacent endpoints
Coordinate permutations and bit reflections transport the standard reflected Gray path to any adjacent pair of binary cube vertices. This is the local gate ingredient for orienting the children of a dyadic parent cell.
Given two binary cube vertices, face adjacency is the condition that exactly one coordinate differs.
Given a positive dimension d and two face-adjacent binary vertices, there is an ordering of all 2^d binary cube vertices that visits each vertex exactly once, moves between face-adjacent vertices at every step, starts at the first given vertex, and ends at the second.
Formal statement
Proof (Lean source)
GateStep 3 core · 0 supporting An oriented path through the children of one dyadic cell needs an exit vertex that meets the next parent's entry vertex. ★ exists_adjacent_child_gate
Gates across neighboring dyadic cells
An oriented path through the children of one dyadic cell needs an exit vertex that meets the next parent's entry vertex. This module isolates that local choice from the recursive assembly of finite traversals.
Given two integer grid points, face adjacency is the condition that one coordinate differs by one and the others agree.
Given a parent grid cell and binary child vertex, the child-grid coordinate is twice the parent coordinate plus the child bit.
Given a dimension of at least two, two face-adjacent parent cells, and an entry vertex, there are an exit vertex differing from the entry vertex in exactly one coordinate and a binary vertex of the second cell such that the exit child of the first cell is face-adjacent to that child of the second cell.
Formal statement
Proof (Lean source)
FiniteTraversal 2 core · 3 supporting A finite traversal orders every dyadic grid through a prescribed level. ★ exists_finiteDyadicTraversal
Finite coherent dyadic traversals
A finite traversal orders every dyadic grid through a prescribed level. This separates the recursive orientation problem from the compactness argument that extracts one infinite coherent traversal.
A finite coherent traversal of the dyadic grids through level n in dimension d. Every grid is visited exactly once, neighboring visits share a face, and each block of 2^d children lies in its parent cell.
Definition (Lean source)
Given a positive cube dimension and a finite depth, a coherent traversal of all dyadic grids through that depth exists.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
exists_finiteDyadicTraversal_zerotheorem — At depth zero, the unique dyadic cell gives a finite coherent traversal in every dimension.Proof (Lean source)
theorem exists_finiteDyadicTraversal_zero (d : ℕ) : Nonempty (FiniteDyadicTraversal d 0) := by refine ⟨{ cell := fun m hm k i => ⟨0, by have hm0 : m = 0 := by omega subst m simp⟩ bijective := by intro m hm constructor · intro k l _ have hm0 : m = 0 := by omega subst m apply Fin.ext have hk := k.isLt have hl := l.isLt simp only [mul_zero, pow_zero] at hk hl omega · intro f have hm0 : m = 0 := by omega subst m refine ⟨⟨0, by simp⟩, ?_⟩ funext i apply Fin.ext have hi := (f i).isLt simp only [pow_zero] at hi omega adjacent := by intro m hm k l hkl have hm0 : m = 0 := by omega subst m have hk : k.val = 0 := by simpa using k.isLt have hl : l.val = 0 := by simpa using l.isLt omega nested := by intro m hm omega }⟩ -
exists_finiteDyadicTraversal_succtheorem — A coherent traversal through depth n in dimension at least two extends one level by replacing each parent cell with a compatible Gray child path.hypothesesconclusionNonempty (FiniteDyadicTraversal d (n + 1))Proof (Lean source)
theorem exists_finiteDyadicTraversal_succ (d n : ℕ) (hd : 2 ≤ d) (T : FiniteDyadicTraversal d n) : Nonempty (FiniteDyadicTraversal d (n + 1)) := by have hadj : ∀ k l : Fin (2 ^ (d * n)), l.val = k.val + 1 → FaceAdjacentGrid (fun i => (T.cell n (Nat.le_refl n) k i).val) (fun i => (T.cell n (Nat.le_refl n) l i).val) := by intro k l hkl obtain ⟨i, hi, hsame⟩ := T.adjacent n (Nat.le_refl n) k l hkl exact ⟨i, hi, fun j hj => congrArg val (hsame j hj)⟩ obtain ⟨child, hbij, hchildadj, hchildnest⟩ := exists_child_grid_order d n hd (T.cell n (Nat.le_refl n)) (T.bijective n (Nat.le_refl n)) hadj let cell : ∀ m : ℕ, m ≤ n + 1 → Fin (2 ^ (d * m)) → Fin d → Fin (2 ^ m) := fun m hm => if h : m ≤ n then T.cell m h else by have heq : m = n + 1 := by omega subst m exact child refine ⟨{ cell := cell, bijective := ?_, adjacent := ?_, nested := ?_ }⟩ · intro m hm by_cases h : m ≤ n · simpa [cell, h] using T.bijective m h · have heq : m = n + 1 := by omega subst m simpa [cell, h] using hbij · intro m hm k l hkl by_cases h : m ≤ n · simpa [cell, h] using T.adjacent m h k l hkl · have heq : m = n + 1 := by omega subst m obtain ⟨i, hi, hsame⟩ := hchildadj k l hkl refine ⟨i, ?_, ?_⟩ · simpa [cell, h] using hi · intro j hj apply Fin.ext simpa [cell, h] using hsame j hj · intro m hm k l hkl i by_cases h : m + 1 ≤ n · have hbase : m ≤ n := by omega simpa [cell, h, hbase] using T.nested m h k l hkl i · have heq : m = n := by omega subst m have htop : ¬ n + 1 ≤ n := by omega simpa [cell, htop] using hchildnest k l hkl i -
exists_finiteDyadicTraversal_onetheorem — The unit interval has a finite coherent dyadic traversal through every depth, using the natural increasing order of its dyadic cells.Proof (Lean source)
theorem exists_finiteDyadicTraversal_one (n : ℕ) : Nonempty (FiniteDyadicTraversal 1 n) := by let cell : ∀ m : ℕ, m ≤ n → Fin (2 ^ (1 * m)) → Fin 1 → Fin (2 ^ m) := fun m hm k i => ⟨k.val, by simpa using k.isLt⟩ refine ⟨{ cell := cell, bijective := ?_, adjacent := ?_, nested := ?_ }⟩ · intro m hm constructor · intro k l hkl apply Fin.ext have hi := congrFun hkl (0 : Fin 1) dsimp [cell] at hi have hv := congrArg val hi exact hv · intro f refine ⟨⟨(f 0).val, by simpa using (f 0).isLt⟩, ?_⟩ funext i have hi : i = 0 := Subsingleton.elim i 0 subst i apply Fin.ext rfl · intro m hm k l hkl refine ⟨0, inl ?_, ?_⟩ · change k.val + 1 = l.val omega · intro j hj exact (hj (Subsingleton.elim j 0)).elim · intro m hm k l hkl i simpa [cell] using hkl
Traversal 2 core · 1 supporting A traversal orders every dyadic grid of the unit cube, respects parent cells, and visits face-adjacent cells consecutively. ★ exists_dyadicTraversal
Coherent dyadic cube traversals
A traversal orders every dyadic grid of the unit cube, respects parent cells, and visits face-adjacent cells consecutively. The existence theorem is the finite recursive Gray-order construction, including the orientation changes needed for coherence between levels.
A coherent face-adjacent order of all dyadic grids in dimension d. At every level n it lists the 2^(dn) cells of the grid with 2^n cells per side exactly once, consecutive cells in the list share a face, and each consecutive block of 2^d cells at level n+1 consists of the children of the corresponding level-n cell.
Definition (Lean source)
Given a positive cube dimension, a coherent dyadic traversal exists.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
exists_dyadicTraversal_of_finitetheorem — Coherent traversals of every finite depth yield one traversal of all dyadic grids. The proof extracts a consistent branch from the finitely branching tree of finite cell orders.hypothesesd :ℕhfinite :∀ n, Nonempty (FiniteDyadicTraversal d n)conclusionNonempty (DyadicTraversal d)Proof (Lean source)
theorem exists_dyadicTraversal_of_finite (d : ℕ) (hfinite : ∀ n, Nonempty (FiniteDyadicTraversal d n)) : Nonempty (DyadicTraversal d) := by obtain ⟨F, hF⟩ := exists_coherent_finiteDyadicTraversals d hfinite let cell : ∀ n : ℕ, Fin (2 ^ (d * n)) → Fin d → Fin (2 ^ n) := fun n k i => (F n).cell n (Nat.le_refl n) k i refine ⟨{ cell := cell, bijective := ?_, adjacent := ?_, nested := ?_ }⟩ · intro n exact (F n).bijective n (Nat.le_refl n) · intro n k l hkl exact (F n).adjacent n (Nat.le_refl n) k l hkl · intro n k l hkl i have hn := (F (n + 1)).nested n (Nat.le_refl (n + 1)) k l hkl i have hcell : (F (n + 1)).cell n (le_succ n) k i = (F n).cell n (Nat.le_refl n) k i := by have heq := congrArg (fun T : FiniteDyadicTraversal d n => T.cell n (Nat.le_refl n) k i) (hF n) exact heq exact hn.trans (congrArg val hcell)
CurveCells 7 core · 1 supporting The closed parameter intervals and closed cube cells attached to a coherent traversal are the finite-scale localization data for its limiting curve. ★ exists_localizedCubeMap_of_traversal
Dyadic cells for the cube curve
The closed parameter intervals and closed cube cells attached to a coherent traversal are the finite-scale localization data for its limiting curve.
Given a real cube point, unit-cube membership is the condition that every coordinate lies between zero and one.
Given two real cube points, their squared Euclidean distance is the sum of squared coordinate differences.
Definition (Lean source)
Given a dimension d, dyadic level n, and cell index k, the dyadic time cell is the closed parameter interval from k/2^(dn) to (k+1)/2^(dn).
Given a traversal, level n, cell index k, and point x, membership in the dyadic cube cell is the condition that each coordinate of x lies in the closed interval from c/2^n to (c+1)/2^n, where c is the matching integer coordinate of the k-th cell the traversal visits at level n.
Definition (Lean source)
Given a traversal, parameter, and cube point, dyadic-cell-fiber membership is membership in every geometric cell whose time interval contains the parameter.
Definition (Lean source)
A localized cube map sends every closed dyadic parameter cell into its corresponding closed geometric cube, simultaneously at every depth.
Definition (Lean source)
Given a cube dimension and a coherent dyadic traversal, a map localized to its matching dyadic cube cells exists.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
dyadicCellFiber_nonemptytheorem — Every parameter in the unit interval has a point in all corresponding closed dyadic cubes, including both cubes at a subdivision endpoint.hypothesesconclusion∃ x : Fin d → ℝ, dyadicCellFiber T t xProof (Lean source)
theorem dyadicCellFiber_nonempty {d : ℕ} (T : DyadicTraversal d) (t : ℝ) (ht : t ∈ Icc (0 : ℝ) 1) : ∃ x : Fin d → ℝ, dyadicCellFiber T t x := by let F : ℕ → Set (Fin d → ℝ) := fun n => {x | ∀ k : Fin (2 ^ (d * n)), t ∈ dyadicTimeCell d n k → dyadicCubeCell T n k x} have hcellclosed (n : ℕ) (k : Fin (2 ^ (d * n))) : IsClosed {x : Fin d → ℝ | dyadicCubeCell T n k x} := by have heq : {x : Fin d → ℝ | dyadicCubeCell T n k x} = ⋂ i : Fin d, {x : Fin d → ℝ | x i ∈ Icc (((T.cell n k i).val : ℝ) / (2 ^ n : ℝ)) ((((T.cell n k i).val : ℝ) + 1) / (2 ^ n : ℝ))} := by ext x simp only [Set.mem_ofPred_eq, Set.mem_iInter, dyadicCubeCell] rw [heq] exact isClosed_iInter (fun i => isClosed_Icc.preimage (continuous_apply i)) have hclosed (n : ℕ) : IsClosed (F n) := by have heq : F n = ⋂ k : Fin (2 ^ (d * n)), {x : Fin d → ℝ | t ∈ dyadicTimeCell d n k → dyadicCubeCell T n k x} := by ext x simp only [F, Set.mem_ofPred_eq, Set.mem_iInter] rw [heq] apply isClosed_iInter intro k by_cases htk : t ∈ dyadicTimeCell d n k · simpa [htk] using hcellclosed n k · simp [htk] have hnonempty (n : ℕ) : (F n).Nonempty := by obtain ⟨x, hx⟩ := level_fiber_nonempty T n t exact ⟨x, hx⟩ have hstep (n : ℕ) : F (n + 1) ⊆ F n := by intro x hx k htk obtain ⟨l, hdiv, htl⟩ := time_cell_has_child d n t k htk exact dyadicCubeCell_parent T n k l hdiv x (hx l htl) let k0 : Fin (2 ^ (d * 0)) := ⟨0, by simp⟩ have ht0 : t ∈ dyadicTimeCell d 0 k0 := by simpa [dyadicTimeCell, k0] using ht have hsubset : F 0 ⊆ Icc (fun _ : Fin d => (0 : ℝ)) (fun _ => 1) := by intro x hx have hcube := hx k0 ht0 change (fun _ : Fin d => (0 : ℝ)) ≤ x ∧ x ≤ (fun _ => (1 : ℝ)) constructor · intro i have hi := hcube i simpa [dyadicCubeCell, k0] using hi.1 · intro i have hi := hcube i simpa [dyadicCubeCell, k0] using hi.2 have hcompact : IsCompact (F 0) := isCompact_Icc.of_isClosed_subset (hclosed 0) hsubset obtain ⟨x, hx⟩ := IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed F hstep hnonempty hcompact hclosed exact ⟨x, fun n k htk => (Set.mem_iInter.mp hx n) k htk⟩
Gray 3 core · 0 supporting The binary reflected Gray code provides an order of the 2^d children of a dyadic cube in which successive children share a face. ★ grayBit_adjacent
Reflected Gray order on dyadic cube children
The binary reflected Gray code provides an order of the 2^d children of a
dyadic cube in which successive children share a face.
The reflected Gray code of a natural-number index k is the bitwise exclusive-or of k with k shifted right by one bit.
Definition (Lean source)
The reflected-Gray bit of a natural-number index k at bit position i is the i-th binary digit of the reflected Gray code of k.
Definition (Lean source)
Given a cube dimension and child index whose successor remains in the dyadic grid, the two consecutive Gray-code words differ in exactly one coordinate.
Formal statement
Proof (Lean source)
Pairing 2 core · 1 supporting Finite points on the unit interval can be sorted and paired in adjacent order. ★ exists_pairing_gap_le_one
Adjacent-parameter perfect pairings
Finite points on the unit interval can be sorted and paired in adjacent order. The chosen gaps total at most one, and concavity bounds the sum of their fractional powers.
A perfect pairing of the N labeled positions is a list of N/2 disjoint two-element edges covering each position exactly once.
Given a family size that is even and at least two, and unit-interval parameters, a perfect pairing has total absolute parameter gap at most one.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
sum_rpow_le_card_rpowtheorem — For nonnegative gaps totaling at most one, the sum of their pth powers is at most the number of gaps to the power 1-p, for 0<p≤1. This is finite Jensen concavity for the power function.hypothesesm :ℕhm :0 < mp :ℝhp0 :0 < php1 :p ≤ 1a :Fin m → ℝha :∀ i, 0 ≤ a ihsum :(∑ i, a i) ≤ 1conclusion(∑ i, a i ^ p) ≤ (m : ℝ) ^ (1 - p)Proof (Lean source)
theorem sum_rpow_le_card_rpow {m : ℕ} (hm : 0 < m) (p : ℝ) (hp0 : 0 < p) (hp1 : p ≤ 1) (a : Fin m → ℝ) (ha : ∀ i, 0 ≤ a i) (hsum : (∑ i, a i) ≤ 1) : (∑ i, a i ^ p) ≤ (m : ℝ) ^ (1 - p) := by let c : ℝ := (m : ℝ) have hc : 0 < c := by dsimp [c]; exact_mod_cast hm have hw : (∑ _i : Fin m, c⁻¹) = 1 := by simp only [Finset.sum_const, Finset.card_fin, nsmul_eq_mul] change c * c⁻¹ = 1 exact mul_inv_cancel₀ hc.ne' have hj := (Real.concaveOn_rpow hp0.le hp1).le_map_sum (t := univ) (w := fun _ : Fin m => c⁻¹) (p := a) (by intro i hi; exact inv_nonneg.mpr hc.le) hw (by intro i hi; exact ha i) simp only [smul_eq_mul] at hj have hca : c⁻¹ * (∑ i, a i) ≤ c⁻¹ := by nlinarith [mul_le_mul_of_nonneg_left hsum (inv_nonneg.mpr hc.le)] have hr := Real.rpow_le_rpow (mul_nonneg (inv_nonneg.mpr hc.le) (Finset.sum_nonneg (fun i hi => ha i))) hca hp0.le have hmain : c⁻¹ * (∑ i, a i ^ p) ≤ (c⁻¹) ^ p := by calc _ ≤ (c⁻¹ * ∑ i, a i) ^ p := by simpa [Finset.mul_sum] using hj _ ≤ _ := hr have hmult := mul_le_mul_of_nonneg_left hmain hc.le have hpow : c * (c⁻¹) ^ p = c ^ (1 - p) := by rw [← Real.rpow_neg_eq_inv_rpow] calc c * c ^ (-p) = c ^ (1 : ℝ) * c ^ (-p) := by simp _ = c ^ (1 + -p) := (Real.rpow_add hc 1 (-p)).symm _ = c ^ (1 - p) := by ring calc (∑ i, a i ^ p) = c * (c⁻¹ * ∑ i, a i ^ p) := by rw [← mul_assoc, mul_inv_cancel₀ hc.ne', one_mul] _ ≤ c * (c⁻¹) ^ p := hmult _ = (m : ℝ) ^ (1 - p) := by simpa [c] using hpow
ChildPaths 1 core · 0 supporting The gate chain supplies adjacent entry and exit vertices in each parent cell. ★ exists_compatible_child_paths
Compatible reflected Gray paths inside parent cells
The gate chain supplies adjacent entry and exit vertices in each parent cell. This module turns those gates into Hamiltonian child paths, including the face-adjacency condition between consecutive parent blocks.
Given a cube dimension and dyadic depth, a dimension of at least two, a parent grid, and face adjacency of consecutive parent cells, there is, for every parent cell, an ordering of its 2^d binary child vertices that visits each vertex exactly once with consecutive vertices differing in exactly one coordinate, such that for consecutive parent cells the last child of the earlier parent and the first child of the later parent are face-adjacent cells of the refined grid.
Formal statement
Proof (Lean source)
CubeCover 1 core · 0 supporting Every point of the closed unit cube lies in a cell of each finite dyadic grid. ★ cubeCell_cover
Dyadic cube cover
Every point of the closed unit cube lies in a cell of each finite dyadic grid. This is the finite covering input for surjectivity of the limiting traversal.
Given a cube dimension, a dyadic traversal, a dyadic level, and a point certified to lie in the unit cube, some level cell contains that point.
Formal statement
Proof (Lean source)
CubeInverse 1 core · 1 supporting Finite cube covering and compactness give a time whose visited cube contains a specified point at every level. ★ exists_parameter_for_cubePoint
Inverse parameters for nested dyadic cube cells
Finite cube covering and compactness give a time whose visited cube contains a specified point at every level. Shrinking cells then identify that point with the value of any localized cube map at that time.
Given a cube dimension, a dyadic traversal, and a point certified to lie in the unit cube, there is a parameter in the unit interval such that at every dyadic level some cell index has both its time interval containing the parameter and its cube cell containing the point.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
CubeProximity 1 core · 0 supporting For a dyadic traversal of the d-dimensional cube at level n, which visits the 2^(d·n) closed dyadic cells of side 2^(−n) in an order where consecutive cells share a face, any two points lying in the same cell or in conse ★ sqEuclideanDist_le_of_neighboring_cubeCells
Points in consecutive cells of a dyadic traversal are close
For a dyadic traversal of the d-dimensional cube at level n, which visits the 2^(d·n) closed dyadic cells of side 2^(−n) in an order where consecutive cells share a face, any two points lying in the same cell or in consecutive cells have squared Euclidean distance at most 4·d·2^(−2n). This is the locality property of a space-filling-curve ordering: neighbours in the ordering are neighbours in space.
Main results
* sqEuclideanDist_le_of_neighboring_cubeCells — the squared-distance bound 4·d·(2^(−n))² for
points in cells whose indices differ by at most one.
Given a dimension and level, a traversal and two cell indices that are equal or consecutive, and points localized in those cells, their squared Euclidean distance is at most four times the dimension times the squared cell width 2^(-n).
Formal statement
Proof (Lean source)
Curve 2 core · 1 supporting The curve is the continuous limit of coherent dyadic traversals. ★ exists_holderCubeCurve
Quantitative space-filling curve of the unit cube
The curve is the continuous limit of coherent dyadic traversals. Its squared Euclidean modulus has the constant needed for finite matching costs.
A continuous surjection from the unit interval onto the unit d-cube whose squared Euclidean increments are bounded by 16*d*|s-t|^(2/d).
Definition (Lean source)
Given a cube dimension of at least two, there is a map that is continuous on the unit interval, sends it onto the whole unit d-cube, and has squared Euclidean distance between the images of any two parameters s, t at most 16·d·|s-t|^(2/d).
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
exists_holderCubeCurve_of_traversaltheorem — A coherent dyadic traversal in dimension at least two yields a continuous surjection of the cube with squared Hölder constant 16*d. The proof takes the uniform limit of piecewise-linear traversal approximants, then uses the two dyadic cells around a parameter pair to bound their displacement.Proof (Lean source)
theorem exists_holderCubeCurve_of_traversal (d : ℕ) (hd : 2 ≤ d) (T : DyadicTraversal d) : Nonempty (HolderCubeCurve d) := by obtain ⟨H⟩ := exists_localizedCubeMap_of_traversal d T exact ⟨{ toFun := H.toFun continuousOn := H.continuousOn hd mapsToCube := fun ht => H.mapsToCube ht surjectiveOn := fun x hx => H.surjectiveOn x hx modulus := fun hs ht => H.modulus hd hs ht }⟩
CurveGeometry 1 core · 3 supporting Closed-cell localization implies that the limiting map fills the cube and obeys the quantitative Hölder bound needed for matching. ★ modulus
Geometry of localized dyadic cube maps
Closed-cell localization implies that the limiting map fills the cube and obeys the quantitative Hölder bound needed for matching.
Given a cube dimension and traversal, a localized map, a dimension of at least two, and two unit-interval parameters, the squared Euclidean distance between the map's two values is at most 16·d·|s − t|^(2/d), a Hölder bound of exponent 1/d.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
mapsToCubetheorem — At every parameter in the unit interval, a localized dyadic map takes its value in the unit cube.hypothesesconclusionInUnitCube (H.toFun t)Proof (Lean source)
theorem LocalizedCubeMap.mapsToCube {d : ℕ} {T : DyadicTraversal d} (H : LocalizedCubeMap d T) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) 1) : InUnitCube (H.toFun t) := by have htime : t ∈ dyadicTimeCell d 0 ⟨0, by simp⟩ := by simpa [dyadicTimeCell] using ht have hcube := H.localizes 0 ⟨0, by simp⟩ t htime simpa [dyadicCubeCell, InUnitCube] using hcube -
surjectiveOntheorem — A localized dyadic cube map reaches every point of the unit cube from a parameter in the unit interval.hypothesesProof (Lean source)
theorem LocalizedCubeMap.surjectiveOn {d : ℕ} {T : DyadicTraversal d} (H : LocalizedCubeMap d T) (x : Fin d → ℝ) (hx : InUnitCube x) : ∃ t : ℝ, t ∈ Icc (0 : ℝ) 1 ∧ H.toFun t = x := by obtain ⟨t, ht, hcells⟩ := T.exists_parameter_for_cubePoint x hx refine ⟨t, ht, ?_⟩ apply T.eq_of_shared_cubeCells intro n obtain ⟨k, htk, hxk⟩ := hcells n exact ⟨k, H.localizes n k t htk, hxk⟩ -
continuousOntheorem — The quantitative squared-distance modulus makes a localized dyadic cube map continuous on the unit interval.hypothesesconclusionContinuousOn H.toFun (Icc (0 : ℝ) 1)Proof (Lean source)
theorem LocalizedCubeMap.continuousOn {d : ℕ} {T : DyadicTraversal d} (H : LocalizedCubeMap d T) (hd : 2 ≤ d) : ContinuousOn H.toFun (Icc (0 : ℝ) 1) := by -- Apply the coordinatewise sequential or epsilon-delta criterion to -- `H.modulus`; each squared coordinate increment is bounded by the sum. -- Equivalently derive the norm Hölder estimate using `sqEuclideanDist` -- as the squared `EuclideanSpace` distance, then use -- `HolderOnWith.continuousOn`. Coordinatewise `continuousOn_pi` avoids -- changing the tuple codomain. -- For the coordinate route, `Finset.single_le_sum` bounds each squared -- coordinate increment by `sqEuclideanDist`. Use `continuousOn_iff` -- with a small positive radius and `Real.continuous_rpow_const` at zero, -- then assemble coordinates via `continuousOn_pi`. apply continuousOn_pi.mpr intro i intro s hs apply tendsto_iff_dist_tendsto_zero.mpr have hp : 0 < (2 : ℝ) / d := by positivity have hbound : Tendsto (fun t : ℝ => sqrt (16 * (d : ℝ) * |s - t| ^ ((2 : ℝ) / d))) (nhdsWithin s (Icc (0 : ℝ) 1)) (nhds 0) := by have hc : ContinuousAt (fun t : ℝ => sqrt (16 * (d : ℝ) * |s - t| ^ ((2 : ℝ) / d))) s := by fun_prop (disch := positivity) have hh : ContinuousWithinAt (fun t : ℝ => sqrt (16 * (d : ℝ) * |s - t| ^ ((2 : ℝ) / d))) (Icc (0 : ℝ) 1) s := hc.continuousWithinAt have hzero : sqrt (16 * (d : ℝ) * |s - s| ^ ((2 : ℝ) / d)) = 0 := by simp [hp.ne'] simpa only [ContinuousWithinAt, hzero] using hh apply squeeze_zero' (Filter.Eventually.of_forall fun t => dist_nonneg) ?_ hbound filter_upwards [self_mem_nhdsWithin] with t ht have hcoord : ((H.toFun s i) - (H.toFun t i)) ^ 2 ≤ sqEuclideanDist (H.toFun s) (H.toFun t) := by unfold sqEuclideanDist exact Finset.single_le_sum (f := fun j : Fin d => (H.toFun s j - H.toFun t j) ^ 2) (fun j _ => sq_nonneg _) (Finset.mem_univ i) have hmod := H.modulus hd hs ht have hnonneg : 0 ≤ 16 * (d : ℝ) * |s - t| ^ ((2 : ℝ) / d) := by positivity have hsqrt := (Real.le_sqrt (show 0 ≤ |H.toFun t i - H.toFun s i| by positivity) hnonneg).mpr (by calc |H.toFun t i - H.toFun s i| ^ 2 = (H.toFun s i - H.toFun t i) ^ 2 := by rw [sq_abs] ring _ ≤ sqEuclideanDist (H.toFun s) (H.toFun t) := hcoord _ ≤ 16 * (d : ℝ) * |s - t| ^ ((2 : ℝ) / d) := hmod) simpa [Real.dist_eq, abs_sub_comm] using hsqrt
DyadicScale 1 core · 1 supporting A positive interval gap is bracketed by consecutive dyadic time widths. ★ dyadicScale_sq_bound
Dyadic scales for Hölder cube geometry
A positive interval gap is bracketed by consecutive dyadic time widths. The lower width gives the quantitative power bound used by the cube curve.
Given a dimension d and dyadic level n, a positive dimension, and a gap δ at least as large as the next time width 1/2^(d(n+1)), the squared spatial width (1/2^n)² is at most 4·δ^(2/d).
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
exists_dyadicScaletheorem — A positive gap of at most one lies between two consecutive time widths of a d-dimensional dyadic traversal.hypothesesd :ℕhd :0 < dδ :ℝhδ :0 < δhδ1 :δ ≤ 1conclusion∃ n : ℕ,conclusion 1(1 : ℝ) / (2 : ℝ) ^ (d * (n + 1)) ≤ δconclusion 2δ ≤ (1 : ℝ) / (2 : ℝ) ^ (d * n)Proof (Lean source)
theorem exists_dyadicScale (d : ℕ) (hd : 0 < d) {δ : ℝ} (hδ : 0 < δ) (hδ1 : δ ≤ 1) : ∃ n : ℕ, (1 : ℝ) / (2 : ℝ) ^ (d * (n + 1)) ≤ δ ∧ δ ≤ (1 : ℝ) / (2 : ℝ) ^ (d * n) := by have hypos : 0 < ((1 : ℝ) / 2 ^ d) := by positivity have hylt : ((1 : ℝ) / 2 ^ d) < 1 := by have h : 1 < (2 : ℝ) ^ d := one_lt_pow₀ (by norm_num) hd.ne' exact (div_lt_one (by positivity)).2 h obtain ⟨n, hn, hn'⟩ := exists_nat_pow_near_of_lt_one hδ hδ1 hypos hylt have hw (k : ℕ) : ((1 : ℝ) / 2 ^ d) ^ k = 1 / (2 : ℝ) ^ (d * k) := by simp [one_div, inv_pow, ← pow_mul, mul_comm d k] exact ⟨n, (hw (n + 1)) ▸ hn.le, (hw n) ▸ hn'⟩
GateChain 1 core · 0 supporting Local gates can be chosen successively along a face-adjacent path of parent cells. ★ exists_compatible_child_gates
Compatible gates along a finite parent traversal
Local gates can be chosen successively along a face-adjacent path of parent cells. The resulting binary entry and exit vertices determine the endpoints of each child's reflected Gray path.
Given a dimension d and level n, a dimension of at least two, an ordered list of 2^(dn) integer grid cells in which consecutive cells are face-adjacent, and an initial binary entry vertex, every listed cell can be given a binary entry vertex and a binary exit vertex such that the first cell's entry is the prescribed one, each cell's entry and exit differ in exactly one coordinate, and the exit child of each cell is face-adjacent to the entry child of the next cell.
Formal statement
Proof (Lean source)
GrayBijection 1 core · 0 supporting The bitwise reflected Gray map gives the bijection needed to turn a local face-adjacent Gray path into an ordering of all children of a dyadic cube. ★ grayBits_bijective
Reflected Gray order visits each cube vertex once
The bitwise reflected Gray map gives the bijection needed to turn a local face-adjacent Gray path into an ordering of all children of a dyadic cube.
Given a cube dimension, the reflected Gray-code map visits every binary cube vertex exactly once.
Formal statement
Proof (Lean source)
GridExtension 1 core · 0 supporting Each parent cell is replaced by a compatible face-adjacent order of its binary children. ★ exists_child_grid_order
Extending a dyadic grid order by one level
Each parent cell is replaced by a compatible face-adjacent order of its binary children. This module records the index arithmetic separately from induction over finite traversals.
Given a dimension d and level n, a dimension of at least two, an order of the level-n dyadic grid cells, its bijectivity, and face adjacency of its consecutive cells, there is a bijective order of the level-(n+1) grid cells in which consecutive cells are face-adjacent and each consecutive block of 2^d cells consists of the children of the corresponding parent cell.
Formal statement
Proof (Lean source)
Matching 1 core · 0 supporting Pull finite cube points back to interval parameters, sort the parameters, pair adjacent values, and apply the squared Hölder modulus and concavity. ★ exists_perfectPairing_sqEuclidean_cost_le
Finite cube matching from a Hölder traversal
Pull finite cube points back to interval parameters, sort the parameters, pair adjacent values, and apply the squared Hölder modulus and concavity.
Given a cube dimension and family size, a dimension of at least two, an even family of at least two labels, and unit-cube points at those labels, there is a perfect pairing of the labels whose total squared Euclidean distance between paired points is at most 16·d·N^(1 − 2/d).
Formal statement
Proof (Lean source)
TimeProximity 1 core · 0 supporting Two parameters within one level's time-cell width can be assigned closed time cells with equal or consecutive traversal indices. ★ exists_neighboring_timeCells
Nearby parameter cells
Two parameters within one level's time-cell width can be assigned closed time cells with equal or consecutive traversal indices.
Given a cube dimension and level, two unit-interval parameters, and a gap no larger than one level-cell width, the parameters lie in equal or neighboring dyadic time cells.
Formal statement
Proof (Lean source)
TraversalCompactness 2 core · 2 supporting Finite traversals can be restricted to a shorter depth. ★ exists_coherent_finiteDyadicTraversals
Compactness for finite dyadic traversals
Finite traversals can be restricted to a shorter depth. Their finite sets of possible cell orders form an inverse system; a coherent sequence of finite orders is the input for the infinite traversal construction.
Given a finite dyadic traversal and a shorter depth, its truncation is the restricted traversal at that depth.
Definition (Lean source)
Given a cube dimension and nonempty finite traversals at every depth, there is a sequence of finite traversals, one for each depth, in which every traversal is the truncation of the next one.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
truncate_transtheorem — Restricting a traversal twice gives the same finite traversal as a single restriction to the final depth.hypothesesconclusion(T.truncate hmn).truncate hlm = T.truncate (hlm.trans hmn)Proof (Lean source)
theorem FiniteDyadicTraversal.truncate_trans {d l m n : ℕ} (T : FiniteDyadicTraversal d n) (hlm : l ≤ m) (hmn : m ≤ n) : (T.truncate hmn).truncate hlm = T.truncate (hlm.trans hmn) := by rfl -
finite_finiteDyadicTraversaltheorem — At every finite depth there are only finitely many coherent dyadic cell orders in a fixed dimension.Proof (Lean source)
theorem finite_finiteDyadicTraversal (d n : ℕ) : Finite (FiniteDyadicTraversal d n) := by classical let encode : FiniteDyadicTraversal d n → (k : Fin (n + 1)) → Fin (2 ^ (d * k.val)) → Fin d → Fin (2 ^ k.val) := fun T k => T.cell k.val (by omega) apply Finite.of_injective encode intro T U h cases T with | mk cellT bijT adjT nestT => cases U with | mk cellU bijU adjU nestU => have hc : cellT = cellU := by funext m hm k i exact congrArg (fun f => f ⟨m, by omega⟩ k i) h cases hc rfl