# Linear Code

If the linear combination of codewords is also a codeword, the code is called a [linear code](https://en.wikipedia.org/wiki/Linear_code).

$$
c\_1, c\_2 \in C \land a \cdot c\_1 + b \cdot c\_2 \in C
$$

where $$a, b \in \mathbb{F}\_q$$.

**Reed-Solomon (RS) codes**, which are commonly used, satisfy this property and are therefore linear codes. (This property allows the folding operation to be used in RS-based FRI.)

$$
\mathsf{Enc}(f\_1) = {f\_1(\omega), f\_1(\omega^2), f\_1(\omega^3), f\_1(\omega^4)} \\
\mathsf{Enc}(f\_2) = {f\_2(\omega), f\_2(\omega^2), f\_2(\omega^3), f\_2(\omega^4)} \\
\mathsf{Enc}(a\cdot f\_1 + b \cdot f\_2) =
\Big{
\begin{aligned}
a\cdot f\_1(\omega) + b\cdot f\_2(\omega), a\cdot f\_1(\omega^2) + b\cdot f\_2(\omega^2), \ a\cdot f\_1(\omega^3) + b\cdot f\_2(\omega^3), a\cdot f\_1(\omega^4) + b\cdot f\_2(\omega^4)
\end{aligned}
\Big}
$$

The traditional encoding function used in RS-codes involves FFT operations. However, due to the limitations mentioned earlier, alternative encoding methods must be explored.

> Written by [Ryan Kim](mailto:undefined) of Fractalyze


---

# 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://fractalyze.gitbook.io/intro/primitives/coding-theory/linear-code.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.
