Reference · Matrices
rainbow.math.linear.matrix.row-length-shape
Bridges executable row-length evidence to abstract matrix shape certificates. Matrix algorithms use `vector/same-shape`, `matrix/compatible`, and `matrix/rectangular` because those propositions compose well in proofs. A parser or certificate checker, however, observes natural-number lengths. This module closes that boundary: equal vector lengths -> vector/same-shape every row has the reference length -> matrix/compatible every row has the reference length -> matrix/rectangular The empty/nonempty mismatch cases are eliminated with Nat no-confusion, not assumed. Native and axiom-free on D63.
vector/length
vector/length : (x₁ : List ℚ) → ℕ
List = data/Listℕ = data/Natℚ = signed/SignedRational
matrix/row-length-compatible
matrix/row-length-compatible : (x₁ : List (List ℚ)) (x₂ : List ℚ) → Prop
List = data/Listℚ = signed/SignedRational
vector/length-equality-implies-same-shape
vector/length-equality-implies-same-shape : (left right : List ℚ) (same-length : vector/length left = vector/length right) → vector/same-shape left right
= = equality/EqList = data/Listℚ = signed/SignedRational
vector/same-shape-implies-length-equality
vector/same-shape-implies-length-equality : (left right : List ℚ) (same : vector/same-shape left right) → vector/length left = vector/length right
= = equality/EqList = data/Listℚ = signed/SignedRational
matrix/row-length-compatible-implies-compatible
matrix/row-length-compatible-implies-compatible : (rows : List (List ℚ)) (values : List ℚ) (length-certificate : matrix/row-length-compatible rows values) → matrix/compatible rows values
List = data/Listℚ = signed/SignedRational
matrix/compatible-implies-row-length-compatible
matrix/compatible-implies-row-length-compatible : (rows : List (List ℚ)) (values : List ℚ) (shape-certificate : matrix/compatible rows values) → matrix/row-length-compatible rows values
List = data/Listℚ = signed/SignedRational
matrix/row-length-compatible-implies-rectangular
matrix/row-length-compatible-implies-rectangular : (rows : List (List ℚ)) (values : List ℚ) (length-certificate : matrix/row-length-compatible rows values) → matrix/rectangular rows
List = data/Listℚ = signed/SignedRational
matrix/rectangular-implies-head-row-length-compatible
matrix/rectangular-implies-head-row-length-compatible : (head : List ℚ) (tail : List (List ℚ)) (shape-certificate : matrix/rectangular (data/cons (List ℚ) head tail)) → matrix/row-length-compatible (data/cons (List ℚ) head tail) head
List = data/Listℚ = signed/SignedRational