Interval Vector Arithmetic #
This file provides vector and matrix operations for Dyadic intervals, enabling verified linear algebra computations.
Main definitions #
IntervalVector- A list of Dyadic intervals representing bounded vectorsscalarMulInterval- Multiply an interval by a rational scalardotProduct- Dot product of rational weights with interval vectormatVecMul- Matrix-vector multiplicationaddBias- Add a rational bias vectoradd- Pointwise addition of interval vectors
Main theorems #
mem_scalarMulInterval- Soundness of scalar multiplicationmem_dotProduct- Soundness of dot product (FTIA for linear combinations)mem_matVecMul- Soundness of matrix-vector multiplicationmem_addBias- Soundness of bias additionmem_add_component- Soundness of vector addition
A vector of intervals representing bounded real vectors
Instances For
Scalar Operations #
Multiply an interval by a rational scalar. Uses the existing interval multiplication by converting the scalar to a singleton.
Equations
Instances For
Soundness of scalar-interval multiplication
Dot Product #
Dot product of rational weights with an interval vector. Returns an interval containing all possible dot products.
Equations
- LeanCert.Engine.IntervalVector.dotProduct [] [] prec = LeanCert.Core.IntervalDyadic.singleton (LeanCert.Core.Dyadic.ofInt 0)
- LeanCert.Engine.IntervalVector.dotProduct (w :: ws) (I :: Is) prec = (LeanCert.Engine.IntervalVector.scalarMulInterval w I prec).add (LeanCert.Engine.IntervalVector.dotProduct ws Is prec)
- LeanCert.Engine.IntervalVector.dotProduct weights inputs prec = LeanCert.Core.IntervalDyadic.singleton (LeanCert.Core.Dyadic.ofInt 0)
Instances For
Helper: real dot product of two lists
Equations
- LeanCert.Engine.IntervalVector.realDotProduct [] [] = 0
- LeanCert.Engine.IntervalVector.realDotProduct (w :: ws) (x :: xs) = ↑w * x + LeanCert.Engine.IntervalVector.realDotProduct ws xs
- LeanCert.Engine.IntervalVector.realDotProduct weights values = 0
Instances For
Zero is in the zero singleton
Soundness of dot product for matching-length lists
Soundness of dot product: if each x_i ∈ I_i, then ∑ w_i * x_i ∈ dotProduct
Vector Addition #
Pointwise addition of two interval vectors
Equations
- Is.add Js = List.zipWith LeanCert.Core.IntervalDyadic.add Is Js
Instances For
Soundness of vector addition (component-wise)
Zero interval (singleton at 0)
Equations
Instances For
Matrix-Vector Operations #
Matrix-vector multiplication: W · x where W is a matrix of rational weights and x is an interval vector. Each row of W is dotted with x.
Equations
- LeanCert.Engine.IntervalVector.matVecMul W x prec = List.map (fun (row : List ℚ) => LeanCert.Engine.IntervalVector.dotProduct row x prec) W
Instances For
Real matrix-vector multiplication
Equations
- LeanCert.Engine.IntervalVector.realMatVecMul W x = List.map (fun (row : List ℚ) => LeanCert.Engine.IntervalVector.realDotProduct row x) W
Instances For
Soundness of matrix-vector multiplication
Add a rational bias vector to an interval vector
Equations
- One or more equations did not get rendered due to their size.
Instances For
Real vector plus bias
Equations
- LeanCert.Engine.IntervalVector.realAddBias xs bias = List.zipWith (fun (x : ℝ) (b : ℚ) => x + ↑b) xs bias
Instances For
Soundness of bias addition