Definition of Ahimsa, according to the religion which invented it:
https://en.wikipedia.org/wiki/Ahimsa_in_Jainism#TransgressionsJain text list down five transgressions of the vow of ahimsa:[33]
Tying up animals too tightly,
Beating them mercilessly,
Cutting their limbs,
Overloading them,
Neglecting to feed them properly.
A king who fights in defending his empire, however, does not violate the vow of ahimsa, for his motive is to protect his subjects. The same is the case with the judge who punishes to maintain law and order.