Reference · Vectors
rainbow.math.linear.vector.shape-add
Shape preservation for truncating vector addition and subtraction. Equal-shaped inputs make vector/add's truncating zip consume both lists at the same position. A native two-list induction proves that the result has both input shapes. Subtraction follows by composing negation shape preservation with the addition theorem. Native and axiom-free on D63.
vector/add-preserves-shape
vector/add-preserves-shape : (left right : List ℚ) (same : vector/same-shape left right) → proposition/conjunction (shape₁) (shape) where shape := vector/same-shape (vector/add left right) right where shape₁ := vector/same-shape (vector/add left right) left
List = data/Listℚ = signed/SignedRational
vector/add-preserves-left-shape
vector/add-preserves-left-shape : (left right : List ℚ) (same : vector/same-shape left right) → vector/same-shape (vector/add left right) left
List = data/Listℚ = signed/SignedRational
vector/add-preserves-right-shape
vector/add-preserves-right-shape : (left right : List ℚ) (same : vector/same-shape left right) → vector/same-shape (vector/add left right) right
List = data/Listℚ = signed/SignedRational
vector/subtract-preserves-shape
vector/subtract-preserves-shape : (left right : List ℚ) (same : vector/same-shape left right) → proposition/conjunction (shape₁) (shape) where shape := vector/same-shape (vector/subtract left right) right where shape₁ := vector/same-shape (vector/subtract left right) left
List = data/Listℚ = signed/SignedRational