# Why is Ampère's law violated if there are no fringe fields?

What's wrong with the following diagram?

Image source: Page 183, NCERT Physics Textbook for Class XII Part I

The reason stated in my textbook is as follows:

Magnetic field lines between two pole pieces cannot be precisely straight at the ends. Some fringing of lines is inevitable. Otherwise, Ampere’s law is violated. This is also true for electric field lines.

I don't understand how is Ampere's law violated when fringe fields are absent.
Can anyone please explain how Ampere's law is violated?

• Related: What is the reason for the edge effect in capacitors? (Note that the linked question deals with the electric field between the plates of a capacitor whereas this one deals with the magnetic field between the poles of a magnet) Apr 28 '20 at 7:07

Consider the two paths $ABCDA$ and $EFGHE$.
Path $AB$ contributes a positive value to the $\vec B\cdot d\vec l$ integral but the other parts of the loop contribute nothing, so overall there is a finite value for the $\vec B\cdot d\vec l$ integral but no enclosed current which violates Ampere's law.
Again path $EF$ contributes a positive value to the $\vec B\cdot d\vec l$ integral but now all the other parts of the loop contribute a negative value to the $\vec B\cdot d\vec l$ integral with the result that the total integral is zero as is the enclosed current.