Samurai used to be defined by their ability to use horses and bows in the early history of Japan. This moved to using the sword, first tachi then katana. Within the Tokugawa period, the katana became an almost mythical status and spiritual symbol -- as far as I know. But who started the meme that the katana is a reflection of the soul of the samurai?
This is stated in the Book of Five Rings, written by samurai Miyamoto Musashi circa 1645. Musashi was considered a "sword saint" and an almost supernatural samurai, having never lost a battle. He invented several sword fighting techniques, the most famous of which was the Niten Ichi-ryū. He wrote the book as a sort of reckoning on why he had been so lucky to survive and analyzing the current sword styles.