Skip to content
Rainbow docs menu

Reference · Matrices

rainbow.math.linear.matrix.shape

Matricessrc/rainbow/math/linear/matrix/shape.clj2 definitions, 7 theorems

Explicit width and rectangularity certificates for nested-List matrices. matrix/compatible rows values says every row has the same shape as `values`. matrix/rectangular rows is true for the empty matrix and, for a nonempty matrix, says every tail row has the same shape as the head row. The accompanying laws expose constructor/destructor APIs, transport compatibility across vector shape equality, show rectangularity is inherited by matrix tails, and recover compatibility with the first row. These types make raggedness explicit before transpose or matrix composition is added. Native and axiom-free on D63.

Depends onmath.finite.matrix

matrix/compatible

DefinitionSource, line 58

matrix/compatible :
  (x₁ : List (List ℚ)) (x₂ : List ℚ)
  → Prop

List = data/Listℚ = signed/SignedRational

matrix/rectangular

DefinitionSource, line 84

matrix/rectangular :
  (x₁ : List (List ℚ))
  → Prop

List = data/Listℚ = signed/SignedRational

matrix/compatible-nil

TheoremFor all inputsNo axiomsSource, line 101

matrix/compatible-nil :
  (values : List ℚ)
  → matrix/compatible [] values

List = data/Listℚ = signed/SignedRational

matrix/compatible-cons

TheoremFor all inputsNo axiomsSource, line 110

matrix/compatible-cons :
  (row : List ℚ) (tail : List (List ℚ)) (values : List ℚ)
  (head-shape : vector/same-shape row values)
  (tail-compatible : matrix/compatible tail values)
  → matrix/compatible (data/cons (List ℚ) row tail) values

List = data/Listℚ = signed/SignedRational

matrix/compatible-head-shape

TheoremFor all inputsNo axiomsSource, line 128

matrix/compatible-head-shape :
  (row : List ℚ) (tail : List (List ℚ)) (values : List ℚ)
  (rows-compatible : matrix/compatible (data/cons (List ℚ) row tail) values)
  → vector/same-shape row values

List = data/Listℚ = signed/SignedRational

matrix/compatible-tail

TheoremFor all inputsNo axiomsSource, line 146

matrix/compatible-tail :
  (row : List ℚ) (tail : List (List ℚ)) (values : List ℚ)
  (rows-compatible : matrix/compatible (data/cons (List ℚ) row tail) values)
  → matrix/compatible tail values

List = data/Listℚ = signed/SignedRational

matrix/compatible-transport

TheoremFor all inputsNo axiomsSource, line 164

matrix/compatible-transport :
  (rows : List (List ℚ)) (left right : List ℚ)
  (reference-shape : vector/same-shape left right)
  (left-compatible : matrix/compatible rows left)
  → matrix/compatible rows right

List = data/Listℚ = signed/SignedRational

matrix/rectangular-tail

TheoremFor all inputsNo axiomsSource, line 231

matrix/rectangular-tail :
  (head : List ℚ) (tail : List (List ℚ))
  (rows-rectangular : matrix/rectangular (data/cons (List ℚ) head tail))
  → matrix/rectangular tail

List = data/Listℚ = signed/SignedRational

matrix/compatible-with-head-of-rectangular

TheoremFor all inputsNo axiomsSource, line 282

matrix/compatible-with-head-of-rectangular :
  (head : List ℚ) (tail : List (List ℚ))
  (rows-rectangular : matrix/rectangular (data/cons (List ℚ) head tail))
  → matrix/compatible (data/cons (List ℚ) head tail) head

List = data/Listℚ = signed/SignedRational