Orthonormal basis, two summands

I have a question, which maybe looks very simple!

It is known that if a sequence $\{f_{n}\}_{n\geq 1}$ is an orthonormal basis for a separable Hilbert space $H$ then $$\sum_{n=1}^{\infty}|\langle f, f_{n}\rangle|^{2}=\|f\|^{2}$$ for all $f\in H$.

Is the following correct:

Let $I,J$ be two disjoint subsets of the integers $\{1,2,3,...\}$ such that $I\cup J=\{1,2,3,...\}$, then

$$\sum_{n\in I}|\langle f, f_{n}\rangle|^{2}+\sum_{n\in J}|\langle f, f_{n}\rangle|^{2}=\|f\|^{2}$$ so we will have $$\sum_{n\in I}|\langle f, f_{n}\rangle|^{2}=\|f\|^{2}-\sum_{n\in J}|\langle f, f_{n}\rangle|^{2}$$ and both of the summands are finite, and we can say

$$\sum_{n\in I}|\langle f, f_{n}\rangle|^{2}=A \;(\text{which depends on}\;f)$$ $$\sum_{n\in J}|\langle f, f_{n}\rangle|^{2}=B \; (\text{depends on}\;f)$$ and $A+B=\|f\|^{2}$,

I'm just worried about convergence!

-
About convergence of what? You work with series with non-negative terms. –  Davide Giraudo Jun 16 '12 at 20:40
@Davide: So, you mean nothing wrong with the conclusion, and we can split out the two sums without any problem? –  JustWorry Jun 16 '12 at 20:43
Yes, to see that consider $[P]$, which is $1$ if $P$ is satisfied and $0$ otherwise. Then $\sum_na_n=\sum_na_n([n\in A]+[n\in B])=\sum_na_n[n\in A]+\sum_na_n[n\in B]$ (in fact it works because the two series are convergent, not because the terms are non-negative). –  Davide Giraudo Jun 16 '12 at 20:48
@Davide: The two series are convergent because of the bigger series converges, right! –  JustWorry Jun 16 '12 at 20:49
One way to think of this: $\sum_{i\in J}a_i=\sum_{i=1}^\infty a_i\chi_J(i)$, and comparison test applies. ($\chi_J$ is the characteristic function of the set $J$.) –  user31373 Jun 16 '12 at 21:05
Here, convergence is not a problem. If $P$ is an assertion, write $[P]$ a number which is $1$ if $P$ is satisfied and $0$ otherwise. The two series $\sum_{n\in\Bbb N}a_n[n\in A]$ and $\sum_{n\in\Bbb N}a_n[n\in B]$ are converging (where $a_n=|\langle f,f_n\rangle|^2$) because they consist of non-negative terms and $\sum_{n\in\Bbb N}a_n$ is converging. We can write, since $[n\in A]+[n\in B]=1$ for all $n$, $$\sum_{n\in\Bbb N}a_n=\sum_{n\in\Bbb N}a_n([n\in A]+[n\in B])=\sum_{n\in\Bbb N}a_n[n\in A]+\sum_{n\in\Bbb N}a_n[n\in B]=\sum_{n\in A}a_n+\sum_{n\in B}a_n.$$