AFTD Auto-Formalizing Theoretical Domains

norm_sq_toEuclideanLin

theoremverifiedimported Lean

Squared Euclidean norm as a sum of squared coordinates. Let $A$ be a $k \times d$ real matrix, regarded as the linear map $x \mapsto Ax$ from the Euclidean space $\bbr^d$ to $\bbr^k$, and let $x \in \bbr^d$. Then the squared Euclidean norm of the image is the sum of the squares of its coordinates, \[ \norm{Ax}^2 = \sum_{i=1}^{k} (Ax)_i^2 . \]

Statement

set_option relaxedAutoImplicit false in
set_option autoImplicit false in
open MeasureTheory ProbabilityTheory Real NNReal Matrix Finset in
variable {d k : ℕ} in
lemma norm_sq_toEuclideanLin
    (A : Matrix (Fin k) (Fin d) ℝ) (x : EuclideanSpace ℝ (Fin d)) :
    ‖A.toEuclideanLin x‖ ^ 2 = ∑ i, ((A.toEuclideanLin x) i) ^ 2
Source
TCSlib, `norm_sq_toEuclideanLin`
Lean proof
By Ganesh Sankar, from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Copyright (c) 2026 Ganesh Sankar. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

Lean source view module on GitHub

set_option relaxedAutoImplicit false inset_option autoImplicit false inopen MeasureTheory ProbabilityTheory Real NNReal Matrix Finset invariable {d k : ℕ} in/-- The squared Euclidean norm of the image of `x` under the linear map of the matrix `A` equals the sum over the rows `i` of the squared coordinates `((A.toEuclideanLin x) i)²`. -/lemma norm_sq_toEuclideanLin    (A : Matrix (Fin k) (Fin d) ℝ) (x : EuclideanSpace ℝ (Fin d)) :    ‖A.toEuclideanLin x‖ ^ 2 = ∑ i, ((A.toEuclideanLin x) i) ^ 2 := by  rw [EuclideanSpace.norm_eq]  rw [Real.sq_sqrt (by positivity)]  simp [sq_abs]
See it in the graphDiscuss this resultChallenge it