The code that implements the /proc filesystem and some of its entries can be found in /usr/src/linux/fs/proc. Portions of the proc namespace are registered using the kernel function proc_register().
$ ls -l /proc/version
$ cat /proc/version
$ man 5 proc