Very simple to explain: if \(P\) is a statement, \([P]\) is 1 if \(P\) is true and 0 if not. So for example

\[\begin{aligned} \lbrack 1 < 2\rbrack &= 1 \\ \lbrack 1 > 2\rbrack &= 0 \end{aligned}\]

It’s like using a boolean as an integer in C or Python.

It’s useful to keep yourself organized when you’re writing summations, especially if you’re summing across terms with a weird condition or if you need to exchange two sums. It’s also useful for writing pathological functions concisely.