I find the first somewhat unnatural - "grammar books" is more natural. In fact, that goes for all three sentences. I would start the first with "this" or "that" rule, not "the". I would probably not use "written". Anything in a book is, by definition, written.
Otherwise, they're all OK but note that there is a difference between "giving" a rule and "explaining" a rule.
I would probably say something like "This rule appears in all grammar books".
Interested in Language