As I understand it the heart of gauge symmetry is that I can change the phase at different points different amounts and the Lagrangian/action is unchanged. What I am not clear on is whether the changes I can make are completely arbitrary - I can make any change I want at any point - or whether the changes are a specific function evaluated at different points which lead to different amounts but the amounts are connected by the fact that they are formed by the same function. By way of crude example, let's say I have a point A with values x=1,y=2 and another point B with values x=5,y=6. By arbitrary I mean that I change the phase at point A by some amount and then completely at random - spin a wheel/toss the dice - choose to change the phase at B by some other amount. Or is it the case that the changes at each point are calculated by some function of the points. Let's say the function is 2x+3y so that at point A I change the phase by 2+6=8 whereas at B the function changes by 10+18=28. Any clarification is appreciated in advance.