I have experimented with a couple of variants that seem better than the definition I originally proposed.