There is a live internal question about how much of the opening constitutes the formula proper, and it is not merely pedantic.
Some traditions treat it as ending at gur prasad, making it the nine-term statement above. Others continue into the following lines, and the Sikh Rehat Maryada and various lineages differ on where the boundary falls. The disagreement matters for recitation practice and for what is inscribed on buildings and documents, and it is an ordinary example of a community negotiating the edges of its own most-repeated text.
More consequential is what the formula is used for. Its terms are the reference point Sikh writers return to when arguing about the tradition's boundaries, against image worship, against ritual specialists, against the notion that the Gurus were divine incarnations, and against the classification of Sikhism as a variety of Hinduism. The last of those has been a legal as well as a theological argument in India, where certain statutes have grouped Sikhs under a broader heading for particular purposes.
Recording this under a Sanskritic heading requires a note of the same kind made elsewhere in this collection. Sikh usage has its own term, and the tradition would not describe the opening as a mantra in the sense the Hindu tantric material uses. The Punjabi word mantar is used within Sikh writing, and Nanak's own compositions use it, but with the sense of a teaching or a saying rather than of an efficacious sound. The comparative filing here is an organisational choice for this collection, and the tradition's own emphasis is that the words are to be understood, not merely produced.