1. What the declaration says in plain English
The sqNorm declaration defines the squared Euclidean norm of an $n$-dimensional vector. It calculates this value by taking the dot product of the vector with itself, which mathematically corresponds to the sum of the squares of its components.
2. Why it matters in Recognition Science
In Recognition Science, vectors of weights must frequently be calibrated to reflect symmetric or isotropic structures. The sqNorm serves as a standard metric to constrain these configurations. For example, if an $n$-dimensional vector is uniform (all components are equal) and is constrained to have a squared norm of 1, this geometry forces the square of each component to be exactly $1/n$. Setting up these definitional (MODEL) constraints is a necessary precursor for scaling and balancing multi-dimensional cost functions.
3. How to read the formal statement
def sqNorm {n : ℕ} (α : Vec n) : ℝ := dot α α
def sqNorm: Declares a new computational definition namedsqNorm.{n : ℕ}: An implicit parameter taking a natural numbern, establishing the dimension of the vector. Lean usually infers this automatically from the vector passed to it.(α : Vec n): An explicit parameter taking a vectorαof dimensionn.: ℝ: The function outputs a real number.:= dot α α: The implementation delegates to the previously defineddotoperator, passing the vectorαas both the left and right operand.
4. Visible dependencies or certificates in the supplied source
- Upstream Dependencies: The definition relies on the
Vectype and thedotfunction, which are defined in the imported moduleIndisputableMonolith.Cost.Ndim.Core. - Downstream Theorems:
sqNormis immediately utilized as the subject of two theorems in the same file. sqNorm_uniform proves that if a vector has uniform weights equal to $a$, its squared norm is $n \cdot a^2$. uniform_sqNorm_one derives that if such a vector is constrained so thatsqNorm α = 1, then $a^2 = 1/n$.
5. What this declaration does not prove
As a MODEL choice (a definition), sqNorm proves no propositions. It does not establish that the dot product of a vector with itself is non-negative (sqNorm α ≥ 0), nor does it prove that the squared norm is zero if and only if the vector is the zero vector. It strictly acts as a syntactic and structural shorthand for dot α α.