I'm reading calculus by Spivak, I don't understand the last step of the proof. Here's the proof (Spivak uses the darboux definition of integral)
If $f$ and $g$ are integrable on $[a,b]$, then $f+g$ is integrable on [a,b] and $$\int_a^b f + g = \int_a^b f + \int_a^bg$$
Proof:
Let $P = \{t_0, \dots, t_n\}$ be any partition of $[a, b]$ and define $$m_i = \inf\{(f+g)(x): t_{i-1} \leq x \leq t_i \}\\ m_i' = \inf\{f(x): t_{i-1} \leq x \leq t_i \}\\ m_i'' = \inf\{g(x): t_{i-1} \leq x \leq t_i \}$$
And define $M_i$, $M_i'$, $M_i''$ similarly(same set, but take supremum)
We have $$m_i \geq m_i' + m_i''$$ and $$M_i \leq M_i' + M_i''$$
Therefore $$L(f,p) + L(g,p) \leq L(f+g, p)$$ and $$ U(f,p) + U(g,p) \geq U(f+g, p) $$
thus $$ L(f,p) + L(g,p) \leq L(f+g, p) \leq U(f+g, p) \leq U(f,p) + U(g,p) $$
Since $f$ and $g$ are integrable, there are partitions $P'$ and $P''$ with $$U(f, P') -L(f,P') < \epsilon/2$$ $$U(g, P'') -L(g,P'') < \epsilon/2$$ If $P$ contains both $P'$ and $P''$, then $$U(f,P) + U(g, P) - [L(f, P) + L(g, P)] < \epsilon $$ and consequently $$U(f+g, P) -L(f+g,P) < \epsilon$$
This proves that $f+g$ is integrable on $[a,b]$(I understand this)
Moreover (This is the part I don't understand) $$ L(f,P) + L(g, P) \leq L(f+g, P) \leq \int_a^b f+g \leq U(f+g, P) \leq U(f,P) + U(g, P)\label{a} \tag{1}$$ and $$ L(f,P) + L(g, P) \leq \int_a^b f+ \int_a^b g \leq U(f,P) + U(g, P)\label{b} \tag{2}$$
Since $U(f, P) -L(f,P) $ and $U(g, P) -L(g,P) $ can both be made as small as desired, it follows that $$U(f,P) + U(g, P) - [L(f, P) + L(g, P)] $$ can also be made as small as desired, it therefore follows from $(1)$ and $(2)$ that $$\int_a^b f + g = \int_a^b f + \int_a^bg$$
I don't understand why that proves that $\int_a^b f + g = \int_a^b f + \int_a^bg$, I guess that both $\int_a^b f + g $ and $\int_a^b f + \int_a^bg$ get squeezed to the same value.
As far as I understand, the way to prove that $\int_a^b f = t $ is to show that $$ \sup\{L(f,P): P \text{ a partition of } [a,b]\} \leq t \leq \inf\{U(f,P): P \text{ a partition of } [a,b]\} $$
So how does that imply that $$ \sup\{L(f + g,P): P \text{ a partition of } [a,b]\} \leq \int_a^b f + \int_a^b g \leq \inf\{U(f+g,P): P \text{ a partition of } [a,b]\} $$?
Thanks in advance
Actually, instead of $(1)$, what Spivak proves is that$$L(f,P)+L(g,P)\leqslant L(f+g,P)\leqslant\int_a^bf+g\leqslant U(f+g,P)\leqslant U(f,P)+U(g,P)\tag{1'}$$and, instead of $(2)$, what Spivak proves is that$$L(f,P)+L(g,P)\leqslant\int_a^bf+\int_a^b g\leqslant U(f,P)+U(g,P).\tag{2'}$$So, given $\varepsilon>0$, you take a partition $P$ such that both $U(f,P)-L(f,P)<\frac\varepsilon2$ and that $U(g,P)-L(g,P)<\frac\varepsilon2$. So, it follows from $(1')$ and $(2')$ that$$\left\lvert\int_a^bf+g-\left(\int_a^bf+\int_a^b g\right)\right\rvert<\varepsilon.$$Since this occurs for each $\varepsilon>0$,$$\int_a^bf+g=\int_a^b f+\int_a^bg.$$