I have noticed authors use examples in math texts in two ways: demonstrating how to perform an algorithm, or silently giving an exercise to the reader.
An instance of the "demonstration" type example would be found in any calculus textbook that goes through a calculation step-by-step detailing what is happening, etc.
The "exercise" type of example is found in most upper division and graduate texts. It gives enough information to say "Well, this gadget is an example of a group/ring/field/measure/space/etc." but fails to prove it.
So which type of example is appropriate for mathematical writing?
Well, it depends on the writing. I'm writing so I can remind myself of some field or concept, so I can learn it all over again in 5 minutes.
With this sort of writing, the "demonstrations" are more appropriate.
However, in monographs the latter seems conventional. Regarding monographs I'd like to quote Serge Lang:
I have not written this course in the style I would use for an advanced monograph, on sophisticated topics. One writes an advanced monograph for oneself, because one wants to give permanent form to one's vision of some beautiful part of mathematics, not otherwise accessible, somewhat in the manner of a composer setting down his symphony in musical notation. [Emphasis added]
From the Preface to A First Course in Calculus by Lang.
Maybe there is a happy medium, I don't know...