I am confused how the range of summation changed from a + b = c to a. What I am able to understand is that a + b = c constrains the values. e.g. if c = 2 then a, b could be one of
(0, 2)
(1, 1)
(2, 0)

But a is a variable, so what does having that as range keep the equation same?

It so happens that if you plot the set of all the points (a, b) that satisfy the equation above, you’ll get a line. For example, here is a + b = 50.

A summation over “a + b = c” simply means that you only want to include the points a, b that fall on this line. It’s thus enough that you iterate over the values of a and use c - a as the value of b.