The executable-Vector ↔ Mathlib-Fin n → R equivalence, the fold-to-Finset.sum
bridge for dot products, and the matrix-vector-product correspondence.
These are the base facts through which the row-span, rank, and nullspace bridges
(in HexRowReduceMathlib) and the lattice bridges (in HexLLLMathlib) move
between the two vector representations.
Convert an executable Vector into Mathlib's function representation.
Equations
- HexMatrixMathlib.vectorEquiv = { toFun := fun (v : Vector R n) (i : Fin n) => v[i], invFun := Vector.ofFn, left_inv := ⋯, right_inv := ⋯ }
Instances For
vectorEquiv v has entry v[i] at i, so a caller can rewrite
vectorEquiv v i to v[i] without unfolding it.
The inverse direction of vectorEquiv materialises a function as an
executable vector entrywise: (vectorEquiv.symm f)[i] is just f i.
A left fold of (· + f ·) over List.finRange n from 0 is the finite sum
∑ i, f i; the bridge from the executable fold-sum to Mathlib's Finset.sum.
The executable dot product equals Mathlib's dotProduct of the two vectors
read through vectorEquiv.
Row i of the Mathlib matrix matrixEquiv M is the image under vectorEquiv
of the executable row Hex.Matrix.row M i, letting span/rank lemmas pass between
the two row representations.
Column j of the Mathlib matrix matrixEquiv M is the image under
vectorEquiv of the executable column Hex.Matrix.col M j.
The executable matrix-vector product transports to Mathlib's Matrix.mulVec
under matrixEquiv/vectorEquiv.