Skip to content
Rainbow docs menu

Reference · Vectors

rainbow.math.linear.vector.shape-add

Vectorssrc/rainbow/math/linear/vector/shape_add.clj0 definitions, 4 theorems

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.

Depends onmath.linear.vector.shape-map

vector/add-preserves-shape

TheoremFor all inputsNo axiomsSource, line 60

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

TheoremFor all inputsNo axiomsSource, line 201

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

TheoremFor all inputsNo axiomsSource, line 218

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

TheoremFor all inputsNo axiomsSource, line 235

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