IntrinsicDimension.lean
Lean 4 source, lean/DataMiningAsObservation/IntrinsicDimension.lean at commit bccca4f. Appendix C, Machine-checked statements, says what each file proves. All Lean files.
/-
IntrinsicDimension.lean. Equations 0.31 and 9.2, intrinsic dimension from Weyl's law.
Under Weyl's law the number of eigenvalues below a level grows like the level to the power
of half the dimension, `N(λ) = C λ^{d/2}`. The slope of log N against log λ is then `d/2`
between any two levels, so the dimension is twice that slope, whatever the constant `C`.
That is why the eigenvalue ordering fixes the dimension before it fixes the shape. The law
itself is an asymptotic statement about manifolds, and the file checks only the algebra
that turns a power law into a dimension.
-/
import Mathlib
namespace DMO.IntrinsicDimension
open Real
/-- **Equation 0.31** as a power law, the count below the level `lam`. -/
noncomputable def weyl (C d lam : ℝ) : ℝ := C * lam ^ (d / 2)
/-- The logarithm of the count is affine in the logarithm of the level with slope `d/2`. -/
theorem log_weyl (C d lam : ℝ) (hC : 0 < C) (hl : 0 < lam) :
log (weyl C d lam) = log C + (d / 2) * log lam := by
unfold weyl
rw [log_mul hC.ne' (rpow_pos_of_pos hl _).ne', log_rpow hl]
/-- **Equation 9.2.** The dimension is twice the slope of log count against log level,
between any two distinct levels, whatever the constant. -/
theorem dimension_from_slope (C d lam₁ lam₂ : ℝ) (hC : 0 < C) (h₁ : 0 < lam₁) (h₂ : 0 < lam₂)
(hne : lam₁ ≠ lam₂) :
2 * ((log (weyl C d lam₂) - log (weyl C d lam₁)) / (log lam₂ - log lam₁)) = d := by
rw [log_weyl C d lam₂ hC h₂, log_weyl C d lam₁ hC h₁]
have hlog : log lam₂ - log lam₁ ≠ 0 := by
intro h
apply hne
exact log_injOn_pos (Set.mem_Ioi.2 h₁) (Set.mem_Ioi.2 h₂) (by linarith)
field_simp
ring
/-- Doubling the level multiplies the count by `2^{d/2}`, so a dimension-two set doubles its
count and a dimension-four set quadruples it. -/
theorem weyl_double (C d lam : ℝ) (hl : 0 < lam) :
weyl C d (2 * lam) = 2 ^ (d / 2) * weyl C d lam := by
unfold weyl
rw [mul_rpow (by norm_num) hl.le]
ring
end DMO.IntrinsicDimension