Why is the magnetic field outside a solenoid considered zero? While applying Ampere's  law to derive the magnetic field of a solenoid,
why can we consider $\vec{\bf B }$ to be zero just outside the solenoid?
For example here it says "Only the upper portion of the path contributed to the sum because the magnetic field is zero outside..". What is the proper justification for this statement?
 A: For an infinite solenoid, you can argue by symmetry that the $B$-field outside the solenoid has to be parallel to the axis. From this, by varying the size of the loop used in Ampere's law, you can show that the $B$-field outside the solenoid (whatever strength it is) does not vary with distance from the solenoid.
It's pretty easy to show that the $B$-field goes to zero from a solenoid, even an infinite one, as the distance from the solenoid goes to infinity. And so the $B$-field has to be uniformly zero outside the solenoid.
For a finite solenoid, if you  are not close to the ends, you can argue that the missing parts of the infinite solenoid shouldn't affect the $B$-field much, and so the field is weak outside the solenoid as compared to inside.
A: You are right, there has to be some magnetic field outside the solenoid as well, but that magnetic field is so weak that it is not considered for theoretical purposes.
What actually matters is the Magnetic Flux. Inside a solenoid the magnetic flux is too high (large number of magnetic field lines crossing a small cross-sectional area) whereas, outside the solenoid, the spacing between the field lines increases, i.e., the number of lines crossing per unit area reduces considerably. Thus, in comparison to inside volume of a solenoid, the magnetic field outside the solenoid is relatively zero. You can include that magnetic field in your calculation but that would make the mathematics little more difficult.
A: This question was asked long ago but here is the correct explanation for the newcomers

*

*The magnetic flux outside the solenoid is considered to be zero. This is only considered to be 0 but it is not zero it has some values.
2.It is considered to be zero because the number of magnetics lines of forces passing
from outside through a cross section of a solenoid, is less as compared to number of lines passing through the inner part of the solenoid. Or the magnetic flux of outside is very low in comparison with the inner side.

