Is Shiva really first teacher of Yoga? How was Yoga developed?
Shiva and Shanker are two different but associated concepts. Shiva means Shi+Eva or energy (Shi) that is and will always be. Shiva is the soul or the spirit or the Atma that all living beings have. This includes all movable and immovable things in the universe. One can say that all that has an atomic structure is a living thing. Shanker on the other hand is a human form of Shiva whose birth and death are unknown. Shiva in form of Shanker has always lived and will always live. Shanker Mahadev has been mentioned in Puranas as a human being who dwelled in Himalayan region including Kashmir where Shiva Tantra is known to have been created. Shiva in human form was an a yogi who married Sati & Uma and who understood the true nature of human body, its connection to the rest of the universe including stars and planets and human body's ability to achieve a universal awareness that many holy persons in India's history and in current times have been able to attain through yoga. A yogi is not an ascetic or a renunciate. Shiva as Shanker gave the knowledge of Yoga which defines the Purush or the spiritual body within the physical body with 7 chakras and 64 power centers. In short, Shiva is the ever-existing formless spirit and Shiva in form of Shanker the human is the original teacher of yoga and of dharma or religion in Hindu Dharma.
All the knowledge of Yoga dates back to Adi Guru Shiva himself, but the knowledge was propagated all over Bharat by Guru Gorakhnath of Nath Sampradaya and in modern times by Paramhans Yogananda.
Nath Siddha Matsyendranath or the ‘Fish Lord’ is the first Guru of the nine Naths. Along with Gorakhnath, he is regarded as the founder of the Nath, Kaula and Kanphata traditions. According to legend, Matsyendranath was a fisherman from Kamarupa in Assam who hooked a giant fish and was swallowed alive by it. The fish came to rest on the ocean floor near a hidden place, which Lord Shiva had chosen to convey his most secret teaching to his consort Uma. From within the belly of the fish Matsyendranath overheard these secret teachings and received his Mantra directly from Lord Shiva, Who had no option, but to make Matsyendranath His disciple. Matsyendranath spent twelve years perfecting his Sadhana living in the belly of the fish. He was eventually disgorged onto dry land.
Matsyendranath initiated the practices of Laya, Hatha and Raja Yogas. The doctrine of Yoga was given to him by Lord Shiva, but in an unusual way. According to another legend, he was thrown into the sea by his parents; because he was born on an unlucky day and he was swallowed by a fish. His name was then Lokeshvara. By the sea Lord Shiva was teaching the secrets of Yoga to Parvati. She fell asleep; but Lokeshvara heard everything while hidden in the fish. In a carving of the legend at Shrishailam he is shown with his head out of the head of the fish listening to the secret doctrine. From then Lokeshvara was called Matsyendranath, ‘Lord of the Fish.’ But, he was discovered, and at Shrishailam an adjacent carving shows Lord Shiva pointing to a fish to show Parvati, where the eavesdropper is hidden. Parvati was angry and cursed Matsyendranath to forget all the Yoga in Kadali, the land of women, where girls attempted to distract him from his meditation. Gorakhnath disguised himself as a dancing girl and rescued Matsyendranath from his enchantment through the words of his songs.
Matsyendranath had many disciples, the most prominent of which was Gorakhnath. Gorakhnath (often called Goraksha, Gorakshnath, or simply Gorakh) is traditionally said to be the originator of Hatha Yoga, the Yogic system of Asanas (physical postures) that are part of the Tantric alchemical process of physical perfection and energetic awak-ening. Gorakhnath was a great Yogi like Sant Dnyaneshwar of Alandi.