In what sense addition modulo $n$ ($n>2$) isn't linear in the field $\mathbb{F}_2$? I've been reading the Reason why “XOR” is a linear operation, but ordinary “addition” isn’t? question, in which one of the answers states that addition modulo $n$ ($n&gt;2$) is linear in $\mathbb{Z}_n$ but not in $\mathbb{F}_2$, it also states that - conversely - $XOR$ is linear in $\mathbb{F}_2$ but not in $\mathbb{Z}_n$($n&gt;2$).

But in what sense?

I mean, how can I think about a $n$ ($n&gt;2$) modular addition in $\mathbb{F}_2$?

When I've to sum modulo $n$ I usually sum the digits modulo $10$ (or directly reducing them modulo $n$ before doing the sum) and then reduce the result modulo $n$

F.i.: Taking $n = 3, x_1=2, x_2=2$

$$x_1+x_2 = 2+2 = 4 = 1 \pmod 3$$

But how can I think about a sum modulo $n$ in $\mathbb{F}_2$ ? And why it isn't linear in $\mathbb{F}_2$?

Conversely, how can I think about a $XOR$ in $\mathbb{Z}_n$, and why it isn't linear?
Sicne your question is refering to an answer on this site, I will not quote the entire answer here. But the crucial point is there in the last paragraph:


  If none of that made any sense to you, that's OK. You just need to read up about Abstract Algebra, and Fields, Rings and Groups. It's a fascinating and beautiful area of mathematics, and much of cryptography will make no sense without at least some understanding of it.


I can only suggest you do the same and carefully read the answer again, because $\mathbb{F}_2$ was not mentioned in the answer at all. It contained statements about (finite) fields of Characteristic 2, which are $\mathbb{F}_{2^k}$ for any integer $k$.

If you carefully read the statements again, you will see that $\mathbb{F}_2$ actually meets both criteria, being a finite field of characteristic 2 and being a ring of the form $\mathbb{Z}_n$. In fact, XOR and modular addition are the very same group operation. It is quite obvious in this example, but could easily be checked by writing down the operator tables.

Considering your real question about linearity in finite fields, let's look at $\mathbb{F}_4$, which has characteristic 2, and is also described in the according Wiki article.
So we got $\mathbb{F}_4 = {0,1,a,1+a}$, where addition is just the normal addition of polynomials, coefficients are reduced modulo 2, and multiplicaion is the regular multiplication of polynomials modulo $X^2+X+1$.

Unfortunately, the answer in question has a few points, which only make sense under a certain point of view. Basically, if you consider a number in a binary format, and then interpret each bit as a coefficient in $\mathbb{F}_{2^k}$ (see above construction for $\mathbb{F}_4$, with 2 coefficients before $a$ and a constant $1$), then XOR-ing numbers can be interpreted as the actual addition of polynomials in that finite field. However, you can't express XOR in $\mathbb{Z}_4$ as a linear equation - which has a quite different meaning than linear function in algebra. Analog, you can't express addition modulo 4 (in  $\mathbb{Z}_4$) as linear equation in the field $\mathbb{F}_4$.

As a final note I can only say: Notation and details matter a lot in algebra. Especially if you don't understand the exact statement, this becomes even more important to avoid confusion  - or even worse, that you learn something that is just false.