I'm a bit confused on the exact workings of Ampere's law. Firstly, why does the shape of the Amperian loop not matter. Is there a mathematical proof that all Amperian loops are equivalent for the purpose of this law? Secondly, the law still holds valid in the presence of external magnetic fields (ie a current producing a field but not enclosed in the loop). Clearly the magnitude of the net field will be changed from the superposition of the two fields. How is the integral able to ignore these external magnetic fields.