# Linear Algebra

## Vectors

A vector defines both a direction and magnitude. The coordinates of a vector are a pair of numbers that basically give instructions for how to get from the tail of that vector at the origin, to its tip.

<figure><img src="/files/53PsVriXBhoinairHTia" alt=""><figcaption></figcaption></figure>

* Two vectors are the same if they have the same magnitude and direction.
* The [zero vector](https://mathinsight.org/zero_vector), denoted by a boldface $$0$$, is the vector of zero length. Since it has no length, it is not pointing in any particular direction. There is only one vector of zero length, so we can speak of the zero vector.

To distinguish vectors from points, the convention is to write this pair of numbers vertically with square brackets around them.

### Vector Addition

Given two vectors $$a$$ and $$b$$, we form their sum $$a+b$$, as follows. We translate the vector $$b$$ until its tail coincides with the head of $$a$$. (Recall such translation does not change a vector.) Then, the directed line segment from the tail of $$a$$ to the head of $$b$$ is the vector $$a+b$$.

<figure><img src="/files/OZlDygmbVCTdcaUb4mdT" alt=""><figcaption></figcaption></figure>

* Commutative: order does not matter -> `a+b = b+a`
* Associative: `(a+b)+c = a+(b+c)`

### Scalar multiplication

<figure><img src="/files/2qeOmcDFvYksdEKPbbFo" alt=""><figcaption></figcaption></figure>

Scalar multiplications satisfies many of the same properties as the usual multiplication.

1. $$s(a+b)=sa+sb$$ (distributive law, form 1)
2. $$(s+t)a=sa+ta$$ (distributive law, form 2)
3. $$1a=a$$1
4. $$(−1)a=−a$$(−1)
5. $$0a=0$$

In the last formula, the zero on the left is the number 0, while the zero on the right is the vector $$0$$0, which is the unique vector whose length is zero.

If $$a=λb$$�=�� for some scalar $$λ$$�, then we say that the vectors $$a$$� and $$b$$� are parallel. If $$λ$$� is negative, some people say that $$a$$� and $$b$$� are anti-parallel, but we will not use that language.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://calnix.gitbook.io/zk-notes/abstract-math/linear-algebra.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
