TorchLean API

NN.Proofs.Autograd.Core.Vectorization

Vectorization #

Shared Euclidean-space vectorization utilities for analytic autograd proofs.

This module centralizes the Vec alias (EuclideanSpace ℝ (Fin n)) and the basic Tensor ℝ (.dim n .scalar)Vec n conversions used across multiple proof files.

PyTorch correspondence / citations #

This plays the same role as treating a length-n tensor as an element of ℝ^n when using standard analysis results (mean value theorem, operator norms, etc.). https://pytorch.org/docs/stable/linalg.html

@[reducible, inline]

Euclidean vectors over .

Instances For

    Convert a 1D scalar tensor (Tensor ℝ (.dim n .scalar)) into a Euclidean vector Vec n.

    This is the “analysis-friendly” view of a length-n tensor as an element of ℝ^n.

    Instances For

      Convert a Euclidean vector Vec n back into a 1D scalar tensor (Tensor ℝ (.dim n .scalar)).

      This is the inverse direction of toVecE.

      Instances For
        @[simp]
        theorem Proofs.Autograd.toVecE_ofVecE {n : } (v : Vec n) :

        toVecE is a left inverse of ofVecE.

        theorem Proofs.Autograd.inner_eq_sum_mul {n : } (x y : Vec n) :
        inner x y = i : Fin n, x.ofLp i * y.ofLp i

        Coordinate formula for the Euclidean inner product on Vec n.

        This is the statement “⟪x,y⟫ = ∑ᵢ xᵢ*yᵢ” specialized to EuclideanSpace ℝ (Fin n).