The allegory of a rope being mistaken for a snake to explain subtle metaphysical points is widespread in Buddhist literature. In particular, Je Tsongkhapa uses this allegory many times in his works to explain subtle distinctions of his formulation of Prasangika Madhyamaka.
I am looking to track down the earliest usage of this rope or snake allegory in Buddhist literature. I have not been able to identify any sutra where this allegory is mentioned, but it occurs many times in later commentarial literature on the perfection of wisdom sutra's as well as in explanations of Nagarjuna's writing.
The earliest usage I have been able to discover is from Chandrakirti's explanation of Aryadeva's Four Hundred Stanzas on the Middle Way (Chatuhshataka). Here is Aryadeva's stanza 178:
Apart from concepuality,
Desire and so forth have no existence,
Who with intelligence would hold [that there are]
Real things [imputed by] conceptuality?
To which ChandraKirti apparently gives this explanation:
Those which exist only when the conceptuality [apprehending] exists and do not exist when conceptuality does not are without question definite as not established by way of their own nature, like a snake imputed to a coiled rope.
Does anyone know of any earlier or contemporary usages of this allegory in Buddhist literature? Anything that can be traced back to Nagarjuna, Aryadeva, Chandrakirti, Buddhapalita, or Bhaviveka would certainly apply. Of course, if it can be found in sutra that would definitely count as an answer.